diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-05-26 15:08:46 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-05-26 15:08:46 +0100 |
| commit | 30d4c7382ceb71ae2072616f95bf47fd2ec036e8 (patch) | |
| tree | c58a788c72ae2410d24c51d00c0e67f47ba127d5 /vamphost/src/testApp.cpp | |
| parent | 63971c9b5e2dcfa1b7e254cac9cac5629c776835 (diff) | |
switching vamp plugins
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 659ed35..5435f80 100644 --- a/vamphost/src/testApp.cpp +++ b/vamphost/src/testApp.cpp @@ -29,7 +29,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); @@ -48,6 +50,10 @@ void testApp::setup() { ofSetFrameRate(25); + + + + } @@ -154,6 +160,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); } @@ -200,12 +207,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; + } } |
