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); } }