diff options
Diffstat (limited to 'vamphost/src/testApp.cpp')
| -rw-r--r-- | vamphost/src/testApp.cpp | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/vamphost/src/testApp.cpp b/vamphost/src/testApp.cpp index d9cbfe7..fabf712 100644 --- a/vamphost/src/testApp.cpp +++ b/vamphost/src/testApp.cpp @@ -35,7 +35,9 @@ void testApp::setup() { string soname="vamp-example-plugins.so"; string id="percussiononsets"; - int bufferSize = vamphost.init(soname,id,channels,rate,outputNo); + whichplugin=0; + + int bufferSize = vamphost.init(whichplugin,channels,rate,outputNo); left.assign(bufferSize, 0.0); @@ -54,6 +56,10 @@ void testApp::setup() { ofSetFrameRate(25); + + + + } @@ -160,6 +166,7 @@ ofSetColor(225); ofSetColor(225); string reportString = "buffers received: "+ofToString(bufferCounter)+"\ndraw routines called: "+ofToString(drawCounter)+"\nticks: " + ofToString(soundStream.getTickCount()); reportString +="\nfeatures found: "+ofToString(vamphost.numFeat)+" average signal: "+ofToString(vamphost.avg)+" samples: "+ofToString(vamphost.num); + reportString +=vamphost.key; ofDrawBitmapString(reportString, 32, 589); } @@ -206,12 +213,27 @@ void testApp::exit(){ //-------------------------------------------------------------- void testApp::keyPressed(int key){ - if( key == 's' ){ - soundStream.start(); - } - if( key == 'e' ){ - soundStream.stop(); + switch (key) { + case 's': + case 'S': + soundStream.start(); + break; + case 'e': + case 'E': + soundStream.stop(); + break; + case OF_KEY_UP: + whichplugin=((whichplugin+1)%vamphost.list.size()); + vamphost.cleanup(); + vamphost.init(whichplugin); + break; + case OF_KEY_DOWN: + whichplugin=whichplugin>0?whichplugin-1:vamphost.list.size()-1; + vamphost.cleanup(); + vamphost.init(whichplugin); + break; + } } |
