Don't try to use PulseAudioQt on Windows

This commit is contained in:
Nicolas Fella 2019-05-14 22:16:41 +02:00
parent ba30d97f92
commit a67a99a7d6
2 changed files with 10 additions and 1 deletions

View file

@ -11,9 +11,13 @@ target_link_libraries(kdeconnect_findthisdevice
Qt5::Core
Qt5::Multimedia
Qt5::DBus
KF5::PulseAudioQt
)
if (NOT WIN32)
target_link_libraries(kdeconnect_findthisdevice
KF5::PulseAudioQt
)
endif()
set(kdeconnect_findthisdevice_config_SRCS findthisdevice_config.cpp)
ki18n_wrap_ui(kdeconnect_findthisdevice_config_SRCS findthisdevice_config.ui)

View file

@ -22,8 +22,11 @@
// KF
#include <KPluginFactory>
#ifndef Q_OS_WIN
#include <PulseAudioQt/Context>
#include <PulseAudioQt/Sink>
#endif
// Qt
#include <QDBusConnection>
#include <QStandardPaths>
@ -94,6 +97,7 @@ bool FindThisDevicePlugin::receivePacket(const NetworkPacket& np)
player->setVolume(100);
player->play();
#ifndef Q_OS_WIN
const auto sinks = PulseAudioQt::Context::instance()->sinks();
QVector<PulseAudioQt::Sink*> mutedSinks;
@ -110,6 +114,7 @@ bool FindThisDevicePlugin::receivePacket(const NetworkPacket& np)
sink->setMuted(true);
}
});
#endif
// TODO: ensure to use built-in loudspeakers