Mercurial > hg > midi-score-follower
comparison src/testApp.cpp @ 2:5581023e0de4
Added separate CannamMidiFileLoader class to handle the loading in.
author | Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk> |
---|---|
date | Fri, 19 Aug 2011 01:26:40 +0100 |
parents | 1a32ce016bb9 |
children | de86d77f2612 |
comparison
equal
deleted
inserted
replaced
1:1a32ce016bb9 | 2:5581023e0de4 |
---|---|
17 | 17 |
18 screenWidth = ofGetWidth(); | 18 screenWidth = ofGetWidth(); |
19 screenHeight = ofGetHeight(); | 19 screenHeight = ofGetHeight(); |
20 midiEvents.screenWidth = &screenWidth; | 20 midiEvents.screenWidth = &screenWidth; |
21 midiEvents.screenHeight = &screenHeight; | 21 midiEvents.screenHeight = &screenHeight; |
22 ofSetFrameRate(100); | 22 midiEvents.drawTempoMode = false; |
23 ofSetFrameRate(30); | |
23 } | 24 } |
24 | 25 |
25 //-------------------------------------------------------------- | 26 //-------------------------------------------------------------- |
26 void testApp::update(){ | 27 void testApp::update(){ |
27 if (playing){ | 28 if (playing){ |
204 | 205 |
205 | 206 |
206 int testApp::cannamMainFunction(){ | 207 int testApp::cannamMainFunction(){ |
207 | 208 |
208 | 209 |
209 midiEvents.clearAllEvents(); | 210 midiEvents.clearAllEvents(); |
210 | 211 |
211 //int main(int argc, char **argv) | 212 //int main(int argc, char **argv) |
212 //{ | 213 //{ |
213 // if (argc != 2) { | 214 // if (argc != 2) { |
214 // cerr << "Usage: midifile <file.mid>" << endl; | 215 // cerr << "Usage: midifile <file.mid>" << endl; |
215 // return 1; | 216 // return 1; |
216 // } | 217 // } |
217 | 218 |
218 std::string filename = midiFileName;//argv[1]; | 219 std::string filename = midiFileName;//argv[1]; |
219 | 220 |
220 MIDIFileReader fr(filename); | 221 fileLoader.loadFile(filename, midiEvents); |
222 | |
223 }//new end of load function | |
224 | |
225 | |
226 | |
227 | |
228 //trying to port to new class | |
229 /* | |
230 MIDIFileReader fr(filename); | |
231 | |
221 if (!fr.isOK()) { | 232 if (!fr.isOK()) { |
222 std::cerr << "Error: " << fr.getError().c_str() << std::endl; | 233 std::cerr << "Error: " << fr.getError().c_str() << std::endl; |
223 return 1; | 234 return 1; |
224 } | 235 } |
225 | 236 |
416 } | 427 } |
417 | 428 |
418 | 429 |
419 } | 430 } |
420 | 431 |
421 //} | 432 }//end cannam midi main |
422 | 433 |
423 | 434 */ |
424 | 435 |
425 | 436 |
426 }//end cannam midi main | |
427 |