comparison src/testApp.cpp @ 40:0d66ecd1f4d3

added output file writing to export alignment data
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Wed, 25 Apr 2012 00:24:20 +0100
parents f5de07b4d733
children 6a7982661703
comparison
equal deleted inserted replaced
39:f5de07b4d733 40:0d66ecd1f4d3
39 void testApp::update(){ 39 void testApp::update(){
40 eventMatcher.updatePosition(); 40 eventMatcher.updatePosition();
41 41
42 checkForOSCmessages(); 42 checkForOSCmessages();
43 43
44 outputWriter.writeOutput(eventMatcher.synchroniser.recordedPositionTimeSent, eventMatcher.synchroniser.recordedPositionMillis, eventMatcher.synchroniser.playingPositionMillis);
45
44 } 46 }
45 47
46 void testApp::checkForOSCmessages(){ 48 void testApp::checkForOSCmessages(){
47 // check for waiting messages 49 // check for waiting messages
48 while( receiver.hasWaitingMessages() ) 50 while( receiver.hasWaitingMessages() )
95 97
96 if ( m.getAddress() == "/start" ){ 98 if ( m.getAddress() == "/start" ){
97 printf("start!\n"); 99 printf("start!\n");
98 printf("STRART TIME IN %i\n", ofGetElapsedTimeMillis()); 100 printf("STRART TIME IN %i\n", ofGetElapsedTimeMillis());
99 eventMatcher.startPlaying(); 101 eventMatcher.startPlaying();
102 outputWriter.openFile();
100 printf("TIME OUT %i\n", ofGetElapsedTimeMillis()); 103 printf("TIME OUT %i\n", ofGetElapsedTimeMillis());
101 } 104 }
102 105
103 if ( m.getAddress() == "/stop" ){ 106 if ( m.getAddress() == "/stop" ){
104 printf("stop!\n"); 107 printf("stop!\n");
105 eventMatcher.stopPlaying(); 108 eventMatcher.stopPlaying();
109 outputWriter.closeFile();
106 } 110 }
107 111
108 if ( m.getAddress() == "/accompanimentRatio" ){ 112 if ( m.getAddress() == "/accompanimentRatio" ){
109 double time = m.getArgAsFloat(0); 113 double time = m.getArgAsFloat(0);
110 double ratio = m.getArgAsFloat(1); 114 double ratio = m.getArgAsFloat(1);