diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index b8c81219..674d708e 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -1535,7 +1535,10 @@ void mainWindowImpl::meInAction() { void mainWindowImpl::startTimeoutAnimation(int playerId, int timeoutSec) { assert(playerId >= 0 && playerId < mySession->getCurrentGame()->getStartQuantityPlayers()); - setLabelArray[playerId]->startTimeOutAnimation(timeoutSec); + + //beep for player 0 + if(playerId) { setLabelArray[playerId]->startTimeOutAnimation(timeoutSec, FALSE); } + else { setLabelArray[playerId]->startTimeOutAnimation(timeoutSec, TRUE); } } void mainWindowImpl::stopTimeoutAnimation(int playerId) { @@ -2549,7 +2552,7 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) { if (event->key() == Qt::Key_F3) { pushButton_BetRaise->click(); } if (event->key() == Qt::Key_F10) { switchLeftToolBox(); } if (event->key() == Qt::Key_F11) { switchRightToolBox(); } - if (event->key() == Qt::Key_S) { setLabelArray[0]->startTimeOutAnimation(myConfig->readConfigInt("NetTimeOutPlayerAction")); } //s + if (event->key() == Qt::Key_S) { setLabelArray[0]->startTimeOutAnimation(myConfig->readConfigInt("NetTimeOutPlayerAction"),TRUE); } //s if (event->key() == 16777249) { pushButton_break->click(); ctrlPressed = TRUE; diff --git a/src/gui/qt/mainwindow/mainwindowimpl.h b/src/gui/qt/mainwindow/mainwindowimpl.h index 01eb3c17..f9203021 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.h +++ b/src/gui/qt/mainwindow/mainwindowimpl.h @@ -69,6 +69,8 @@ public: void setLog(Log* l) { myLog = l; } void setChat(Chat* c) { myChat = c; } + SDLPlayer* getMySDLPlayer() const { return mySDLPlayer; } + void setSpeeds(); signals: @@ -269,6 +271,8 @@ public slots: void quitPokerTH(); + + private: boost::shared_ptr myServerGuiInterface; diff --git a/src/gui/qt/mainwindow/mysetlabel.cpp b/src/gui/qt/mainwindow/mysetlabel.cpp index 64a4e841..d23a0ede 100644 --- a/src/gui/qt/mainwindow/mysetlabel.cpp +++ b/src/gui/qt/mainwindow/mysetlabel.cpp @@ -16,7 +16,7 @@ using namespace std; MySetLabel::MySetLabel(QGroupBox* parent) - : QLabel(parent), timeOutAnimation(FALSE), timeOutValue(0), timeOutFrame(0), waitFrames(0), timerIntervall(0) + : QLabel(parent), timeOutAnimation(FALSE), timeOutValue(0), timeOutFrame(0), waitFrames(0), timerIntervall(0), isBeep(0), isBeepPlayed(0) { timeOutAnimationTimer = new QTimer; @@ -29,7 +29,10 @@ MySetLabel::~MySetLabel() { } -void MySetLabel::startTimeOutAnimation(int secs) { +void MySetLabel::startTimeOutAnimation(int secs, bool beep) { + + isBeepPlayed = FALSE; + isBeep = beep; timeOutValue = secs; timeOutFrame = 1; @@ -80,6 +83,11 @@ void MySetLabel::nextTimeOutAnimationFrame() { if(timeOutAnimationWidth >=0) { if(timeOutFrame > waitFrames) { + //play beep after waitFrames one time + if(!isBeepPlayed) { + myW->getMySDLPlayer()->playSound("yourturn",0); + isBeepPlayed = TRUE; + } //save gfx ressources and never play more the 10 pps unsigned int realTimerValue = realTimer.elapsed().total_milliseconds(); timeOutAnimationWidth = 118-(((realTimerValue-3000)*118)/((timeOutValue-3)*1000)); diff --git a/src/gui/qt/mainwindow/mysetlabel.h b/src/gui/qt/mainwindow/mysetlabel.h index 63c1498a..c6cd8d43 100644 --- a/src/gui/qt/mainwindow/mysetlabel.h +++ b/src/gui/qt/mainwindow/mysetlabel.h @@ -17,6 +17,7 @@ #include #include #include +#include "sdlplayer.h" class mainWindowImpl; @@ -31,12 +32,12 @@ public: void setMyW ( mainWindowImpl* theValue ) { myW = theValue; } - void startTimeOutAnimation(int secs); - + void startTimeOutAnimation(int secs, bool beep); void stopTimeOutAnimation(); void paintEvent(QPaintEvent * event); + public slots: void startTimeOutAnimationNow(); void nextTimeOutAnimationFrame(); @@ -48,6 +49,8 @@ private: QTimer *timeOutAnimationTimer; QTimer *timeOutAnimationKickOnTimer; +// boost::shared_ptr mySDLPlayer; + boost::microsec_timer realTimer; bool timeOutAnimation; @@ -58,6 +61,9 @@ private: int waitFrames; int decreaseWidthIntervall; int timerIntervall; + bool isBeep; + bool isBeepPlayed; + }; diff --git a/src/gui/qt/resources.qrc b/src/gui/qt/resources.qrc index 2c24f02f..4a1520ba 100755 --- a/src/gui/qt/resources.qrc +++ b/src/gui/qt/resources.qrc @@ -131,7 +131,8 @@ resources/sounds/bet.wav resources/sounds/allin.wav resources/sounds/check.wav - resources/sounds/fold.wav + resources/sounds/fold.wav + resources/sounds/yourturn.wav resources/translations/pokerth_de.qm diff --git a/src/gui/qt/resources/sounds/yourturn.wav b/src/gui/qt/resources/sounds/yourturn.wav new file mode 100644 index 00000000..96f593ac Binary files /dev/null and b/src/gui/qt/resources/sounds/yourturn.wav differ