diff options
Diffstat (limited to '06_performance/src/oni.cpp')
| -rw-r--r-- | 06_performance/src/oni.cpp | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/06_performance/src/oni.cpp b/06_performance/src/oni.cpp index 9d432d8..f4544a9 100644 --- a/06_performance/src/oni.cpp +++ b/06_performance/src/oni.cpp @@ -18,6 +18,7 @@ void syncOniPlayer::play(){ players[i]=new ofxOpenNI(); //players[i]->setSafeThreading(true); players[i]->setupFromONI(filenames[i],true); + //players[i]->setSafeThreading(true); //players[i]->addDepthGenerator(); //players[i]->addImageGenerator(); //players[i]->setRegister(true); @@ -37,7 +38,7 @@ void syncOniPlayer::play(){ } void syncOniPlayer::update(){ for (int i=0;i<players.size();i++) { - players[i]->update(); + if (playerActive) players[i]->update(); } } void syncOniPlayer::pause(){ @@ -47,7 +48,11 @@ void syncOniPlayer::pause(){ } } bool syncOniPlayer::isPlaying(){ +<<<<<<< HEAD + if (players.size()&&playerActive) return players[0]->isPlaying(); +======= if (players.size()) return players[0]->isPlaying(); +>>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e else return false; } int syncOniPlayer::getCurrentFrame(){ @@ -112,14 +117,23 @@ void syncOniPlayer::drawPoints(float _birth,float life,float dx,float dy, float //glEnable(GL_PROGRAM_POINT_SIZE); //glEnable(GL_POINT_SMOOTH); //glHint(GL_POINT_SMOOTH_HINT, GL_NICEST); +<<<<<<< HEAD + //glEnable( GL_BLEND ); + //glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); +======= glEnable( GL_BLEND ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); +>>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e //glPointSize( size); //glBegin(GL_POINTS); if (playerActive){ //apply envelope +<<<<<<< HEAD + float attackSeconds=0.5f; +======= float attackSeconds=2.0f; +>>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e float playOutFraction=0.9f; float birth; float clipTime=ofGetElapsedTimef()-startTime; @@ -172,11 +186,21 @@ void syncOniPlayer::drawPoints(float _birth,float life,float dx,float dy, float } } //glEnd(); +<<<<<<< HEAD + //glDisable( GL_BLEND ); +======= glDisable( GL_BLEND ); +>>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e //glDisable(GL_PROGRAM_POINT_SIZE); } int syncOniPlayer::getNumParticles(){ return points.size()-pointPool.size(); +<<<<<<< HEAD +} +string syncOniPlayer::getCurrentFile(){ + return filenames[0]+" "+audio; +======= +>>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e } void syncOniPlayer::stop(){ soundplayer.stop(); @@ -217,11 +241,19 @@ void oniManager::init(const char* filename){ void oniManager::startPlayer(int newplayer){ if (players.size()>newplayer){ if (playing>-1) players[playing].stop(); +<<<<<<< HEAD + usleep(10000); +======= //usleep(500000); +>>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e playing=newplayer; players[playing].play(); } } +string oniManager::getCurrentFile(){ + if (players.size()>playing&&playing>-1) return players[playing].getCurrentFile(); + else return ""; +} int oniManager::getNumClips(){ return players.size(); } @@ -235,11 +267,11 @@ void oniManager::drawWindows(){ void oniManager::drawCloud(int step){ if (players.size()>playing&&playing>-1) players[playing].drawCloud(step); } -void oniManager::previous(){ +void oniManager::next(){ int newp=(playing+1)%players.size(); startPlayer(newp); } -void oniManager::next(){ +void oniManager::previous(){ int newp=playing-1<0?players.size()-1:playing-1; startPlayer(newp); } |
