diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,8 +25,7 @@ ) find_package(KF5KDEGames 4.9.0 REQUIRED) -# Uncomment when sound is reenabled -# find_package(Phonon4Qt5 CONFIG REQUIRED) +find_package(Phonon4Qt5 CONFIG REQUIRED) include(FeatureSummary) include(ECMAddAppIcon) @@ -46,7 +45,7 @@ add_subdirectory(doc) # we have a static copy of Box2D in our source tree -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/external ${PHONON_INCLUDE_DIR}) ########### next target ############### @@ -129,8 +128,7 @@ KF5::DBusAddons KF5::KDELibs4Support KF5::KIOCore -# Uncomment when sound is reenabled -# Phonon::phonon4qt5 + Phonon::phonon4qt5 KF5KDEGames ) diff --git a/game.h b/game.h --- a/game.h +++ b/game.h @@ -20,8 +20,6 @@ #ifndef GAME_H #define GAME_H -//#define SOUND - #include #include "ball.h" @@ -412,9 +410,7 @@ //For intro banner Tagaro::SpriteObjectItem *banner; -#ifdef SOUND - Phonon::MediaObject *m_player; -#endif + Phonon::MediaObject *m_player; bool m_sound; QString soundDir; diff --git a/game.cpp b/game.cpp --- a/game.cpp +++ b/game.cpp @@ -45,6 +45,7 @@ #include #include #include +#include inline QString makeGroup(int id, int hole, const QString &name, int x, int y) { @@ -486,9 +487,7 @@ recalcHighestHole = false; banner = 0; -#ifdef SOUND m_player = Phonon::createPlayer(Phonon::GameCategory); -#endif holeInfo.setGame(this); holeInfo.setAuthor(i18n("Course Author")); @@ -645,9 +644,7 @@ } delete cfg; -#ifdef SOUND delete m_player; -#endif } void KolfGame::setModified(bool mod) @@ -2243,7 +2240,6 @@ } } -#ifdef SOUND void KolfGame::playSound(const QString& file, float vol) { if (m_sound) @@ -2255,15 +2251,10 @@ //return; if (vol > 1) vol = 1; - m_player->setCurrentSource(resFile); + m_player->setCurrentSource(QUrl::fromLocalFile(resFile)); m_player->play(); } } -#else //SOUND -void KolfGame::playSound( const QString&, float ) -{ -} -#endif //SOUND void HoleInfo::borderWallsChanged(bool yes) {