summaryrefslogtreecommitdiff
path: root/vfg/src/music.h
diff options
context:
space:
mode:
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 {