From dba01ce870165fd8d8a5fea921cb31f7c4e8c25f Mon Sep 17 00:00:00 2001 From: Comment Date: Mon, 10 Dec 2012 19:30:27 +0000 Subject: fixed race condition in asterisk driver --- vfg/src/Puppet.h | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'vfg/src/Puppet.h') diff --git a/vfg/src/Puppet.h b/vfg/src/Puppet.h index 1f6d90a..d685a76 100755 --- a/vfg/src/Puppet.h +++ b/vfg/src/Puppet.h @@ -19,6 +19,9 @@ class puppetSprite: public ofxSprite { public: void draw(float x, float y, float scale) { getCurrentImage().draw(x-(anchorPoint.x*scale),y-(anchorPoint.y*scale),getWidth()*scale,getHeight()*scale); + } + int getDuration() { + return totalFrames*(1000/frameRate); } }; @@ -28,14 +31,18 @@ class Puppet Puppet(); virtual ~Puppet(); void load(string filename); - void play(string clip); - void playNow(string clip); + void play(string clip,int time=0); + void playNow(string clip,int time=0); void draw(float x, float y, float scale=1.0f); - bool isPlaying(); + bool isPlaying(); + void clear(); protected: private: map clips; - deque playlist; + //deque playlist; + deque< pair > playlist; //time,clip = when it comes to play, pause until time, or just leave at 0 to play immediate + //time absolute + //need a clear method? should never be called really }; #endif // PUPPET_H -- cgit v1.2.3