From 64a6e2cefebfe5f6d767f709ad8ca60362f47c0f Mon Sep 17 00:00:00 2001 From: Comment Date: Mon, 17 Jun 2013 22:54:00 +0100 Subject: audio edited and synced --- 04_playobjects/src/testApp.cpp | 69 +++--------------------------------------- 1 file changed, 4 insertions(+), 65 deletions(-) (limited to '04_playobjects/src/testApp.cpp') diff --git a/04_playobjects/src/testApp.cpp b/04_playobjects/src/testApp.cpp index dac7306..360d0b0 100644 --- a/04_playobjects/src/testApp.cpp +++ b/04_playobjects/src/testApp.cpp @@ -7,7 +7,7 @@ void testApp::setup() { verdana.loadFont(ofToDataPath("verdana.ttf"), 10); - playing=0; + playing=-1; numDevices=1; string filename="TRSS_nesbitt_recordings.xml"; @@ -19,13 +19,6 @@ void testApp::setup() { int num=XML.getNumTags("rec"); if(num) { for (int i=0;i1) players[i].addPlayer(XML.getAttribute("rec","right","",i)); @@ -35,49 +28,21 @@ void testApp::setup() { else printf("no recordings found!\n"); } } - /* - for (int deviceID = 0; deviceID < numDevices; deviceID++){ - - //openNIPlayers[deviceID].stop(); - openNIPlayers[deviceID].setup(true); - openNIPlayers[deviceID].start(); - //openNIPlayers[deviceID].startPlayer(ofToDataPath(recs[playing][deviceID])); - } - */ - soundplayer.setLoop(false); - startPlayers(0); //ofSetFrameRate(25.0f); offset=0.0f; } void testApp::startPlayers(int newplayer){ - players[playing].stop(); + if (playing>-1) players[playing].stop(); + soundplayer.stop(); + usleep(100000); playing=newplayer; players[playing].play(); - //for (int deviceID = 0; deviceID < numDevices; deviceID++){ - //openNIPlayers[deviceID].stop(); - //openNIPlayers[deviceID].setup(true); - //openNIPlayers[deviceID].start(); - //openNIPlayers[deviceID].startPlayer(ofToDataPath(recs[playing].data[deviceID])); - - soundplayer.stop(); - - if (players[playing].audio!=""){ - soundplayer.loadSound(players[playing].audio); - soundplayer.play(); - //mmsoundplayer.setPositionMS(offset); - } - //} } //-------------------------------------------------------------- void testApp::update(){ - /* - for (int deviceID = 0; deviceID < numDevices; deviceID++){ - openNIPlayers[deviceID].update(); - } - */ players[playing].update(); } @@ -90,15 +55,6 @@ void testApp::draw(){ players[playing].draw(); - /* - for (int deviceID = 0; deviceID < numDevices; deviceID++){ - ofTranslate(0, deviceID * 400); - //openNIPlayers[deviceID].drawDebug(); - openNIPlayers[deviceID].drawDepth(50, 0,520,390); - openNIPlayers[deviceID].drawImage(600, 0,520,390); - } - */ - ofPopMatrix(); ofSetColor(255, 255, 255); @@ -134,23 +90,6 @@ void testApp::keyPressed(int key){ break; } if (newplaying!=playing) startPlayers(newplaying); - - /* why do this? - switch (key) { - case 't': - for (int deviceID = 0; deviceID < numDevices; deviceID++){ - openNIRecorders[deviceID].toggleRegister(); - } - break; - case 'x': - for (int deviceID = 0; deviceID < numDevices; deviceID++){ - openNIRecorders[deviceID].stop(); - } - break; - default: - break; - } - */ } //-------------------------------------------------------------- -- cgit v1.2.3