Commit 76a52faa authored by Dan Wilcox's avatar Dan Wilcox
Browse files

draw recordinfg status with separate indicator to keep last detected language on screen

parent d06888fb
......@@ -149,7 +149,7 @@ void ofApp::draw() {
// draw current label status
ofSetColor(64, 245, 221);
ofNoFill();
ofDrawBitmapString((recording ? "listening..." : displayLabel), 50, 50);
ofDrawBitmapString(displayLabel, 50, 50);
// draw the average volume
ofPushStyle();
......@@ -177,6 +177,19 @@ void ofApp::draw() {
ofPopMatrix();
ofPopStyle();
// draw recording status
if(recording) {
if(ofGetElapsedTimef() - blinkTimestamp >= 0.5) {
blink = !blink;
blinkTimestamp = ofGetElapsedTimef();
}
if(blink) {
ofSetColor(245, 64, 64);
ofFill();
ofDrawCircle(ofGetWidth() - 50, 50, 6);
}
}
}
//--------------------------------------------------------------
......@@ -213,6 +226,8 @@ void ofApp::audioIn(ofSoundBuffer & input) {
// trigger recording in the next function call
recording = true;
recordingStarted = true;
blink = true;
blinkTimestamp = ofGetElapsedTimef();
}
// if we didnt just trigger
else {
......@@ -233,10 +248,8 @@ void ofApp::audioIn(ofSoundBuffer & input) {
}
}
}
//--------------------------------------------------------------
void ofApp::keyPressed(int key) {
......
......@@ -85,6 +85,9 @@ class ofApp : public ofBaseApp {
bool trigger = false;
bool enable = true;
bool recording = true;
bool blink = true; // recording blink state
float blinkTimestamp = 0; // blink timestamp
// osc
ofxOscSender sender;
......
Markdown is supported
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