From e0ee50fa9c1cd22b930558d234dfeddfaf730bb6 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 15 May 2013 12:38:08 -0700 Subject: [PATCH] spacing changes in Audio render --- interface/src/Audio.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/interface/src/Audio.cpp b/interface/src/Audio.cpp index 348978002d..ceaac13dda 100644 --- a/interface/src/Audio.cpp +++ b/interface/src/Audio.cpp @@ -390,7 +390,6 @@ void Audio::render(int screenWidth, int screenHeight) { } glEnd(); - // Show a bar with the amount of audio remaining in ring buffer beyond current playback float remainingBuffer = 0; timeval currentTime; @@ -399,8 +398,6 @@ void Audio::render(int screenWidth, int screenHeight) { if (_lastCallbackTime.tv_usec > 0) { timeLeftInCurrentBuffer = AUDIO_CALLBACK_MSECS - diffclock(&_lastCallbackTime, ¤tTime); } - - // /(1000.0*(float)BUFFER_LENGTH_SAMPLES/(float)SAMPLE_RATE) * frameWidth if (_ringBuffer.getEndOfLastWrite() != NULL) remainingBuffer = _ringBuffer.diffLastWriteNextOutput() / PACKET_LENGTH_SAMPLES * AUDIO_CALLBACK_MSECS; @@ -421,8 +418,7 @@ void Audio::render(int screenWidth, int screenHeight) { if (_averagedLatency == 0.0) { _averagedLatency = remainingBuffer + timeLeftInCurrentBuffer; - } - else { + } else { _averagedLatency = 0.99f * _averagedLatency + 0.01f * (remainingBuffer + timeLeftInCurrentBuffer); } @@ -437,7 +433,7 @@ void Audio::render(int screenWidth, int screenHeight) { char out[40]; sprintf(out, "%3.0f\n", _averagedLatency); - drawtext(startX + _averagedLatency / AUDIO_CALLBACK_MSECS * frameWidth - 10, topY-10, 0.10, 0, 1, 0, out, 1,1,0); + drawtext(startX + _averagedLatency / AUDIO_CALLBACK_MSECS * frameWidth - 10, topY - 10, 0.10, 0, 1, 0, out, 1,1,0); //drawtext(startX + 0, topY-10, 0.08, 0, 1, 0, out, 1,1,0); // Show a Cyan bar with the most recently measured jitter stdev