diff options
author | Robin Gareus <robin@gareus.org> | 2019-07-26 04:43:56 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-07-26 04:43:56 +0200 |
commit | b759fb883ea17e87ec533e866916416fa44d9c9e (patch) | |
tree | 3effeab23e1f08066ec31c0686d3b7f6bcdf3a69 /libs/backends/pulseaudio/pulseaudio_backend.cc | |
parent | 7cf68eaf7235aa4ae7f9890aebc6b812759aa00e (diff) |
Launch pavucontrol as PA's control app
Diffstat (limited to 'libs/backends/pulseaudio/pulseaudio_backend.cc')
-rw-r--r-- | libs/backends/pulseaudio/pulseaudio_backend.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libs/backends/pulseaudio/pulseaudio_backend.cc b/libs/backends/pulseaudio/pulseaudio_backend.cc index feb51e8290..f1923b1097 100644 --- a/libs/backends/pulseaudio/pulseaudio_backend.cc +++ b/libs/backends/pulseaudio/pulseaudio_backend.cc @@ -22,11 +22,14 @@ #include <stdlib.h> #include <sys/mman.h> #include <sys/time.h> +#include <sys/types.h> +#include <unistd.h> #include <glibmm.h> #include "pbd/compose.h" #include "pbd/error.h" +#include "pbd/file_utils.h" #include "pbd/pthread_utils.h" #include "ardour/port_manager.h" @@ -521,6 +524,30 @@ PulseAudioBackend::midi_option () const return get_standard_device_name (DeviceNone); } +/* External control app */ +std::string +PulseAudioBackend::control_app_name () const +{ + std::string ignored; + if (PBD::find_file (PBD::Searchpath (Glib::getenv("PATH")), X_("pavucontrol"), ignored)) { + return "pavucontrol"; + } + return ""; +} + +void +PulseAudioBackend::launch_control_app () +{ +#ifdef NO_VFORK + (void) system ("pavucontrol"); +#else + if (::vfork () == 0) { + ::execlp ("pavucontrol", "pavucontrol", (char*)NULL); + exit (EXIT_SUCCESS); + } +#endif +} + /* State Control */ static void* |