/* */ package NET.worlds.scape; /* */ /* */ import NET.worlds.network.URL; /* */ /* */ /* */ /* */ /* */ /* */ public class ASFSoundPlayer /* */ extends MCISoundPlayer /* */ { /* */ float ang; /* */ float dist; /* */ float vol; /* */ int leftToRepeat; /* */ int running; /* */ private URL url; /* */ /* */ public ASFSoundPlayer(Sound owner) /* */ { /* 21 */ super(owner); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public boolean open(float volume, float stopDist, boolean atten, boolean pan) /* */ { /* 31 */ return true; /* */ } /* */ /* */ public void close() { /* 35 */ stop(); /* */ } /* */ /* */ public boolean position(Point3Temp cam, Point3Temp obj, Point3Temp out, Point3Temp up) /* */ { /* 40 */ Point3Temp toObj = Point3Temp.make(obj).minus(cam); /* 41 */ Point3Temp right = Point3Temp.make(out).cross(up); /* 42 */ float y = toObj.dot(out); /* 43 */ float x = toObj.dot(right); /* 44 */ this.ang = ((float)(Math.atan2(y, x) / 3.141592653589793D)); /* 45 */ this.dist = toObj.length(); /* */ /* */ /* 48 */ return setVolume(this.vol); /* */ } /* */ /* */ public boolean setVolume(float v) { /* 52 */ return true; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public int getState() /* */ { /* 68 */ gotFinished(!ASFThread.isActive()); /* */ /* 70 */ return this.running != 0 ? 0 : 1; /* */ } /* */ /* */ public synchronized void start(int repeatCount) { /* 74 */ if (repeatCount == 0) { /* 75 */ this.running = 0; /* 76 */ return; /* */ } /* */ /* 79 */ this.leftToRepeat = repeatCount; /* */ /* 81 */ if (this.leftToRepeat > 0) { /* 82 */ this.leftToRepeat -= 1; /* */ } /* 84 */ this.running = 1; /* */ /* */ /* 87 */ URL myURL = this.owner == null ? this.url : this.owner.getURL(); /* 88 */ this.running = 2; /* 89 */ new ASFThread(myURL, this); /* */ } /* */ /* */ /* */ public synchronized void start(URL u) /* */ { /* 95 */ this.url = u; /* 96 */ start(1); /* */ } /* */ /* */ public static void pauseSystem() { /* 100 */ ASFThread.pauseASF(); /* 101 */ WavSoundPlayer.pauseSystemExceptASF(); /* */ } /* */ /* */ public static void resumeSystem() { /* 105 */ ASFThread.resumeASF(); /* 106 */ WavSoundPlayer.resumeSystemExceptASF(); /* */ } /* */ /* */ synchronized void gotFinished(boolean f) /* */ { /* 111 */ if ((f) && /* 112 */ (this.running == 2)) { /* 113 */ start(this.leftToRepeat); /* */ } /* */ } /* */ /* */ public synchronized void stop() { /* 118 */ this.leftToRepeat = 0; /* 119 */ ASFThread.stopASF(); /* */ } /* */ /* */ public void volume(float left, float right) {} /* */ /* */ public static synchronized boolean isActive() { /* 125 */ return ASFThread.isActive(); /* */ } /* */ /* */ static synchronized void shutdown() {} /* */ /* */ static native boolean nativePlay(String paramString); /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\ASFSoundPlayer.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */