Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
smplayer-dev committed Dec 24, 2021
1 parent 145d5d1 commit 19516fb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/baseguiplus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ void BaseGuiPlus::updateSendAudioMenu() {
#endif

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

#if USE_MPV_WASAPI_DEVICES
Expand Down
13 changes: 0 additions & 13 deletions src/deviceinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,6 @@ 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
4 changes: 0 additions & 4 deletions src/deviceinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ 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
24 changes: 17 additions & 7 deletions src/prefgeneral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,6 @@ PrefGeneral::PrefGeneral(QWidget * parent, Qt::WindowFlags f)
#if USE_MPV_ALSA_DEVICES
mpv_alsa_devices = DeviceInfo::mpvAlsaDevices();
#endif
#if USE_PULSEAUDIO_DEVICES && !USE_MPV_PULSE_DEVICES
pa_devices = DeviceInfo::paDevices();
#endif
#if USE_MPV_PULSE_DEVICES
pa_devices = DeviceInfo::pulseDevices();
#endif
#if USE_XV_ADAPTORS
xv_adaptors = DeviceInfo::xvAdaptors();
#endif
Expand Down Expand Up @@ -198,7 +192,7 @@ void PrefGeneral::retranslateStrings() {
filesettings_method_combo->addItem( tr("multiple ini files"), "hash");
filesettings_method_combo->setCurrentIndex(filesettings_method_item);

updateDriverCombos();
//updateDriverCombos();

// Icons
/*
Expand Down Expand Up @@ -320,6 +314,22 @@ void PrefGeneral::setData(Preferences * pref) {

setMcActivated( pref->use_mc );
setMc( pref->mc_value );

#if USE_PULSEAUDIO_DEVICES
#if USE_MPV_PULSE_DEVICES
if (PlayerID::player(pref->mplayer_bin) == PlayerID::MPLAYER)
#endif
{
pa_devices = DeviceInfo::paDevices();
}
#endif
#if USE_MPV_PULSE_DEVICES
if (PlayerID::player(pref->mplayer_bin) == PlayerID::MPV) {
pa_devices = DeviceInfo::mpvPulseDevices();
}
#endif

updateDriverCombos();
}

void PrefGeneral::getData(Preferences * pref) {
Expand Down

0 comments on commit 19516fb

Please sign in to comment.