diff --git a/src/drivers/Qt/GameSoundConf.cpp b/src/drivers/Qt/GameSoundConf.cpp index 0f6ac901..8ead488f 100644 --- a/src/drivers/Qt/GameSoundConf.cpp +++ b/src/drivers/Qt/GameSoundConf.cpp @@ -51,6 +51,8 @@ GameSndConfDialog_t::GameSndConfDialog_t(QWidget *parent) setComboBoxFromProperty( qualitySelect, "SDL.Sound.Quality" ); + connect(qualitySelect, SIGNAL(currentIndexChanged(int)), this, SLOT(soundQualityChanged(int)) ); + hbox2->addWidget( lbl ); hbox2->addWidget( qualitySelect ); @@ -71,6 +73,8 @@ GameSndConfDialog_t::GameSndConfDialog_t(QWidget *parent) setComboBoxFromProperty( rateSelect, "SDL.Sound.Rate" ); + connect(rateSelect, SIGNAL(currentIndexChanged(int)), this, SLOT(soundRateChanged(int)) ); + g_config->getOption ("SDL.Sound.Rate", &buf); hbox2->addWidget( lbl ); @@ -231,7 +235,7 @@ void GameSndConfDialog_t::setComboBoxFromProperty( QComboBox *cbx, const char * for (i=0; icount(); i++) { - if ( pval == cbx->itemData(i) ) + if ( pval == cbx->itemData(i).toInt() ) { cbx->setCurrentIndex(i); break; } @@ -383,3 +387,26 @@ void GameSndConfDialog_t::swapDutyCallback(int value) g_config->save (); } //---------------------------------------------------- +void GameSndConfDialog_t::soundQualityChanged(int index) +{ + //printf("Sound Quality: %i : %i \n", index, qualitySelect->itemData(index).toInt() ); + + g_config->setOption ("SDL.Sound.Quality", qualitySelect->itemData(index).toInt() ); + + // reset sound subsystem for changes to take effect + KillSound (); + InitSound (); + g_config->save (); +} +//---------------------------------------------------- +void GameSndConfDialog_t::soundRateChanged(int index) +{ + //printf("Sound Rate: %i : %i \n", index, rateSelect->itemData(index).toInt() ); + + g_config->setOption ("SDL.Sound.Rate", rateSelect->itemData(index).toInt() ); + // reset sound subsystem for changes to take effect + KillSound (); + InitSound (); + g_config->save (); +} +//---------------------------------------------------- diff --git a/src/drivers/Qt/GameSoundConf.h b/src/drivers/Qt/GameSoundConf.h index f6a9918e..ebc97649 100644 --- a/src/drivers/Qt/GameSoundConf.h +++ b/src/drivers/Qt/GameSoundConf.h @@ -54,6 +54,8 @@ class GameSndConfDialog_t : public QDialog void enaSoundStateChange(int value); void enaSoundLowPassChange(int value); void swapDutyCallback(int value); + void soundQualityChanged(int index); + void soundRateChanged(int index); };