package NET.worlds.scape; import NET.worlds.console.WebControlImp; import NET.worlds.network.URL; public class WMPSoundPlayer extends SoundPlayer { protected DirectShow ds; protected boolean disabled; static int activeCount = 0; boolean playing = false; public WMPSoundPlayer(Sound owner) { super(owner); this.ds = new DirectShow(); } public static boolean isActive() { return activeCount > 0; } @Override public boolean open(float volume, float stopDist, boolean atten, boolean pan) { return true; } @Override public void start(int repeat) { String megaURL = this.owner.getURL().toString(); megaURL = WebControlImp.processURL(megaURL); this.ds.nOpen(URL.make(megaURL).unalias()); activeCount++; this.ds.nPlay(repeat); this.playing = true; } @Override public boolean position(Point3Temp cam, Point3Temp obj, Point3Temp out, Point3Temp up) { return true; } @Override public int getState() { int nativeState = this.ds.nTick(); return nativeState == 3 ? 0 : 1; } @Override public void stop() { this.ds.nStop(); activeCount--; this.playing = false; } @Override public void close() { if (this.playing) { this.stop(); } } @Override public boolean setVolume(float v) { return true; } }