summaryrefslogtreecommitdiff
path: root/04_playobjects/src/testApp.cpp
diff options
context:
space:
mode:
Diffstat (limited to '04_playobjects/src/testApp.cpp')
-rw-r--r--04_playobjects/src/testApp.cpp69
1 files changed, 4 insertions, 65 deletions
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;i<num;i++) {
- /*
- syncOniPlayer p;
- p.addPlayer(XML.getAttribute("rec","left","",i));
- p.addPlayer(XML.getAttribute("rec","right","",i));
- p.audio=XML.getAttribute("rec","audio","",i);
- players.push_back(p);
- */
players.push_back(syncOniPlayer());
players[i].addPlayer(XML.getAttribute("rec","left","",i));
if (numDevices>1) 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;
- }
- */
}
//--------------------------------------------------------------