summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/ASFSoundPlayer.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-03 16:38:41 -0700
committerFuwn <[email protected]>2021-05-03 16:38:41 -0700
commite1e781bb2135ef78592226f1a3eaba4925702f1f (patch)
tree8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/scape/ASFSoundPlayer.java
downloadworlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz
worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/scape/ASFSoundPlayer.java')
-rw-r--r--NET/worlds/scape/ASFSoundPlayer.java137
1 files changed, 137 insertions, 0 deletions
diff --git a/NET/worlds/scape/ASFSoundPlayer.java b/NET/worlds/scape/ASFSoundPlayer.java
new file mode 100644
index 0000000..c66f205
--- /dev/null
+++ b/NET/worlds/scape/ASFSoundPlayer.java
@@ -0,0 +1,137 @@
+/* */ 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
+ */ \ No newline at end of file