get peak levels from channels:
BASS_ChannelGetLevelEx(chan, levels, 0.02, BASS_LEVEL_STEREO );
this function i call in thread with same frequency
void Thread::run()
{
while(!m_abort)
{
emit SetLevels();
QThread::msleep(20);
}
}
level meter draw via QPainter
that's what happens
running like crazy, making sharp jumps. but must be smoothly
how make it level smoothly?
When your new peak value is greater than the current peak value, then just assign the new value. If it's less then decrease the current value in a logarithmic way like so..
float factor = 0.10;
cur_left_value = cur_left_value - factor * (cur_left_value - new_left_value);
The greater the factor is, the faster your peak meters will "fall". You will have to have a timer or thread to continuously assign the latest (new) peak values with the logic explained above.