diff audio/AudioCallbackPlaySource.cpp @ 580:298d864113f0 3.0-integration

Fix flickery level meters
author Chris Cannam
date Wed, 11 Jan 2017 17:46:37 +0000
parents b3c35447ef31
children b23bebfdfaba
line wrap: on
line diff
--- a/audio/AudioCallbackPlaySource.cpp	Thu Jan 05 13:04:30 2017 +0000
+++ b/audio/AudioCallbackPlaySource.cpp	Wed Jan 11 17:46:37 2017 +0000
@@ -72,6 +72,7 @@
     m_ringBufferSize(DEFAULT_RING_BUFFER_SIZE),
     m_outputLeft(0.0),
     m_outputRight(0.0),
+    m_levelsSet(false),
     m_auditioningPlugin(0),
     m_auditioningPluginBypassed(false),
     m_playStartFrame(0),
@@ -967,6 +968,7 @@
 {
     if (left > m_outputLeft) m_outputLeft = left;
     if (right > m_outputRight) m_outputRight = right;
+    m_levelsSet = true;
 }
 
 bool
@@ -974,9 +976,11 @@
 {
     left = m_outputLeft;
     right = m_outputRight;
+    bool valid = m_levelsSet;
     m_outputLeft = 0.f;
     m_outputRight = 0.f;
-    return true;
+    m_levelsSet = false;
+    return valid;
 }
 
 void