sdlplayer refactoring

This commit is contained in:
doitux
2012-11-27 00:53:26 +01:00
parent e29b0de6f2
commit e76ecc8fc6
13 changed files with 117 additions and 125 deletions
+2 -7
View File
@@ -75,8 +75,7 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
setupUi(this);
//Sound
mySDLPlayer = new SDLPlayer(myConfig);
//Sound
mySoundEventHandler = new SoundEvents(myConfig);
// Init game table style
@@ -839,10 +838,6 @@ void gameTableImpl::applySettings(settingsDialogImpl* mySettingsDialog)
refreshGroupbox();
provideMyActions();
}
// Re-init audio.
mySDLPlayer->initAudio();
mySDLPlayer->closeAudio();
}
void gameTableImpl::initGui(int speed)
@@ -1169,7 +1164,7 @@ void gameTableImpl::refreshAction(int playerID, int playerAction)
//play sounds if exist
if(myConfig->readConfigInt("PlayGameActions"))
mySDLPlayer->playSound(actionArray[playerAction].toStdString(), playerID);
mySoundEventHandler->playSound(actionArray[playerAction].toStdString(), playerID);
}
if (playerAction == 1) { // FOLD
-6
View File
@@ -53,8 +53,6 @@ class myMessageDialogImpl;
class GameTableStyleReader;
class CardDeckStyleReader;
class SDLPlayer;
class SoundEvents;
enum SeatState { SEAT_UNDEFINED, SEAT_ACTIVE, SEAT_AUTOFOLD, SEAT_STAYONTABLE, SEAT_CLEAR };
@@ -70,9 +68,6 @@ public:
boost::shared_ptr<Session> getSession();
SDLPlayer* getMySDLPlayer() const {
return mySDLPlayer;
}
SoundEvents* getMySoundEventHandler() const {
return mySoundEventHandler;
}
@@ -427,7 +422,6 @@ private:
myMessageDialogImpl *myUniversalMessageDialog;
//Sound
SDLPlayer *mySDLPlayer;
SoundEvents *mySoundEventHandler;
QString myAppDataPath;
+2 -1
View File
@@ -17,6 +17,7 @@
*****************************************************************************/
#include "mytimeoutlabel.h"
#include "gametableimpl.h"
#include "soundevents.h"
using namespace std;
@@ -95,7 +96,7 @@ void MyTimeoutLabel::nextTimeOutAnimationFrame()
if(timeOutFrame > waitFrames) {
//play beep after waitFrames one time
if(isBeep && !isBeepPlayed) {
myW->getMySDLPlayer()->playSound("yourturn",0);
myW->getMySoundEventHandler()->playSound("yourturn",0);
isBeepPlayed = TRUE;
}
//save gfx ressources and never play more the 10 pps
-1
View File
@@ -23,7 +23,6 @@
#include <QtGui>
#include <QtCore>
#include <third_party/boost/timers.hpp>
#include "sdlplayer.h"
class gameTableImpl;