[Summary] Made device control panel open request synchronized with other critical...
authorGreg Zharun <grygoriiz@wavesglobal.com>
Tue, 24 Feb 2015 21:01:16 +0000 (23:01 +0200)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 31 Mar 2015 21:29:41 +0000 (17:29 -0400)
Conflicts:
gtk2_ardour/tracks_control_panel.logic.cc
libs/ardour/ardour/audioengine.h
libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp

libs/ardour/ardour/audioengine.h
libs/ardour/audioengine.cc
libs/backends/wavesaudio/wavesapi/devicemanager/WCMRPortAudioDeviceManager.cpp

index 32b53102f75f1d29a99aaeee5da719716bf76f33..ed1ddb8609c7eb71a1e4cbe36eee14ef53023e71 100644 (file)
@@ -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;
index 599d6720a291c5f28d2cc7b37ba5ecdca7afc884..160a2b36dfaadbb7df61842f14ef54adfcbf9885 100644 (file)
@@ -376,6 +376,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()
 {
index 3eeee722e116ee7b83bf7b81aa127c799ed63ad0..2d9081830c30c96d766b725db9144ab875ac7c5d 100644 (file)
@@ -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;