From a0ab2cd35d91ba0080f9fb870d82aa90a51a0d6c Mon Sep 17 00:00:00 2001 From: Comment Date: Wed, 28 Nov 2012 18:40:32 +0000 Subject: nearly finished except latency --- vfg/src/music.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'vfg/src/music.h') diff --git a/vfg/src/music.h b/vfg/src/music.h index 1cb92ff..a1eddc4 100755 --- a/vfg/src/music.h +++ b/vfg/src/music.h @@ -5,8 +5,8 @@ #include "Puppet.h" //Grid for drawing -static float gridX[3]={0.3,0.5,0.7}; -static float gridY[1]={0.8}; +static float gridX[4]={0.1083,0.3,0.5,0.7}; +static float gridY[2]={0.7713,0.963}; //event times are absolute integer milliseconds //--------------------------------------------------------------------------------------------------------------------------------------------- @@ -18,6 +18,7 @@ class levelscore { printf("unable to load %s check data/ folder\n",filename.c_str()); }else{ int multiplier=1000/XML.getAttribute("VFxmas", "timebase",1000,0); + length=XML.getAttribute("VFxmas", "length",0,0)*multiplier; if(XML.pushTag("VFxmas")) { for (int i=0;i levels; + }; //--------------------------------------------------------------------------------------------------------------------------------------------- class note { @@ -121,11 +124,10 @@ class lyricscore: public score { //draws lyrics to screen for a certain time public: lyricscore() { - font.loadFont("verdana.ttf", 30, true, true); - font.setLineHeight(34.0f); - font.setLetterSpacing(1.035); - ypos=(int)(((float)ofGetHeight())*0.97f); //set lyric position - fadeout=500; //ms + font.loadFont("VodafoneRg_Bd.ttf", 31*(ofGetHeight()/1080.0f), true, true); //hard coded scaling + font.setLineHeight(34.0f); + font.setLetterSpacing(1.035); + fadeout=500; //ms } void load(string filename) { if( !XML.loadFile(filename) ){ @@ -146,7 +148,6 @@ class lyricscore: public score { private: map lyrics; ofTrueTypeFont font; - int ypos; int fadeout; }; //--------------------------------------------------------------------------------------------------------------------------------------------- @@ -158,7 +159,7 @@ class musicscore: public score { void setTimeframe(int millis); void setNowpoint(float pct); void drawNotes(levelscore *levels); - void drawFlakes(levelscore *levels); + void drawFlakes(levelscore *levels,float scale); void playerControl(int key,int threshold); void makeFlakes(int threshStart,int threshEnd,levelscore *levels); @@ -189,12 +190,13 @@ class song { void setFlakeThresh(int tS,int tE); void setKeythresh(int millis); void drawNotes(); - void draw(); + void draw(float scale); int missedNote(); int hitNote(); bool isPlaying; void playerControl(int key); int getLevel(long time); + int getCurrentTime(); private: ofSoundPlayer backing; ofSoundPlayer melody; -- cgit v1.2.3