Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Hertz-Lab
Research
Intelligent Museum
Language Identifier
Commits
08ce89b6
Commit
08ce89b6
authored
Aug 12, 2021
by
Dan Wilcox
Browse files
dont draw extra graph start & end vertices, graph now goes to 0 when listening is stopped
parent
67c37acf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ofApp.cpp
View file @
08ce89b6
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment