Merge pull request #1074 from PhilipRosedale/master

Fixed audio mute not working, visualize gaze direction when showing head mouse
This commit is contained in:
ZappoMan 2013-10-17 12:36:30 -07:00
commit 9bd2499317
2 changed files with 46 additions and 28 deletions

View file

@ -2821,6 +2821,22 @@ void Application::displayOverlay() {
glBegin(GL_POINTS);
glVertex2f(_headMouseX - 1, _headMouseY + 1);
glEnd();
// If Faceshift is active, show eye pitch and yaw as separate pointer
if (_faceshift.isActive()) {
const float EYE_TARGET_PIXELS_PER_DEGREE = 40.0;
int eyeTargetX = (_glWidget->width() / 2) - _faceshift.getEstimatedEyeYaw() * EYE_TARGET_PIXELS_PER_DEGREE;
int eyeTargetY = (_glWidget->height() / 2) - _faceshift.getEstimatedEyePitch() * EYE_TARGET_PIXELS_PER_DEGREE;
glColor3f(0.0, 1.0, 1.0);
glDisable(GL_LINE_SMOOTH);
glBegin(GL_LINES);
glVertex2f(eyeTargetX - PIXEL_BOX/2, eyeTargetY);
glVertex2f(eyeTargetX + PIXEL_BOX/2, eyeTargetY);
glVertex2f(eyeTargetX, eyeTargetY - PIXEL_BOX/2);
glVertex2f(eyeTargetX, eyeTargetY + PIXEL_BOX/2);
glEnd();
}
}
// Show detected levels from the serial I/O ADC channel sensors

View file

@ -84,12 +84,16 @@ inline void Audio::performIO(int16_t* inputLeft, int16_t* outputLeft, int16_t* o
memset(outputLeft, 0, PACKET_LENGTH_BYTES_PER_CHANNEL);
memset(outputRight, 0, PACKET_LENGTH_BYTES_PER_CHANNEL);
// If Mute button is pressed, clear the input buffer
if (_muted) {
memset(inputLeft, 0, PACKET_LENGTH_BYTES_PER_CHANNEL);
}
// Add Procedural effects to input samples
addProceduralSounds(inputLeft, outputLeft, outputRight, BUFFER_LENGTH_SAMPLES_PER_CHANNEL);
if (nodeList && inputLeft) {
if (!_muted) {
// Measure the loudness of the signal from the microphone and store in audio object
float loudness = 0;
for (int i = 0; i < BUFFER_LENGTH_SAMPLES_PER_CHANNEL; i++) {
@ -101,7 +105,6 @@ inline void Audio::performIO(int16_t* inputLeft, int16_t* outputLeft, int16_t* o
// add input (@microphone) data to the scope
_scope->addSamples(0, inputLeft, BUFFER_LENGTH_SAMPLES_PER_CHANNEL);
}
Node* audioMixer = nodeList->soloNodeOfType(NODE_TYPE_AUDIO_MIXER);
@ -168,8 +171,7 @@ inline void Audio::performIO(int16_t* inputLeft, int16_t* outputLeft, int16_t* o
dataPacket,
BUFFER_LENGTH_BYTES_PER_CHANNEL + leadingBytes);
interface->getBandwidthMeter()->outputStream(BandwidthMeter::AUDIO).updateValue(BUFFER_LENGTH_BYTES_PER_CHANNEL
+ leadingBytes);
interface->getBandwidthMeter()->outputStream(BandwidthMeter::AUDIO).updateValue(BUFFER_LENGTH_BYTES_PER_CHANNEL + leadingBytes);
}
}