summaryrefslogtreecommitdiff
path: root/drivers/pulseaudio/audio_driver_pulseaudio.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pulseaudio/audio_driver_pulseaudio.cpp')
-rw-r--r--drivers/pulseaudio/audio_driver_pulseaudio.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
index f96247a473..797ffd67fe 100644
--- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp
+++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
@@ -37,7 +37,11 @@
#include "core/version.h"
#ifdef ALSAMIDI_ENABLED
+#ifdef SOWRAP_ENABLED
#include "drivers/alsa/asound-so_wrap.h"
+#else
+#include <alsa/asoundlib.h>
+#endif
#endif
void AudioDriverPulseAudio::pa_state_cb(pa_context *c, void *userdata) {
@@ -272,6 +276,7 @@ Error AudioDriverPulseAudio::init_output_device() {
}
Error AudioDriverPulseAudio::init() {
+#ifdef SOWRAP_ENABLED
#ifdef DEBUG_ENABLED
int dylibloader_verbose = 1;
#else
@@ -284,7 +289,7 @@ Error AudioDriverPulseAudio::init() {
if (initialize_pulse(dylibloader_verbose)) {
return ERR_CANT_OPEN;
}
-
+#endif
active.clear();
exit_thread.clear();
@@ -631,9 +636,9 @@ String AudioDriverPulseAudio::get_output_device() {
return output_device_name;
}
-void AudioDriverPulseAudio::set_output_device(String output_device) {
+void AudioDriverPulseAudio::set_output_device(const String &p_name) {
lock();
- new_output_device = output_device;
+ new_output_device = p_name;
unlock();
}
@@ -761,12 +766,6 @@ Error AudioDriverPulseAudio::input_stop() {
return OK;
}
-void AudioDriverPulseAudio::set_input_device(const String &p_name) {
- lock();
- new_input_device = p_name;
- unlock();
-}
-
void AudioDriverPulseAudio::pa_sourcelist_cb(pa_context *c, const pa_source_info *l, int eol, void *userdata) {
AudioDriverPulseAudio *ad = static_cast<AudioDriverPulseAudio *>(userdata);
@@ -821,6 +820,12 @@ String AudioDriverPulseAudio::get_input_device() {
return name;
}
+void AudioDriverPulseAudio::set_input_device(const String &p_name) {
+ lock();
+ new_input_device = p_name;
+ unlock();
+}
+
AudioDriverPulseAudio::AudioDriverPulseAudio() {
samples_in.clear();
samples_out.clear();