From f1171b79ceeed14efaa3fea5497015548e64f0eb Mon Sep 17 00:00:00 2001 From: Greg Zharun Date: Tue, 10 Feb 2015 23:37:25 +0200 Subject: [PATCH] [Summary] Improved Port Audio event processing: Now redundant events will be filtered untill they are useful again --- .../WCMRPortAudioDeviceManager.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp index e41d879061..e6088cf140 100644 --- a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp +++ b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp @@ -1121,25 +1121,32 @@ long WCMRPortAudioDevice::ASIOMessageHook (long selector, long WCUNUSEDPARAM(val case kAsioResyncRequest: m_ResyncRequested++; std::cout << "\t\t\tWCMRPortAudioDevice::ASIOMessageHook -- kAsioResyncRequest" << std::endl; - m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::RequestReset); break; case kAsioLatenciesChanged: m_BufferSizeChangeRequested++; std::cout << "\t\t\tWCMRPortAudioDevice::ASIOMessageHook -- kAsioLatenciesChanged" << std::endl; - m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::RequestReset); + if (m_ResetRequested == 0) { + m_ResetRequested++; + m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::RequestReset); + } break; case kAsioBufferSizeChange: m_BufferSizeChangeRequested++; std::cout << "\t\t\tWCMRPortAudioDevice::ASIOMessageHook -- m_BufferSizeChangeRequested" << std::endl; - m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::RequestReset); + if (m_ResetRequested == 0) { + m_ResetRequested++; + m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::RequestReset); + } break; case kAsioResetRequest: - m_ResetRequested++; std::cout << "\t\t\tWCMRPortAudioDevice::ASIOMessageHook -- kAsioResetRequest" << std::endl; - m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::RequestReset); + if (m_ResetRequested == 0) { + m_ResetRequested++; + m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::RequestReset); + } break; case kAsioOverload: