Mercurial > hg > svapp
comparison 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 |
comparison
equal
deleted
inserted
replaced
579:1a8a8980f39a | 580:298d864113f0 |
---|---|
70 m_exiting(false), | 70 m_exiting(false), |
71 m_lastModelEndFrame(0), | 71 m_lastModelEndFrame(0), |
72 m_ringBufferSize(DEFAULT_RING_BUFFER_SIZE), | 72 m_ringBufferSize(DEFAULT_RING_BUFFER_SIZE), |
73 m_outputLeft(0.0), | 73 m_outputLeft(0.0), |
74 m_outputRight(0.0), | 74 m_outputRight(0.0), |
75 m_levelsSet(false), | |
75 m_auditioningPlugin(0), | 76 m_auditioningPlugin(0), |
76 m_auditioningPluginBypassed(false), | 77 m_auditioningPluginBypassed(false), |
77 m_playStartFrame(0), | 78 m_playStartFrame(0), |
78 m_playStartFramePassed(false), | 79 m_playStartFramePassed(false), |
79 m_timeStretcher(0), | 80 m_timeStretcher(0), |
965 void | 966 void |
966 AudioCallbackPlaySource::setOutputLevels(float left, float right) | 967 AudioCallbackPlaySource::setOutputLevels(float left, float right) |
967 { | 968 { |
968 if (left > m_outputLeft) m_outputLeft = left; | 969 if (left > m_outputLeft) m_outputLeft = left; |
969 if (right > m_outputRight) m_outputRight = right; | 970 if (right > m_outputRight) m_outputRight = right; |
971 m_levelsSet = true; | |
970 } | 972 } |
971 | 973 |
972 bool | 974 bool |
973 AudioCallbackPlaySource::getOutputLevels(float &left, float &right) | 975 AudioCallbackPlaySource::getOutputLevels(float &left, float &right) |
974 { | 976 { |
975 left = m_outputLeft; | 977 left = m_outputLeft; |
976 right = m_outputRight; | 978 right = m_outputRight; |
979 bool valid = m_levelsSet; | |
977 m_outputLeft = 0.f; | 980 m_outputLeft = 0.f; |
978 m_outputRight = 0.f; | 981 m_outputRight = 0.f; |
979 return true; | 982 m_levelsSet = false; |
983 return valid; | |
980 } | 984 } |
981 | 985 |
982 void | 986 void |
983 AudioCallbackPlaySource::setSystemPlaybackSampleRate(int sr) | 987 AudioCallbackPlaySource::setSystemPlaybackSampleRate(int sr) |
984 { | 988 { |