Use Juce CriticalSection for main audio processor too. Use tryEnter for changing main volume parameter. Looks like it's best to do the tryEnter stuff for everything possible...

This commit is contained in:
xenakios
2017-12-12 20:43:43 +02:00
parent 7805f1a0aa
commit 5a17f43763
3 changed files with 12 additions and 9 deletions

View File

@ -134,9 +134,12 @@ void StretchAudioSource::setMainVolume(double decibels)
{
if (decibels == m_main_volume)
return;
ScopedLock locker(m_cs);
m_main_volume = jlimit(-144.0, 12.0, decibels);
++m_param_change_count;
if (m_cs.tryEnter())
{
m_main_volume = jlimit(-144.0, 12.0, decibels);
++m_param_change_count;
m_cs.exit();
}
}
void StretchAudioSource::setLoopXFadeLength(double lenseconds)