summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/VideoSurface.java
diff options
context:
space:
mode:
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);
+ }
+}