Skip to content

Commit

Permalink
Enable USE_MPV_PULSE_DEVICES
Browse files Browse the repository at this point in the history
  • Loading branch information
smplayer-dev committed Dec 23, 2021
1 parent 8e60202 commit cf38379
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/baseguiplus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ void BaseGuiPlus::updateSendAudioMenu() {
connect(a, SIGNAL(triggered()), this, SLOT(sendAudioClicked()));
sendAudio_menu->addAction(a);

#if USE_PULSEAUDIO_DEVICES
#if USE_PULSEAUDIO_DEVICES && !USE_MPV_PULSE_DEVICES
addListToSendAudioMenu( DeviceInfo::paDevices(), "pulse");
#endif

Expand All @@ -1176,7 +1176,7 @@ void BaseGuiPlus::updateSendAudioMenu() {
#endif

#if USE_MPV_PULSE_DEVICES
addListToSendAudioMenu( DeviceInfo::mpvPulseDevices(), "pulse");
addListToSendAudioMenu( DeviceInfo::pulseDevices(), "pulse");
#endif

#if USE_MPV_WASAPI_DEVICES
Expand Down
13 changes: 13 additions & 0 deletions src/deviceinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,19 @@ DeviceList DeviceInfo::displayDevices() {

// Linux

#if USE_PULSEAUDIO_DEVICES || USE_MPV_PULSE_DEVICES
DeviceList DeviceInfo::pulseDevices() {
DeviceList pa;
#if USE_PULSEAUDIO_DEVICES
pa = paDevices();
#endif
#if USE_MPV_PULSE_DEVICES
if (pa.isEmpty()) pa = mpvPulseDevices();
#endif
return pa;
}
#endif

#if USE_PULSEAUDIO_DEVICES
DeviceList DeviceInfo::paDevices() {
qDebug("DeviceInfo::paDevices");
Expand Down
6 changes: 5 additions & 1 deletion src/deviceinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#else
#define USE_ALSA_DEVICES 0
#define USE_MPV_ALSA_DEVICES 0
#define USE_MPV_PULSE_DEVICES 0
#define USE_MPV_PULSE_DEVICES 1
#define USE_PULSEAUDIO_DEVICES 1
#define USE_XV_ADAPTORS 1
#endif
Expand Down Expand Up @@ -73,6 +73,10 @@ class DeviceInfo {
static DeviceList dsoundDevices();
static DeviceList displayDevices();
#else
#if USE_PULSEAUDIO_DEVICES || USE_MPV_PULSE_DEVICES
static DeviceList pulseDevices();
#endif

#if USE_PULSEAUDIO_DEVICES
static DeviceList paDevices();
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/prefgeneral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ PrefGeneral::PrefGeneral(QWidget * parent, Qt::WindowFlags f)
#if USE_MPV_ALSA_DEVICES
mpv_alsa_devices = DeviceInfo::mpvAlsaDevices();
#endif
#if USE_PULSEAUDIO_DEVICES
#if USE_PULSEAUDIO_DEVICES && !USE_MPV_PULSE_DEVICES
pa_devices = DeviceInfo::paDevices();
#endif
#if USE_MPV_PULSE_DEVICES
pa_devices = DeviceInfo::mpvPulseDevices();
pa_devices = DeviceInfo::pulseDevices();
#endif
#if USE_XV_ADAPTORS
xv_adaptors = DeviceInfo::xvAdaptors();
Expand Down

0 comments on commit cf38379

Please sign in to comment.