This commit is contained in:
doitux
2007-06-03 08:17:33 +00:00
parent 755fb7ac16
commit f425a7d167
8 changed files with 44 additions and 20 deletions
+1 -1
View File
@@ -90,7 +90,7 @@ void LocalFlop::flopRun() {
myHand->getGuiInterface()->refreshSet();
myHand->getGuiInterface()->refreshCash();
myHand->getGuiInterface()->refreshAction();
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { myHand->getGuiInterface()->refreshAction(i,0); }
myHand->switchRounds();
}
+2 -1
View File
@@ -92,7 +92,8 @@ void LocalRiver::riverRun() {
myHand->getGuiInterface()->refreshSet();
myHand->getGuiInterface()->refreshCash();
myHand->getGuiInterface()->refreshAction();
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { myHand->getGuiInterface()->refreshAction(i,0); }
myHand->switchRounds();
}
+1 -1
View File
@@ -92,7 +92,7 @@ void LocalTurn::turnRun() {
myHand->getGuiInterface()->refreshSet();
myHand->getGuiInterface()->refreshCash();
myHand->getGuiInterface()->refreshAction();
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) { myHand->getGuiInterface()->refreshAction(i,0); }
myHand->switchRounds();
}
+18 -4
View File
@@ -1063,6 +1063,10 @@ void mainWindowImpl::refreshAction(int playerID, int playerAction) {
holeCardsArray[playerID][1]->setPixmap(onePix, FALSE);
}
}
//play sounds if exist
mySDLPlayer->playSound(actionArray[playerAction].toStdString());
}
}
@@ -1216,10 +1220,14 @@ void mainWindowImpl::refreshGameLabels(int round) {
}
void mainWindowImpl::refreshAll() {
int i;
refreshSet();
refreshButton();
refreshAction();
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
refreshAction( i, mySession->getCurrentGame()->getPlayerArray()[i]->getMyAction());
}
refreshCash();
refreshGroupbox();
refreshPlayerName();
@@ -1228,8 +1236,12 @@ void mainWindowImpl::refreshAll() {
void mainWindowImpl::refreshChangePlayer() {
int i;
refreshSet();
refreshAction();
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
refreshAction( i, mySession->getCurrentGame()->getPlayerArray()[i]->getMyAction());
}
refreshCash();
}
@@ -2499,7 +2511,9 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
if (event->key() == Qt::Key_F11) { switchRightToolBox(); }
if (event->key() == Qt::Key_D) { setLabelArray[0]->startTimeOutAnimation(myConfig->readConfigInt("NetTimeOutPlayerAction")); } //f
if (event->key() == Qt::Key_E) { setLabelArray[0]->stopTimeOutAnimation(); } //f
if (event->key() == Qt::Key_S) { if(myConfig->readConfigInt("PlaySoundEffects")) mySDLPlayer->playSound("dealtwocards"); } //s
if (event->key() == Qt::Key_S) { if(myConfig->readConfigInt("PlaySoundEffects")) mySDLPlayer->playSound("call"); } //s
if (event->key() == Qt::Key_A) { if(myConfig->readConfigInt("PlaySoundEffects")) mySDLPlayer->playSound("raise"); } //s
if (event->key() == Qt::Key_X) { if(myConfig->readConfigInt("PlaySoundEffects")) mySDLPlayer->playSound(""); } //s
// if (event->key() == Qt::Key_W) { qApp->quit(); } //s
if (event->key() == 16777249) {
pushButton_break->click();
+2
View File
@@ -75,6 +75,8 @@
</qresource>
<qresource prefix="/sounds" >
<file>resources/sounds/dealtwocards.wav</file>
<file>resources/sounds/call.wav</file>
<file>resources/sounds/raise.wav</file>
</qresource>
<qresource prefix="/fonts" >
<file>resources/fonts/VeraBd.ttf</file>
Binary file not shown.
Binary file not shown.
+20 -13
View File
@@ -43,20 +43,27 @@ void SDLPlayer::initAudio() {
void SDLPlayer::playSound(string audioString) {
audioDone();
// QFile myFile(":sounds/resources/sounds/"+QString::fromStdString(audioString)+".wav");
// if(myFile.open(QIODevice::ReadOnly)) {
//
// audioDone();
//
// QDataStream in(&myFile);
// Uint8 *myMem = new Uint8[(int)myFile.size()];
// in.readRawData( (char*)myMem, (int)myFile.size() );
//
// sound = Mix_QuickLoad_WAV( myMem );
//
// currentChannel = Mix_PlayChannel(-1, sound,0);
//
// delete[] myMem;
// }
// else cout << "could not load " << audioString << ".wav" << endl;
QFile myFile(":sounds/resources/sounds/"+QString::fromStdString(audioString)+".wav");
if(!myFile.open(QIODevice::ReadOnly)) cout << "could not load wav" << endl;
QDataStream in(&myFile);
Uint8 *myMem = new Uint8[(int)myFile.size()];
in.readRawData( (char*)myMem, (int)myFile.size() );
sound = Mix_QuickLoad_WAV( myMem );
currentChannel = Mix_PlayChannel(0, sound,0);
delete[] myMem;
//test
audioDone();
sound = Mix_LoadWAV( QString(QString::fromStdString(audioString)+QString(".wav")).toStdString().c_str() );
currentChannel = Mix_PlayChannel(-1, sound,0);
}