summaryrefslogtreecommitdiff
path: root/vfg/src/music.h
diff options
context:
space:
mode:
Diffstat (limited to 'vfg/src/music.h')
-rwxr-xr-xvfg/src/music.h22
1 files changed, 12 insertions, 10 deletions
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<XML.getNumTags("Level");i++) {
levels[XML.getAttribute("Level", "Time",0,i)*multiplier]=XML.getAttribute("Level", "Lives",0,i);
@@ -68,8 +69,10 @@ class levelscore {
}
return 2<<20; // a big number
}
+ int length;
private:
map<int,int> 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<int,lyric*> 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;