diff options
author | Greg Zharun <grygoriiz@wavesglobal.com> | 2015-02-24 23:01:16 +0200 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-03-31 17:29:41 -0400 |
commit | ce069da6827717d1428637fb2e9d4e9cbd40b30b (patch) | |
tree | 06c581182187efc3af9e75f94e6924e81b155bf6 | |
parent | 91ae97d5c96e18cbb1f9937a961bd503ee8d5a38 (diff) |
[Summary] Made device control panel open request synchronized with other critical device operations. Made device reset correctly when control panel is closed.
Conflicts:
gtk2_ardour/tracks_control_panel.logic.cc
libs/ardour/ardour/audioengine.h
libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp
-rw-r--r-- | libs/ardour/ardour/audioengine.h | 3 | ||||
-rw-r--r-- | libs/ardour/audioengine.cc | 10 | ||||
-rw-r--r-- | libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp | 12 |
3 files changed, 21 insertions, 4 deletions
diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index 32b53102f7..ed1ddb8609 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -74,7 +74,7 @@ class LIBARDOUR_API AudioEngine : public SessionHandlePtr, public PortManager bool setup_required () const; ProcessThread* main_thread() const { return _main_thread; } - + /* START BACKEND PROXY API * * See audio_backend.h for full documentation and semantics. These wrappers @@ -106,6 +106,7 @@ class LIBARDOUR_API AudioEngine : public SessionHandlePtr, public PortManager void request_backend_reset(); void request_device_list_update(); + void launch_device_control_app(); bool is_realtime() const; bool connected() const; diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 599d6720a2..160a2b36df 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -377,6 +377,16 @@ AudioEngine::process_callback (pframes_t nframes) void +AudioEngine::launch_device_control_app() +{ + if (_state_lock.trylock () ) { + _backend->launch_control_app (); + _state_lock.unlock (); + } +} + + +void AudioEngine::request_backend_reset() { Glib::Threads::Mutex::Lock guard (_reset_request_lock); diff --git a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp index 3eeee722e1..2d9081830c 100644 --- a/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp +++ b/libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp @@ -1321,7 +1321,7 @@ WTErr WCMRPortAudioDevice::ShowConfigPanel (void *pParam) AUTO_FUNC_DEBUG; WTErr retVal = eNoErr; - if (Active()) + if (Active() && !m_ResetRequested ) { #ifdef PLATFORM_WINDOWS if(Pa_GetHostApiInfo(Pa_GetDeviceInfo(m_DeviceID)->hostApi)->type == paASIO) @@ -1329,15 +1329,21 @@ WTErr WCMRPortAudioDevice::ShowConfigPanel (void *pParam) // stop and deactivate the device bool wasStreaming = Streaming(); SetActive(false); + // show control panel for the device if (PaAsio_ShowControlPanel (m_DeviceID, pParam) != paNoError) retVal = eGenericErr; - // reset device to pick up changes - ResetDevice(); + // restore previous state for the device SetActive(true); if (wasStreaming) SetStreaming(true); + + + // reset device to pick up changes + if (!m_ResetRequested) { + m_pMyManager->NotifyClient (WCMRAudioDeviceManagerClient::RequestReset); + } } #else pParam = pParam; |