From 7023fc88ac69297a71fa0045f81d030469551e7f Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 30 Oct 2016 15:35:11 +0100 Subject: [PATCH] Fixed: Choice of sound driver --- .../src/sound_settings_widget.cpp | 55 +++- .../ui/sound_settings_widget.ui | 261 +++++++++--------- 2 files changed, 177 insertions(+), 139 deletions(-) diff --git a/code/ryzom/tools/client/client_config_qt/src/sound_settings_widget.cpp b/code/ryzom/tools/client/client_config_qt/src/sound_settings_widget.cpp index b820a696f..49348d38b 100644 --- a/code/ryzom/tools/client/client_config_qt/src/sound_settings_widget.cpp +++ b/code/ryzom/tools/client/client_config_qt/src/sound_settings_widget.cpp @@ -25,11 +25,16 @@ CSoundSettingsWidget::CSoundSettingsWidget( QWidget *parent ) : setupUi( this ); load(); + connect(autoRadioButton, SIGNAL(clicked(bool)), this, SLOT(onSomethingChanged())); + connect(openalRadioButton, SIGNAL(clicked(bool)), this, SLOT(onSomethingChanged())); + connect(fmodRadioButton, SIGNAL(clicked(bool)), this, SLOT(onSomethingChanged())); + connect(xaudio2RadioButton, SIGNAL(clicked(bool)), this, SLOT(onSomethingChanged())); + connect(directsoundRadioButton, SIGNAL(clicked(bool)), this, SLOT(onSomethingChanged())); + connect( tracksSlider, SIGNAL( valueChanged( int ) ), this, SLOT( onTracksSliderChange() ) ); connect( soundCheckBox, SIGNAL( clicked( bool ) ), this, SLOT( onSomethingChanged() ) ); connect( eaxCheckBox, SIGNAL( clicked( bool ) ), this, SLOT( onSomethingChanged() ) ); connect( softwareCheckBox, SIGNAL( clicked( bool ) ), this, SLOT( onSomethingChanged() ) ); - connect( fmodCheckBox, SIGNAL( clicked( bool ) ), this, SLOT( onSomethingChanged() ) ); } CSoundSettingsWidget::~CSoundSettingsWidget() @@ -64,8 +69,38 @@ void CSoundSettingsWidget::load() updateTracksLabel(); - if( s.config.getString( "DriverSound" ).compare( "FMod" ) == 0 ) - fmodCheckBox->setChecked( true ); + std::string soundDriver = NLMISC::toLower(s.config.getString("DriverSound")); + +#ifdef Q_OS_WIN32 + fmodRadioButton->setEnabled(true); + xaudio2RadioButton->setEnabled(true); + directsoundRadioButton->setEnabled(true); +#else + fmodRadioButton->setEnabled(false); + xaudio2RadioButton->setEnabled(false); + directsoundRadioButton->setEnabled(false); +#endif + + if (soundDriver.compare("openal") == 0) + { + openalRadioButton->setChecked(true); + } + else if (soundDriver.compare("fmod") == 0) + { + fmodRadioButton->setChecked(true); + } + else if (soundDriver.compare("xaudio2") == 0) + { + xaudio2RadioButton->setChecked(true); + } + else if (soundDriver.compare("directsound") == 0) + { + directsoundRadioButton->setChecked(true); + } + else + { + autoRadioButton->setChecked(true); + } } void CSoundSettingsWidget::save() @@ -83,8 +118,18 @@ void CSoundSettingsWidget::save() s.config.setInt( "MaxTrack", tracksSlider->value() * 4 ); - if( fmodCheckBox->isChecked() ) - s.config.setString( "DriverSound", std::string( "FMod" ) ); + if (openalRadioButton->isChecked()) + s.config.setString("DriverSound", std::string("OpenAL")); +#ifdef Q_OS_WIN32 + else if (fmodRadioButton->isChecked()) + s.config.setString("DriverSound", std::string("FMod")); + else if (xaudio2RadioButton->isChecked()) + s.config.setString("DriverSound", std::string("XAudio2")); + else if (directsoundRadioButton->isChecked()) + s.config.setString("DriverSound", std::string("DirectSound")); +#endif + else + s.config.setString("DriverSound", std::string("Auto")); } void CSoundSettingsWidget::updateTracksLabel() diff --git a/code/ryzom/tools/client/client_config_qt/ui/sound_settings_widget.ui b/code/ryzom/tools/client/client_config_qt/ui/sound_settings_widget.ui index dc973292a..37a9b0b92 100644 --- a/code/ryzom/tools/client/client_config_qt/ui/sound_settings_widget.ui +++ b/code/ryzom/tools/client/client_config_qt/ui/sound_settings_widget.ui @@ -6,147 +6,140 @@ 0 0 - 391 - 429 + 294 + 317 Sound - - - - - - - - - Enable sound - - - - - - - Enable EAX - - - - - - - Enable FMod - - - - - - - Software sound buffer (may increase FPS) - - - - - - - Qt::Vertical - - - QSizePolicy::Maximum - - - - 20 - 13 - - - - - - - - Sound tracks - - - - - - - - - Qt::Vertical - - - QSizePolicy::Maximum - - - - 20 - 18 - - - - - - - - - - 1 - - - 8 - - - 1 - - - 4 - - - 1 - - - Qt::Horizontal - - - - - - - 8 tracks - - - - - - + + + + + Driver + + + + + + Auto + + + + + + + OpenAL + + + + + + + FMod + + + + + + + XAudio2 + + + + + + + DirectSound + + + + + - - - - Qt::Horizontal + + + + Parameters - - - 180 - 20 - - - - - - - - Qt::Vertical - - - - 20 - 223 - - - + + + + + Enable sound + + + + + + + Enable EAX + + + + + + + Software sound buffer (may increase FPS) + + + + + + + Sound tracks + + + + + + + + + 1 + + + 8 + + + 1 + + + 4 + + + 1 + + + Qt::Horizontal + + + + + + + 8 tracks + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + +