diff jnmr/testApp.cpp @ 52:13194a9dca77 tip

Added exporting of image and text data
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Tue, 17 Jul 2012 22:13:10 +0100
parents 158f5f38e9d3
children
line wrap: on
line diff
--- a/jnmr/testApp.cpp	Sat Mar 31 14:04:49 2012 +0100
+++ b/jnmr/testApp.cpp	Tue Jul 17 22:13:10 2012 +0100
@@ -5,6 +5,7 @@
 	this->args = args;
 }
 
+#pragma mark -Initialise
 
 //--------------------------------------------------------------
 void testApp::setup(){
@@ -98,7 +99,7 @@
 	
 	
 }
-
+#pragma mark -Update
 //--------------------------------------------------------------
 void testApp::update(){
 	if (playing){
@@ -369,19 +370,19 @@
 //	cout << "MIDI message [port: " << args.port << ", channel: " << args.channel << ", status: " << args.status << ", byteOne: " << pitch << ", byteTwo: " << args.byteTwo << ", timestamp: " << args.timestamp << "]" << endl;
 }
 
+#pragma mark -Draw
+
 //--------------------------------------------------------------
 void testApp::draw(){
 
 	midiEvents.drawFile();
-	
+/*	
 	string info = "Measure ";
 	info += ofToString(lastMeasureSent);
 	info += "  Last note ";
-	info += ofToString(lastScoreIndexSent);
-	
-	ofSetHexColor(0xFF0000);
-//	ofDrawBitmapString(info, 20, 20);
-	
+	info += ofToString(lastScoreIndexSent);	
+	ofDrawBitmapString(info, 20, 20);
+*/	
 	midiEvents.drawMidiFile(noteInStream.midiInputEvents);
 
 	//drawMuseScoreText();
@@ -408,6 +409,7 @@
 	verdana30.drawString(ratingString, 20, 60);
 }
 
+#pragma mark -keyInput
 //--------------------------------------------------------------
 void testApp::keyPressed(int key){
 
@@ -435,8 +437,6 @@
 		printf("CROSS UPDATE TOOK %f", timenow);
 	}
 
-	if (key == 'x')
-		sendNoteDataByOsc(60, 0);
 	
 	if (key == OF_KEY_LEFT){
 		
@@ -519,8 +519,20 @@
 		loadRecordedMidiFile();
 	}
 
+	if (key == 'v'){
+		midiEvents.bayesStruct.drawPrior = midiEvents.bayesStruct.drawPosterior;
+		midiEvents.bayesStruct.drawLikelihood = !midiEvents.bayesStruct.drawLikelihood;
+		midiEvents.bayesStruct.drawPrior = !midiEvents.bayesStruct.drawPrior;
+		midiEvents.bayesStruct.drawPosterior = !midiEvents.bayesStruct.drawPosterior;
+	}
 	
+	if (key == 'x'){
+	midiEvents.bayesStruct.drawPrior = !midiEvents.bayesStruct.drawPrior;
+	}
 	
+	if (key == 'g'){
+		midiEvents.writeAllDistributions();
+	}
 }
 
 void testApp::loadRecordedMidiFile(){