From c1224ab162182b20ef1bba3f59edcbcf7db2970a Mon Sep 17 00:00:00 2001 From: doitux Date: Thu, 22 Nov 2012 20:19:41 +0100 Subject: [PATCH 1/2] a new try for #141 --- pokerth_game.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pokerth_game.pro b/pokerth_game.pro index fa5b54b6..9ce2cb29 100644 --- a/pokerth_game.pro +++ b/pokerth_game.pro @@ -347,6 +347,7 @@ win32 { ../mysql/lib \ ../zlib LIBS += -lSDL_mixer \ + -lsmpeg \ -lSDL \ -lSDLmain \ -ltinyxml \ @@ -365,7 +366,7 @@ win32 { debug:LIBPATH += debug/lib release:LIBPATH += release/lib LIBS += -lsqlite3 - LIBS += -lntlm -lmodplug -lddraw -ldxguid -lsmpeg -lvorbisfile -lvorbis -logg + LIBS += -lntlm -lmodplug -lddraw -ldxguid -lvorbisfile -lvorbis -logg LIBS += -lboost_thread_win32-mt LIBS += -lboost_filesystem-mt LIBS += -lboost_regex-mt From 342c11615e7687a571903b9d8d758a286498cb00 Mon Sep 17 00:00:00 2001 From: doitux Date: Sat, 24 Nov 2012 09:36:11 +0100 Subject: [PATCH 2/2] next steps on #141 (just init sdl) --- src/gui/qt/gametable/gametableimpl.cpp | 4 ++-- src/gui/qt/sound/sdlplayer.cpp | 16 +++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index bd9deea1..6cf04a12 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -841,8 +841,8 @@ void gameTableImpl::applySettings(settingsDialogImpl* mySettingsDialog) } // Re-init audio. - mySDLPlayer->closeAudio(); - mySDLPlayer->initAudio(); + mySDLPlayer->initAudio(); + mySDLPlayer->closeAudio(); } void gameTableImpl::initGui(int speed) diff --git a/src/gui/qt/sound/sdlplayer.cpp b/src/gui/qt/sound/sdlplayer.cpp index a40b6d38..44d8f821 100644 --- a/src/gui/qt/sound/sdlplayer.cpp +++ b/src/gui/qt/sound/sdlplayer.cpp @@ -41,14 +41,15 @@ SDLPlayer::SDLPlayer(ConfigFile *c) SDLPlayer::~SDLPlayer() { #ifndef ANDROID -// closeAudio(); + closeAudio(); #endif } void SDLPlayer::initAudio() { #ifndef ANDROID -// SDL_Init(SDL_INIT_AUDIO); + SDL_Init(SDL_INIT_AUDIO); + qDebug() << "SDL_Init()"; // if (!audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) { // int audio_rate = 44100; // Uint16 audio_format = AUDIO_S16; /* 16-bit stereo */ @@ -70,7 +71,7 @@ void SDLPlayer::initAudio() void SDLPlayer::playSound(string audioString, int playerID) { #ifndef ANDROID -// initAudio(); + initAudio(); // if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) { // QFile myFile(myAppDataPath + "sounds/default/" + QString::fromStdString(audioString)+".wav"); @@ -142,9 +143,9 @@ void SDLPlayer::playSound(string audioString, int playerID) // } // //TESTING: release audio after every sound when there is no other sound currently played -// if(SDL_GetAudioStatus() != SDL_AUDIO_PLAYING) { -// closeAudio(); -// } + if(SDL_GetAudioStatus() != SDL_AUDIO_PLAYING) { + closeAudio(); + } // } #endif } @@ -162,6 +163,7 @@ void SDLPlayer::closeAudio() // audioEnabled = false; // } -// SDL_Quit(); + SDL_Quit(); + qDebug() << "SDL_Quit()"; #endif }