From b5115001759f0d3bf841a410cfe1881d4954a92b Mon Sep 17 00:00:00 2001 From: Comment Date: Tue, 30 Apr 2013 22:29:33 +0100 Subject: good for recording session --- TRSS_02_rec/src/main.cpp | 2 +- TRSS_02_rec/src/testApp.cpp | 41 ++++++++++++++++++++++++++++++----------- TRSS_02_rec/src/testApp.h | 2 ++ 3 files changed, 33 insertions(+), 12 deletions(-) (limited to 'TRSS_02_rec/src') diff --git a/TRSS_02_rec/src/main.cpp b/TRSS_02_rec/src/main.cpp index ddc05ed..87dc35f 100644 --- a/TRSS_02_rec/src/main.cpp +++ b/TRSS_02_rec/src/main.cpp @@ -7,7 +7,7 @@ int main( ){ ofAppGlutWindow window; - ofSetupOpenGL(&window, 640*2,480*2, OF_WINDOW); // <-------- setup the GL context + ofSetupOpenGL(&window, 1600,900, OF_FULLSCREEN); // <-------- setup the GL context // this kicks off the running of my app // can be OF_WINDOW or OF_FULLSCREEN diff --git a/TRSS_02_rec/src/testApp.cpp b/TRSS_02_rec/src/testApp.cpp index 5aad050..376d357 100644 --- a/TRSS_02_rec/src/testApp.cpp +++ b/TRSS_02_rec/src/testApp.cpp @@ -9,14 +9,14 @@ void testApp::setup() { for (int deviceID = 0; deviceID < numDevices; deviceID++){ //openNIRecorders[deviceID].setLogLevel(OF_LOG_VERBOSE); - openNIRecorders[deviceID].setup(); + openNIRecorders[deviceID].setup(false); openNIRecorders[deviceID].addDepthGenerator(); openNIRecorders[deviceID].addImageGenerator(); openNIRecorders[deviceID].setRegister(true); // this registers all the image pixels to the depth pixels openNIRecorders[deviceID].setMirror(true); // flips the image and depth sensors openNIRecorders[deviceID].start(); - openNIPlayers[deviceID].setup(); + openNIPlayers[deviceID].setup(false); openNIPlayers[deviceID].start(); filenames[deviceID]=""; @@ -25,7 +25,10 @@ void testApp::setup() { isLive=true; isRecording=false; - verdana.loadFont(ofToDataPath("verdana.ttf"), 24); + verdana.loadFont(ofToDataPath("verdana.ttf"), 10); + + startSound.loadSound("tone1.wav"); + stopSound.loadSound("tone0.wav");; } @@ -51,6 +54,9 @@ void testApp::update(){ for (int deviceID = 0; deviceID < numDevices; deviceID++){ if (isLive) { openNIRecorders[deviceID].update(); + if (isRecording){ + recorded++; + } } else { openNIPlayers[deviceID].update(); @@ -60,33 +66,43 @@ void testApp::update(){ //-------------------------------------------------------------- void testApp::draw(){ + ofBackground(0, 0, 0); ofSetColor(255, 255, 255); ofPushMatrix(); for (int deviceID = 0; deviceID < numDevices; deviceID++){ - ofTranslate(0, deviceID * 480); + ofTranslate(0, deviceID * 450); if (isLive) { - openNIRecorders[deviceID].drawDebug(); // draws all generators - //openNIRecorders[deviceID].drawDepth(0, 0); - //openNIRecorders[deviceID].drawImage(640, 0); + //openNIRecorders[deviceID].drawDebug(); // draws all generators + openNIRecorders[deviceID].drawDepth(200, 0,600,450); + openNIRecorders[deviceID].drawImage(800, 0,600,450); } else { - openNIPlayers[deviceID].drawDebug(); + //openNIPlayers[deviceID].drawDebug(); + openNIPlayers[deviceID].drawDepth(200, 0,600,450); + openNIPlayers[deviceID].drawImage(800, 0,600,450); } } ofPopMatrix(); - ofSetColor(0, 255, 0); - string msg = " MILLIS: " + ofToString(ofGetElapsedTimeMillis()) + " FPS: " + ofToString(ofGetFrameRate()); - verdana.drawString(msg, 20, numDevices * 480 - 20); + ofSetColor(255, 255, 255); + string msg = "MILLIS: " + ofToString(ofGetElapsedTimeMillis()) + "\nFPS: " + ofToString(ofGetFrameRate()); + if (isRecording) { + msg +="\nrecorded "+ofToString(recorded); + } + if (!isLive) { + msg +="\n"+filenames[0]; + } + verdana.drawString(msg, 10, 10); } //-------------------------------------------------------------- void testApp::exit(){ for (int deviceID = 0; deviceID < numDevices; deviceID++){ openNIRecorders[deviceID].stop(); + openNIPlayers[deviceID].stop(); } } @@ -98,6 +114,7 @@ void testApp::keyPressed(int key){ if (isRecording) { for (int deviceID = 0; deviceID < numDevices; deviceID++){ openNIRecorders[deviceID].stopRecording(); + stopSound.play(); } isRecording = false; break; @@ -105,8 +122,10 @@ void testApp::keyPressed(int key){ for (int deviceID = 0; deviceID < numDevices; deviceID++){ filenames[deviceID]=generateFileName(deviceID); openNIRecorders[deviceID].startRecording(generateFileName(deviceID)); + startSound.play(); } isRecording = true; + recorded=0; break; } break; diff --git a/TRSS_02_rec/src/testApp.h b/TRSS_02_rec/src/testApp.h index 16bba9a..ffb92e9 100644 --- a/TRSS_02_rec/src/testApp.h +++ b/TRSS_02_rec/src/testApp.h @@ -34,6 +34,8 @@ public: ofSoundPlayer startSound; ofSoundPlayer stopSound; + + int recorded; }; -- cgit v1.2.3