notification-sound for "its your turn" in online game
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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<GuiInterface> myServerGuiInterface;
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <QtGui>
|
||||
#include <QtCore>
|
||||
#include <core/boost/timer.hpp>
|
||||
#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<SDLPlayer> mySDLPlayer;
|
||||
|
||||
boost::microsec_timer realTimer;
|
||||
|
||||
bool timeOutAnimation;
|
||||
@@ -58,6 +61,9 @@ private:
|
||||
int waitFrames;
|
||||
int decreaseWidthIntervall;
|
||||
int timerIntervall;
|
||||
bool isBeep;
|
||||
bool isBeepPlayed;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -131,7 +131,8 @@
|
||||
<file>resources/sounds/bet.wav</file>
|
||||
<file>resources/sounds/allin.wav</file>
|
||||
<file>resources/sounds/check.wav</file>
|
||||
<file>resources/sounds/fold.wav</file>
|
||||
<file>resources/sounds/fold.wav</file>
|
||||
<file>resources/sounds/yourturn.wav</file>
|
||||
</qresource>
|
||||
<qresource prefix="/translations" >
|
||||
<file>resources/translations/pokerth_de.qm</file>
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user