#ifndef PUPPET_H #define PUPPET_H #include "ofMain.h" #include "ofxSprite.h" #include "ofxXmlSettings.h" /* "base" clip will be drawn unless another clip is playing hoe to create synced anim at time 1) dead reckoning from outside 2) special clip@time method 3) change to timed clips (option?) */ class puppetSprite: public ofxSprite { //puppetSprite loops by default 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); } }; class Puppet { public: Puppet(); virtual ~Puppet(); void load(string filename); 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(); void clear(); protected: private: map clips; //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