sound free?
This commit is contained in:
@@ -6138,6 +6138,9 @@
|
|||||||
<property name="text" >
|
<property name="text" >
|
||||||
<string>Quit</string>
|
<string>Quit</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="shortcut" >
|
||||||
|
<string>Ctrl+Q</string>
|
||||||
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionAboutPokerth" >
|
<action name="actionAboutPokerth" >
|
||||||
<property name="text" >
|
<property name="text" >
|
||||||
@@ -6169,6 +6172,11 @@
|
|||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>MyRightTabWidget</class>
|
||||||
|
<extends>QTabWidget</extends>
|
||||||
|
<header>myrighttabwidget.h</header>
|
||||||
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>MyLeftTabWidget</class>
|
<class>MyLeftTabWidget</class>
|
||||||
<extends>QTabWidget</extends>
|
<extends>QTabWidget</extends>
|
||||||
@@ -6179,11 +6187,6 @@
|
|||||||
<extends>QLabel</extends>
|
<extends>QLabel</extends>
|
||||||
<header>mysetlabel.h</header>
|
<header>mysetlabel.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
|
||||||
<class>MyRightTabWidget</class>
|
|
||||||
<extends>QTabWidget</extends>
|
|
||||||
<header>myrighttabwidget.h</header>
|
|
||||||
</customwidget>
|
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>spinBox_set</tabstop>
|
<tabstop>spinBox_set</tabstop>
|
||||||
|
|||||||
@@ -486,9 +486,6 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
int width = tempMetrics.width(tr("Stop"));
|
int width = tempMetrics.width(tr("Stop"));
|
||||||
pushButton_break->setMinimumSize(width+10,20);
|
pushButton_break->setMinimumSize(width+10,20);
|
||||||
|
|
||||||
//ShortCuts
|
|
||||||
// QShortcut *startNewGameKeys = new QShortcut(QKeySequence(Qt::Key_Control + Qt::Key_N), this);
|
|
||||||
// connect( startNewGameKeys, SIGNAL(activated() ), actionNewGame, SLOT( trigger() ) );
|
|
||||||
|
|
||||||
//Clear Focus
|
//Clear Focus
|
||||||
groupBox_LeftToolBox->clearFocus();
|
groupBox_LeftToolBox->clearFocus();
|
||||||
@@ -521,6 +518,12 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
myWaitingForServerGameDialog = new waitForServerToStartGameDialogImpl(this);
|
myWaitingForServerGameDialog = new waitForServerToStartGameDialogImpl(this);
|
||||||
myAboutPokerthDialog = new aboutPokerthImpl(this);
|
myAboutPokerthDialog = new aboutPokerthImpl(this);
|
||||||
|
|
||||||
|
|
||||||
|
// //ShortCuts
|
||||||
|
// QShortcut *quitPokerTHKeys = new QShortcut(QKeySequence(Qt::Key_Control + Qt::Key_Q), this);
|
||||||
|
// connect( quitPokerTHKeys, SIGNAL(activated() ), actionQuit, SLOT( trigger() ) );
|
||||||
|
|
||||||
|
|
||||||
//Connects
|
//Connects
|
||||||
connect(dealFlopCards0Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards1() ));
|
connect(dealFlopCards0Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards1() ));
|
||||||
connect(dealFlopCards1Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards2() ));
|
connect(dealFlopCards1Timer, SIGNAL(timeout()), this, SLOT( dealFlopCards2() ));
|
||||||
@@ -638,16 +641,18 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
audio_buffers = 4096;
|
audio_buffers = 4096;
|
||||||
music = NULL;
|
music = NULL;
|
||||||
|
|
||||||
SDL_Init(SDL_INIT_AUDIO);
|
if (myConfig->readConfigInt("PlaySoundEffects")) {
|
||||||
|
|
||||||
if(Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers)) {
|
SDL_Init(SDL_INIT_AUDIO);
|
||||||
printf("Unable to open audio!\n");
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
|
|
||||||
//SOUNDTESTING
|
|
||||||
|
|
||||||
|
if(Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers)) {
|
||||||
|
printf("Unable to open audio!\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
|
||||||
|
//SOUNDTESTING
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mainWindowImpl::~mainWindowImpl() {
|
mainWindowImpl::~mainWindowImpl() {
|
||||||
@@ -869,8 +874,18 @@ void mainWindowImpl::callSettingsDialog() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Audio Clean?
|
||||||
|
if (myConfig->readConfigInt("PlaySoundEffects") == 0) { SDLMixerClean(); }
|
||||||
|
else {
|
||||||
|
// SDL_Init(SDL_INIT_AUDIO);
|
||||||
|
//
|
||||||
|
// if(Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers)) {
|
||||||
|
// printf("Unable to open audio!\n");
|
||||||
|
// exit(1);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2519,7 +2534,7 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
|
|||||||
if (event->key() == Qt::Key_D) { setLabelArray[0]->startTimeOutAnimation(myConfig->readConfigInt("NetTimeOutPlayerAction")); } //f
|
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_E) { setLabelArray[0]->stopTimeOutAnimation(); } //f
|
||||||
if (event->key() == Qt::Key_S) { playSound(); } //s
|
if (event->key() == Qt::Key_S) { playSound(); } //s
|
||||||
if (event->key() == Qt::Key_W) { qApp->quit(); } //s
|
// if (event->key() == Qt::Key_W) { qApp->quit(); } //s
|
||||||
if (event->key() == 16777249) {
|
if (event->key() == 16777249) {
|
||||||
pushButton_break->click();
|
pushButton_break->click();
|
||||||
ctrlPressed = TRUE;
|
ctrlPressed = TRUE;
|
||||||
@@ -2610,6 +2625,15 @@ void mainWindowImpl::musicDone() {
|
|||||||
music = NULL;
|
music = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void mainWindowImpl::SDLMixerClean() {
|
||||||
|
//SOUND close
|
||||||
|
Mix_HaltMusic();
|
||||||
|
Mix_FreeMusic(music);
|
||||||
|
music = NULL;
|
||||||
|
// Mix_CloseAudio();
|
||||||
|
// SDL_Quit();
|
||||||
|
}
|
||||||
|
|
||||||
void mainWindowImpl::playSound() {
|
void mainWindowImpl::playSound() {
|
||||||
|
|
||||||
if(myConfig->readConfigInt("PlaySoundEffects")) {
|
if(myConfig->readConfigInt("PlaySoundEffects")) {
|
||||||
@@ -2638,9 +2662,7 @@ void mainWindowImpl::quitPokerTH() {
|
|||||||
mySession->terminateNetworkClient();
|
mySession->terminateNetworkClient();
|
||||||
if (myServerGuiInterface.get()) myServerGuiInterface->getSession().terminateNetworkServer();
|
if (myServerGuiInterface.get()) myServerGuiInterface->getSession().terminateNetworkServer();
|
||||||
|
|
||||||
//SOUND close
|
SDLMixerClean();
|
||||||
Mix_CloseAudio();
|
|
||||||
SDL_Quit();
|
|
||||||
|
|
||||||
// cout << "PokerTH finished" << endl;
|
// cout << "PokerTH finished" << endl;
|
||||||
qApp->quit();
|
qApp->quit();
|
||||||
|
|||||||
@@ -253,9 +253,9 @@ public slots:
|
|||||||
|
|
||||||
void userActionTimeOutReached();
|
void userActionTimeOutReached();
|
||||||
|
|
||||||
//SOUND TESTING
|
|
||||||
void playSound();
|
void playSound();
|
||||||
void musicDone();
|
void musicDone();
|
||||||
|
void SDLMixerClean();
|
||||||
|
|
||||||
void quitPokerTH();
|
void quitPokerTH();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user