From 6b57f7f31bf91fffe93084399e9ad7fa2a4de33d Mon Sep 17 00:00:00 2001 From: ctrlaltca Date: Mon, 12 Feb 2024 21:11:03 +0100 Subject: Check for QtMultimedia before using QSound; partially fix #2166 (#2604) --- src/modules/snd/libkvisnd.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/modules/snd/libkvisnd.cpp') diff --git a/src/modules/snd/libkvisnd.cpp b/src/modules/snd/libkvisnd.cpp index 3ad4d5bd9..b4580074d 100644 --- a/src/modules/snd/libkvisnd.cpp +++ b/src/modules/snd/libkvisnd.cpp @@ -34,11 +34,13 @@ #include "KviLocale.h" #include "KviQString.h" +#ifdef COMPILE_QTMULTIMEDIA_SUPPORT #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #include #else #include #endif +#endif #ifdef COMPILE_PHONON_SUPPORT #include @@ -120,7 +122,9 @@ KviSoundPlayer::KviSoundPlayer() #endif //!COMPILE_ON_WINDOWS +#ifdef COMPILE_QTMULTIMEDIA_SUPPORT m_pSoundSystemDict->insert("qt", new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playQt), KVI_PTR2MEMBER(KviSoundPlayer::cleanupQt))); +#endif m_pSoundSystemDict->insert("null", new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playNull), KVI_PTR2MEMBER(KviSoundPlayer::cleanupNull))); } @@ -234,7 +238,9 @@ void KviSoundPlayer::detectSoundSystem() KVI_OPTION_STRING(KviOption_stringSoundSystem) = "oss"; #endif +#ifdef COMPILE_QTMULTIMEDIA_SUPPORT KVI_OPTION_STRING(KviOption_stringSoundSystem) = "qt"; +#endif return; #endif } @@ -347,6 +353,7 @@ void KviSoundPlayer::cleanupEsd() #endif //COMPILE_ESD_SUPPORT #endif //!COMPILE_ON_WINDOWS +#ifdef COMPILE_QTMULTIMEDIA_SUPPORT bool KviSoundPlayer::playQt(const QString & szFileName) { if(isMuted()) @@ -366,6 +373,7 @@ void KviSoundPlayer::cleanupQt() // how to stop Qt sounds ? // using the play/stop slots instead of the static ::play (TODO) } +#endif bool KviSoundPlayer::playNull(const QString &) { -- cgit v1.3.1-10-gc9f91