#include "testApp.h" //-------------------------------------------------------------- void testApp::setup() { ofSetLogLevel(OF_LOG_NOTICE); verdana.loadFont(ofToDataPath("verdana.ttf"), 10); playing=0; numDevices=1; string filename="TRSS_nesbitt_recordings.xml"; if( !XML.loadFile(filename) ){ printf("unable to load recordings, check data/ folder\n"); }else{ if(XML.pushTag("TRSS")) { int num=XML.getNumTags("rec"); if(num) { for (int i=0;i1) players[i].addPlayer(XML.getAttribute("rec","right","",i)); players[i].audio=XML.getAttribute("rec","audio","",i); } } 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(); 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(); } //-------------------------------------------------------------- void testApp::draw(){ ofBackground(0, 0, 0); ofSetColor(255, 255, 255); ofPushMatrix(); 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); string msg = "MILLIS: " + ofToString(ofGetElapsedTimeMillis()); msg += "\nFPS: " + ofToString(ofGetFrameRate()); msg += "\nclip: "+ofToString(playing); msg += "\noffset: "+ofToString(offset); verdana.drawString(msg, 10, 10); } //-------------------------------------------------------------- void testApp::exit(){ } //-------------------------------------------------------------- void testApp::keyPressed(int key){ cerr<<"key: "<