summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/WMPSoundPlayer.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-02-12 22:33:32 -0800
committerFuwn <[email protected]>2026-02-12 22:33:32 -0800
commitc7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9 (patch)
treedf9f48bf128a6c0186a8e91857d6ff30fe0e9f18 /NET/worlds/scape/WMPSoundPlayer.java
downloadworldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz
worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip
Initial commit
Diffstat (limited to 'NET/worlds/scape/WMPSoundPlayer.java')
-rw-r--r--NET/worlds/scape/WMPSoundPlayer.java65
1 files changed, 65 insertions, 0 deletions
diff --git a/NET/worlds/scape/WMPSoundPlayer.java b/NET/worlds/scape/WMPSoundPlayer.java
new file mode 100644
index 0000000..9f5fadf
--- /dev/null
+++ b/NET/worlds/scape/WMPSoundPlayer.java
@@ -0,0 +1,65 @@
+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;
+ }
+}