diff options
| author | Tim Redfern <tim@getdrop.com> | 2022-11-21 19:24:17 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@getdrop.com> | 2022-11-21 19:24:17 +0000 |
| commit | cf82cdca34711eb8b1fce4ca2c6dedc7e1778c1c (patch) | |
| tree | 1009e1a709a01a3c1bef34f828cbb4717a82e475 /audioin/src/ofApp.cpp | |
| parent | 86c0c939fd74c80d00506c030b47b6aa1eb4cf71 (diff) | |
| parent | e9e9d076406bcea1a0a7461a9db4d43b8f280d49 (diff) | |
generate wave at correct coords
Diffstat (limited to 'audioin/src/ofApp.cpp')
| -rw-r--r-- | audioin/src/ofApp.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/audioin/src/ofApp.cpp b/audioin/src/ofApp.cpp index 16134ce..2309650 100644 --- a/audioin/src/ofApp.cpp +++ b/audioin/src/ofApp.cpp @@ -48,32 +48,31 @@ void ofApp::draw(){ ofSetLineWidth(lineWidth); - ofPushMatrix(); + float vpos=ofGetHeight()/2; - ofTranslate(0,ofGetHeight()/2); - - ofScale(1.0f,ofGetHeight()*vScale); + float scale=ofGetHeight()*vScale; ofPolyline line; - - line.addVertex(0,buffer[0]); + line.addVertex(0,vpos+(buffer[0]*scale)); float i=0.0f; while (i<(ofGetWidth()+hScale)){ i+=max(1.0f,hScale); - line.curveTo(i,buffer[(int)i]); + line.curveTo(i,vpos+(buffer[(int)i]*scale)); } line.draw(); - //laser.draw(line); + int numpts=0; - ofPopMatrix(); + if (laser_power) numpts=laser.draw(line); frameNum++; - ofSetWindowTitle(ofToString(ofGetFrameRate())); + lasergui.draw(); + + ofSetWindowTitle(ofToString(ofGetFrameRate())+" fps, pts:"+(numpts?ofToString(numpts):"ERR")); } |
