summaryrefslogtreecommitdiff
path: root/vfg/src/Puppet.h
diff options
context:
space:
mode:
Diffstat (limited to 'vfg/src/Puppet.h')
-rwxr-xr-xvfg/src/Puppet.h15
1 files changed, 11 insertions, 4 deletions
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<string,puppetSprite> clips;
- deque<string> playlist;
+ //deque<string> playlist;
+ deque< pair<int,string> > 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