diff options
| -rw-r--r-- | 06_performance/src/main.cpp | 7 | ||||
| -rw-r--r-- | 06_performance/src/oni.cpp | 26 | ||||
| -rw-r--r-- | 06_performance/src/oni.h | 12 | ||||
| -rw-r--r-- | 06_performance/src/testApp.cpp | 132 | ||||
| -rw-r--r-- | 06_performance/src/testApp.h | 1 | ||||
| -rwxr-xr-x | lnlocal | 6 | ||||
| -rwxr-xr-x | lnssd | 6 |
7 files changed, 72 insertions, 118 deletions
diff --git a/06_performance/src/main.cpp b/06_performance/src/main.cpp index 464bd9d..169de94 100644 --- a/06_performance/src/main.cpp +++ b/06_performance/src/main.cpp @@ -5,13 +5,8 @@ int main( ){ //ofSetupOpenGL(4080,768, OF_WINDOW); // <-------- setup the GL context -<<<<<<< HEAD - ofSetupOpenGL(2400,450, OF_WINDOW); // <-------- setup the GL context -======= + //ofSetupOpenGL(2400,450, OF_WINDOW); // <-------- setup the GL context ofSetupOpenGL(1400,262, OF_WINDOW); // <-------- setup the GL context ->>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e - - // this kicks off the running of my app // can be OF_WINDOW or OF_FULLSCREEN diff --git a/06_performance/src/oni.cpp b/06_performance/src/oni.cpp index f4544a9..944a884 100644 --- a/06_performance/src/oni.cpp +++ b/06_performance/src/oni.cpp @@ -48,11 +48,7 @@ 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(){ @@ -117,23 +113,14 @@ 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; @@ -186,21 +173,14 @@ 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(); @@ -240,12 +220,8 @@ void oniManager::init(const char* filename){ } void oniManager::startPlayer(int newplayer){ if (players.size()>newplayer){ - if (playing>-1) players[playing].stop(); -<<<<<<< HEAD + //if (playing>-1) players[playing].stop(); usleep(10000); -======= - //usleep(500000); ->>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e playing=newplayer; players[playing].play(); } diff --git a/06_performance/src/oni.h b/06_performance/src/oni.h index 305d8f1..ed761cb 100644 --- a/06_performance/src/oni.h +++ b/06_performance/src/oni.h @@ -43,10 +43,10 @@ class syncOniPlayer{ LUT=NULL; makeLUT(); playerActive=false; -<<<<<<< HEAD +//<<<<<<< HEAD points.reserve(100000); //operator new seems to be causing crshes? -======= ->>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e +//======= +//>>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e } ~syncOniPlayer(){ stop(); @@ -95,10 +95,10 @@ class oniManager{ int getNumClips(); int getNumParticles(); syncOniPlayer* getCurrentPlayer(); -<<<<<<< HEAD +//<<<<<<< HEAD string getCurrentFile(); -======= ->>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e +//======= +//>>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e void update(); void drawWindows(); void drawCloud(int step); diff --git a/06_performance/src/testApp.cpp b/06_performance/src/testApp.cpp index 0c1f4bb..ffdc895 100644 --- a/06_performance/src/testApp.cpp +++ b/06_performance/src/testApp.cpp @@ -54,10 +54,9 @@ void testApp::setup(){ rFFTanalyzer.linearEQIntercept = 0.9f; // reduced gain at lowest frequency rFFTanalyzer.linearEQSlope = 0.01f; // increasing gain at higher frequencies -<<<<<<< HEAD /* ======= ->>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e + if (4chan) { lFFTanalyzer2.setup(44100, BUFFER_SIZE/2,32); @@ -76,8 +75,7 @@ void testApp::setup(){ } <<<<<<< HEAD */ -======= ->>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e + ofSetFrameRate(60); @@ -114,11 +112,9 @@ void testApp::setup(){ F_drawFrames=10; F_drawStep=0; F_drawDecay=0.95; -<<<<<<< HEAD + F_lineWidth=1.0; //1.0; -======= - F_lineWidth=16.0; //1.0; ->>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e + F_drawAxis=90; //Y @@ -132,10 +128,8 @@ void testApp::setup(){ F_particleAmount=2000; //100 F_particleLife=0.75; //0.5 -<<<<<<< HEAD F_particleSize=16.0; //1.0; -======= ->>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e + I_fade1=0; I_fade2=0; @@ -195,12 +189,8 @@ void testApp::setup(){ videoclips.push_back(ofVideoPlayer()); videoclips[i].loadMovie(XML.getAttribute("video","file","",i)); videoclips[i].setLoopState(OF_LOOP_NONE); -<<<<<<< HEAD - videoclips[i].play(); - videoclips[i].setSpeed(0.0f); -======= - videoclips[i].stop(); ->>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e + //videoclips[i].play(); + //videoclips[i].setSpeed(0.0f); } cerr<<"loaded "<<i<<" video clips"<<endl; } @@ -208,17 +198,14 @@ void testApp::setup(){ } } + int videoplaying=-1; + xOffs=startX=yOffs=startY=0; xModel=0; -<<<<<<< HEAD yModel=-25; zModel=-1050; sModel=3.5f; -======= - yModel=0; - zModel=-550; - sModel=4.0f; ->>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e + }; @@ -235,7 +222,7 @@ void testApp::update(){ ///mrmr/pushbutton/6/Pauls-iPad 1000 - + vector<string> path; explode(m.getAddress(),'/', back_inserter(path)); @@ -249,12 +236,14 @@ void testApp::update(){ int channel=ofToInt(path[3]); if (channel>12) channel--; //12 is missing if (m.getArgAsInt32(0)==1000) { - //for (int i=0;i<videoclips.size();i++) { - // videoclips[i].stop(); - // videoclips[i].setPosition(0.01f); - //} - videoclips[channel].setPosition(0.0f); - videoclips[channel].setSpeed(1.0f); + if (videoplaying>-1&&videoclips.size()>channel) { + videoclips[videoplaying].stop(); + videoclips[videoplaying].setPosition(0.0f); + } + //videoclips[channel].setPosition(0.0f); + //videoclips[channel].setSpeed(1.0f); + videoplaying=channel; + videoclips[channel].play(); } } } @@ -271,8 +260,14 @@ void testApp::update(){ if ((channel > -1)&&videoclips.size()>channel) { if (data>0) { cerr<<"playing video "<<channel<<endl; - videoclips[channel].setPosition(0.0f); - videoclips[channel].setSpeed(1.0f); + if (videoplaying>-1&&videoclips.size()>channel) { + videoclips[videoplaying].stop(); + videoclips[videoplaying].setPosition(0.0f); + } + //videoclips[channel].setPosition(0.0f); + //videoclips[channel].setSpeed(1.0f); + videoplaying=channel; + videoclips[channel].play(); } } } @@ -314,15 +309,11 @@ void testApp::update(){ blendImage.setSpeed(F_movieSpeed); //blendImage.idleMovie(); - for (int i=0;i<videoclips.size();i++) { -<<<<<<< HEAD - if (videoclips[i].getSpeed()>0.0f) videoclips[i].update(); - if (videoclips[i].getPosition()>0.99f) videoclips[i].setSpeed(0.0f); -======= - videoclips[i].update(); - if (videoclips[i].getPosition()>0.99f) videoclips[i].stop(); ->>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e - } + if (videoplaying>-1&&videoclips.size()>videoplaying) videoclips[videoplaying].update(); + //if (videoclips[i].getSpeed()>0.01f) videoclips[i].update(); + //if (videoclips[i].getPosition()>0.99f) videoclips[i].setSpeed(0.0f); + //if (videoclips[i].isPlaying()) videoclips[i].stop(); + //} narrator.update(); @@ -336,7 +327,7 @@ void testApp::draw(){ ofSetVerticalSync(B_vSync); - + static int index=0; float lavg_power = 0.0f; float ravg_power = 0.0f; @@ -403,7 +394,7 @@ void testApp::draw(){ } - + F_xRotation+=(F_xRotate*interval); F_yRotation+=((F_yRotate+xOffs)*interval); @@ -496,40 +487,22 @@ void testApp::draw(){ ofPopMatrix(); - for (int i=0;i<videoclips.size();i++) { -<<<<<<< HEAD - if (videoclips[i].getSpeed()>0.0f) { -======= - if (videoclips[i].isPlaying()) { ->>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e - if (videoclips[i].getPosition()<0.1f) { + if (videoplaying>-1&&videoclips.size()>videoplaying) { + if (videoclips[videoplaying].getPosition()<0.1f) { glEnable(GL_BLEND); - uint8_t b=uint8_t((videoclips[i].getPosition()/0.1f)*255); + uint8_t b=uint8_t((videoclips[videoplaying].getPosition()/0.1f)*255); ofSetColor(255,255,255,b); } - else if (videoclips[i].getPosition()>0.8f) { + else if (videoclips[videoplaying].getPosition()>0.8f) { glEnable(GL_BLEND); - uint8_t b=uint8_t((1.0f-((videoclips[i].getPosition()-0.8f)/0.2f))*255); + uint8_t b=uint8_t((1.0f-((videoclips[videoplaying].getPosition()-0.8f)/0.2f))*255); ofSetColor(255,255,255,b); } else ofSetColor(255,255,255); - videoclips[i].draw(0,0,renderImage.getWidth()/3,renderImage.getHeight()); - videoclips[i].draw(renderImage.getWidth()*0.666666667,0,renderImage.getWidth()/3,renderImage.getHeight()); + videoclips[videoplaying].draw(0,0,renderImage.getWidth()/3,renderImage.getHeight()); + videoclips[videoplaying].draw(renderImage.getWidth()*0.666666667,0,renderImage.getWidth()/3,renderImage.getHeight()); glDisable(GL_BLEND); - } } -<<<<<<< HEAD - - ofPushMatrix(); - //ofTranslate(hw,hh); - camera.begin(); - ofRotateX(F_xRotation); - ofRotateY(F_yRotation); - ofRotateZ(F_zRotation); - - ofPushMatrix(); -======= - ofPushMatrix(); //ofTranslate(hw,hh); camera.begin(); @@ -538,12 +511,11 @@ void testApp::draw(){ ofRotateZ(F_zRotation); ofPushMatrix(); ->>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e //ofTranslate(0,-100,-1050); ofScale(sModel,sModel,sModel); //ofTranslate(xModel*sModel,yModel*sModel,zModel*sModel); ofTranslate(xModel,yModel,zModel); - + //narrator.drawCloud(2); narrator.drawPoints(F_particleSize,F_particleAmount,F_particleLife,F_particleX,F_particleY,F_particleZ); ofPopMatrix(); @@ -684,14 +656,10 @@ void testApp::draw(){ msg+="\n"+ofToString(narrator.getNumParticles())+" size "+ofToString(F_lineWidth); msg+="\n"+ofToString(xModel)+","+ofToString(yModel)+","+ofToString(zModel)+" * "+ofToString(sModel); syncOniPlayer *player=narrator.getCurrentPlayer(); -<<<<<<< HEAD if (player) { msg+="\n"+ofToString(player->getCurrentFrame())+","+ofToString(player->getPosition(),2); - msg+=player->getCurrentFile(); + msg+="\n"+player->getCurrentFile(); } -======= - if (player) msg+="\n"+ofToString(player->getCurrentFrame())+","+ofToString(player->getPosition(),2); ->>>>>>> fd8dc2aa23c4bbc297e835e4f920aaf5342aba5e ofDrawBitmapString(msg,20,20); } } @@ -719,13 +687,15 @@ void testApp::keyPressed (int key){ int clip=key-'1'; cerr<<"playing video clip "<<clip<<endl; if (videoclips.size()>clip) { - videoclips[clip].setPosition(0.0f); - videoclips[clip].setSpeed(1.0f); + videoclips[videoplaying].stop(); + videoclips[videoplaying].setPosition(0.0f); + videoclips[clip].play(); + videoplaying=clip; } } if(key == 't'){ for (int i=0;i<videoclips.size();i++) { - if (videoclips[i].getSpeed()>0.0f) { + if (videoclips[i].isPlaying()) { cerr<<"videoclip "<<i<<" is playing"<<endl; } } @@ -764,21 +734,21 @@ void testApp::keyPressed (int key){ F_particleX-=1; } if(key == 'k'){ - + F_particleX+=1; } if(key == 'm'){ F_particleY-=1; } if(key == 'u'){ - + F_particleY+=1; } if(key == 'i'){ F_particleZ+=1; } if(key == 'n'){ - + F_particleZ-=1; } diff --git a/06_performance/src/testApp.h b/06_performance/src/testApp.h index aec2a73..c001878 100644 --- a/06_performance/src/testApp.h +++ b/06_performance/src/testApp.h @@ -189,6 +189,7 @@ class testApp : public ofBaseApp, public ofxMidiListener{ ofxXmlSettings XML; vector<ofVideoPlayer> videoclips; + int videoplaying; ofxOscReceiver receiver; @@ -0,0 +1,6 @@ +rm ~/workspace/TRSS/06_performance/bin/data/video +rm ~/workspace/TRSS/06_performance/bin/data/audio +rm ~/workspace/TRSS/06_performance/bin/data/recs +ln -s ~/workspace/TRSS/video ~/workspace/TRSS/06_performance/bin/data/video +ln -s ~/workspace/TRSS/audio ~/workspace/TRSS/06_performance/bin/data/audio +ln -s ~/workspace/TRSS/recs ~/workspace/TRSS/06_performance/bin/data/recs @@ -0,0 +1,6 @@ +rm ~/workspace/TRSS/06_performance/bin/data/video +rm ~/workspace/TRSS/06_performance/bin/data/audio +rm ~/workspace/TRSS/06_performance/bin/data/recs +ln -s /media/tim/OCZ/TRSS/video ~/workspace/TRSS/06_performance/bin/data/video +ln -s /media/tim/OCZ/TRSS/audio ~/workspace/TRSS/06_performance/bin/data/audio +ln -s /media/tim/OCZ/TRSS/recs ~/workspace/TRSS/06_performance/bin/data/recs |
