diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-09-09 21:23:12 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-09-09 21:23:12 -0400 |
commit | 2a8923402776a4542de5d8b79cb101b1c997c36d (patch) | |
tree | dd98c854daa2994f5703cafb2115a9ccade6fbc1 /libs/backends | |
parent | 29c9d94dbe76f94e8126550fcb9513182b17fbb5 (diff) |
move control app launching back into audio backend to allow ASIO/CoreAudio model to work; push initial state of AMS dialog to backend
Issues remain with the basic model of the AMS dialog - when is
newly chosen state pushed into the backend (which can then
modify the control app button sensitivity. This is a special
problem for this button because APIs like ASIO and CoreAudio
probably don't allow us to launch a control app for an arbitrary
device, but only one actually in use. In this sense it is
different from properties like available buffer size etc, where
we can typically query without actually using the device.
Diffstat (limited to 'libs/backends')
-rw-r--r-- | libs/backends/jack/jack_audiobackend.cc | 49 | ||||
-rw-r--r-- | libs/backends/jack/jack_audiobackend.h | 1 |
2 files changed, 36 insertions, 14 deletions
diff --git a/libs/backends/jack/jack_audiobackend.cc b/libs/backends/jack/jack_audiobackend.cc index 3cbd0cd6ae..c275d37f64 100644 --- a/libs/backends/jack/jack_audiobackend.cc +++ b/libs/backends/jack/jack_audiobackend.cc @@ -23,6 +23,7 @@ #include <boost/scoped_ptr.hpp> #include <glibmm/timer.h> +#include <glibmm/spawn.h> #include "pbd/error.h" @@ -957,25 +958,45 @@ JACKAudioBackend::can_change_buffer_size_when_running () const string JACKAudioBackend::control_app_name () const { - string appname; - - std::cerr << "td = " << _target_driver << " tdev = " << _target_device << std::endl; - - if (_target_driver.empty() || _target_device.empty()) { - return appname; - } + /* Since JACK/ALSA really don't provide particularly integrated support + for the idea of a control app to be used to control a device, + allow the user to take some control themselves if necessary. + */ - if (_target_driver == "ALSA") { + const char* env_value = g_getenv ("ARDOUR_DEVICE_CONTROL_APP"); + string appname; - if (_target_device == "Hammerfall DSP") { - appname = "hdspconf"; - } else if (_target_device == "M Audio Delta 1010") { - appname = "mudita"; + if (!env_value) { + if (_target_driver.empty() || _target_device.empty()) { + return appname; + } + + if (_target_driver == "ALSA") { + + if (_target_device == "Hammerfall DSP") { + appname = "hdspconf"; + } else if (_target_device == "M Audio Delta 1010") { + appname = "mudita"; + } } + } else { + appname = env_value; } - - std::cerr << "appname retrurned as " << appname << std::endl; return appname; } +void +JACKAudioBackend::launch_control_app () +{ + string appname = control_app_name(); + + if (appname.empty()) { + error << string_compose (_("There is no control application for the device \"%1\""), _target_device) << endmsg; + return; + } + + std::list<string> args; + args.push_back (appname); + Glib::spawn_async ("", args, Glib::SPAWN_SEARCH_PATH); +} diff --git a/libs/backends/jack/jack_audiobackend.h b/libs/backends/jack/jack_audiobackend.h index 969a28a77a..1389e15c4a 100644 --- a/libs/backends/jack/jack_audiobackend.h +++ b/libs/backends/jack/jack_audiobackend.h @@ -85,6 +85,7 @@ class JACKAudioBackend : public AudioBackend { uint32_t systemic_output_latency () const; std::string control_app_name () const; + void launch_control_app (); int start (); int stop (); |