summaryrefslogtreecommitdiff
path: root/vfg/src/music.h
diff options
context:
space:
mode:
authorTim Redfern <tim@gray.(none)>2012-11-19 21:05:27 +0000
committerTim Redfern <tim@gray.(none)>2012-11-19 21:05:27 +0000
commit891b71c261a4571e0e0ba0e824e1bdb2478e0c65 (patch)
tree2005ff07fb391fcead17d3a0679cc3f82d0ff4cd /vfg/src/music.h
parent1b56a18fc25f86591b410d32ceb19faea6fc74ea (diff)
flake animations
Diffstat (limited to 'vfg/src/music.h')
-rwxr-xr-xvfg/src/music.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/vfg/src/music.h b/vfg/src/music.h
index aaec003..96c8e1d 100755
--- a/vfg/src/music.h
+++ b/vfg/src/music.h
@@ -2,6 +2,7 @@
#include "ofMain.h"
#include "ofxXmlSettings.h"
+#include "Puppet.h"
//event times are absolute integer milliseconds
//---------------------------------------------------------------------------------------------------------------------------------------------
@@ -57,13 +58,26 @@ class note {
num=n;
velocity=v;
duration=d;
- activated=false;
}
int num;
int velocity;
int duration; //may be needed another time?
+};
+//---------------------------------------------------------------------------------------------------------------------------------------------
+class flake: public note {
+ public:
+ flake(int n,int v,int d=0) : note(n,v,d) { activated=false; }
+ Puppet puppet;
bool activated;
- void activate() { activated=true; }
+ void activate() {
+ activated=true;
+ puppet.play("shatter");
+ }
+ void draw(float x, float y) {
+ if (!activated||puppet.isPlaying()) puppet.draw(x,y);
+ }
+ bool disintegrated;
+ void disintegrate() { disintegrated=true; }
};
//---------------------------------------------------------------------------------------------------------------------------------------------
class lyric {
@@ -136,10 +150,12 @@ class musicscore: public score {
private:
map<int,note*> notes;
- map<int,note*> flakes;
- int timeframe;
- ofImage flake;
+ map<int,flake*> flakes;
+ int timeframe;
float nowpoint;
+
+ vector<Puppet> snowflakes;
+
};
//---------------------------------------------------------------------------------------------------------------------------------------------
class song {