Commit 08ce89b6 authored by Dan Wilcox's avatar Dan Wilcox
Browse files

dont draw extra graph start & end vertices, graph now goes to 0 when listening is stopped

parent 67c37acf
......@@ -193,19 +193,13 @@ void ofApp::draw() {
// draw the threshold line
ofDrawLine(0, historyHeight - volThreshold,
historyWidth, historyHeight - volThreshold);
ofSetColor(255);
// lets draw the volume history as a graph
ofSetColor(255);
ofBeginShape();
for(unsigned int i = 0; i < volHistory.size(); i++) {
if(i == 0) {
ofVertex(i, historyHeight);
}
ofVertex(i, historyHeight - volHistory[i] * 100);
if(i == volHistory.size() - 1) {
ofVertex(i, historyHeight);
}
float y = historyHeight - volHistory[i] * 100;
ofVertex(i, y);
}
ofEndShape(false);
......@@ -376,6 +370,7 @@ void ofApp::stopListening() {
soundStream.stop();
previousBuffers.clear();
sampleBuffers.clear();
smoothedVol = 0;
enable = false;
if(recording) {
recording = false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment