summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/VideoSurface.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/VideoSurface.java
downloadworldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.tar.xz
worldsplayer-c7a9d4a6bd53ed7d61731770f2f10e8b9fd435f9.zip
Initial commit
Diffstat (limited to 'NET/worlds/scape/VideoSurface.java')
-rw-r--r--NET/worlds/scape/VideoSurface.java53
1 files changed, 53 insertions, 0 deletions
diff --git a/NET/worlds/scape/VideoSurface.java b/NET/worlds/scape/VideoSurface.java
new file mode 100644
index 0000000..0bf2528
--- /dev/null
+++ b/NET/worlds/scape/VideoSurface.java
@@ -0,0 +1,53 @@
+package NET.worlds.scape;
+
+public class VideoSurface extends TextureSurface {
+ protected DirectShow _ds;
+ protected String _currentURL;
+ protected int referenceCount = 0;
+
+ public VideoSurface(Texture[] texList, int rows, int w, int h) {
+ super(texList, rows, w, h);
+ this._ds = new DirectShow(this.getHwnd());
+ }
+
+ public void incReferenceCount() {
+ this.referenceCount++;
+ }
+
+ public void decReferenceCount() {
+ this.referenceCount--;
+ }
+
+ public int getReferenceCount() {
+ return this.referenceCount;
+ }
+
+ public int tick() {
+ return this._ds.nTick();
+ }
+
+ public String getVideoUrl() {
+ return this._currentURL;
+ }
+
+ public void open(String url) {
+ if (this._currentURL == null || !this._currentURL.equals(url)) {
+ this._ds.nStop();
+ this._ds.nOpen(url);
+ this._currentURL = url;
+ }
+ }
+
+ public void stop() {
+ this._ds.nStop();
+ }
+
+ public void play(int repeat) {
+ this._ds.nPlay(repeat);
+ }
+
+ public synchronized void draw(Texture[] texList, int rows) {
+ this.setTextures(texList, rows);
+ this.draw(this._ds);
+ }
+}