Skip to content
Browse files

added mouse click control for threshold

  • Loading branch information...
1 parent 6747b85 commit 2cca533d023011bdfe3daae9e4c93f89f6f0bcd0 @elliotwoods committed
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/testApp.cpp
View
8 src/testApp.cpp
@@ -51,8 +51,10 @@ void testApp::draw(){
ofPopMatrix();
float y = 20;
- ofDrawBitmapString("Press [SPACE] to reset recording", 20, y+=10);
- ofDrawBitmapString("Press [s] to toggle sine signal generator [" + string(useSine ? "x" : " ") + "]", 20, y+=10);
+ ofDrawBitmapString("Press [SPACE] to reset recording", 20, y+=15);
+ ofDrawBitmapString("Press [s] to toggle sine signal generator [" + string(useSine ? "x" : " ") + "]", 20, y+=15);
+
+ ofDrawBitmapString("Click somewhere in the x direction to set the threshold [" + ofToString(recordTrace.getThreshold()) + "]", 20, y+=15);
}
//--------------------------------------------------------------
@@ -86,7 +88,7 @@ void testApp::mouseDragged(int x, int y, int button){
//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
-
+ recordTrace.setThreshold(float(x) / ofGetWidth() * 0.3f);
}
//--------------------------------------------------------------

0 comments on commit 2cca533

Please sign in to comment.
Something went wrong with that request. Please try again.