Fixed: Choice of sound driver

--HG--
branch : develop
feature/pipeline-tools
kervala 8 years ago
parent 1c872d9ef9
commit 8f6aa83a7b

@ -25,11 +25,16 @@ CSoundSettingsWidget::CSoundSettingsWidget( QWidget *parent ) :
setupUi( this ); setupUi( this );
load(); 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( tracksSlider, SIGNAL( valueChanged( int ) ), this, SLOT( onTracksSliderChange() ) );
connect( soundCheckBox, SIGNAL( clicked( bool ) ), this, SLOT( onSomethingChanged() ) ); connect( soundCheckBox, SIGNAL( clicked( bool ) ), this, SLOT( onSomethingChanged() ) );
connect( eaxCheckBox, SIGNAL( clicked( bool ) ), this, SLOT( onSomethingChanged() ) ); connect( eaxCheckBox, SIGNAL( clicked( bool ) ), this, SLOT( onSomethingChanged() ) );
connect( softwareCheckBox, SIGNAL( clicked( bool ) ), this, SLOT( onSomethingChanged() ) ); connect( softwareCheckBox, SIGNAL( clicked( bool ) ), this, SLOT( onSomethingChanged() ) );
connect( fmodCheckBox, SIGNAL( clicked( bool ) ), this, SLOT( onSomethingChanged() ) );
} }
CSoundSettingsWidget::~CSoundSettingsWidget() CSoundSettingsWidget::~CSoundSettingsWidget()
@ -64,8 +69,38 @@ void CSoundSettingsWidget::load()
updateTracksLabel(); updateTracksLabel();
if( s.config.getString( "DriverSound" ).compare( "FMod" ) == 0 ) std::string soundDriver = NLMISC::toLower(s.config.getString("DriverSound"));
fmodCheckBox->setChecked( true );
#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() void CSoundSettingsWidget::save()
@ -83,8 +118,18 @@ void CSoundSettingsWidget::save()
s.config.setInt( "MaxTrack", tracksSlider->value() * 4 ); s.config.setInt( "MaxTrack", tracksSlider->value() * 4 );
if( fmodCheckBox->isChecked() ) if (openalRadioButton->isChecked())
s.config.setString( "DriverSound", std::string( "FMod" ) ); 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() void CSoundSettingsWidget::updateTracksLabel()

@ -6,147 +6,140 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>391</width> <width>294</width>
<height>429</height> <height>317</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Sound</string> <string>Sound</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item row="0" column="0"> <item>
<layout class="QVBoxLayout" name="verticalLayout_2"> <widget class="QGroupBox" name="driverGroupBox">
<item> <property name="title">
<layout class="QVBoxLayout" name="verticalLayout"> <string>Driver</string>
<item>
<widget class="QCheckBox" name="soundCheckBox">
<property name="text">
<string>Enable sound</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="eaxCheckBox">
<property name="text">
<string>Enable EAX</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="fmodCheckBox">
<property name="text">
<string>Enable FMod</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="softwareCheckBox">
<property name="text">
<string>Software sound buffer (may increase FPS)</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Maximum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Sound tracks</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Maximum</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>18</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QSlider" name="tracksSlider">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>8</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>4</number>
</property>
<property name="value">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="tracksLabel">
<property name="text">
<string>8 tracks</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>180</width>
<height>20</height>
</size>
</property> </property>
</spacer> <layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QRadioButton" name="autoRadioButton">
<property name="text">
<string>Auto</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="openalRadioButton">
<property name="text">
<string>OpenAL</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="fmodRadioButton">
<property name="text">
<string>FMod</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="xaudio2RadioButton">
<property name="text">
<string>XAudio2</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="directsoundRadioButton">
<property name="text">
<string>DirectSound</string>
</property>
</widget>
</item>
</layout>
</widget>
</item> </item>
<item row="1" column="0"> <item>
<spacer name="verticalSpacer_3"> <widget class="QGroupBox" name="parametersGroupBox">
<property name="orientation"> <property name="title">
<enum>Qt::Vertical</enum> <string>Parameters</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>223</height>
</size>
</property> </property>
</spacer> <layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="soundCheckBox">
<property name="text">
<string>Enable sound</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="eaxCheckBox">
<property name="text">
<string>Enable EAX</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="softwareCheckBox">
<property name="text">
<string>Software sound buffer (may increase FPS)</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="soundTracksLabel">
<property name="text">
<string>Sound tracks</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="soundTracksHorizontalLayout">
<item>
<widget class="QSlider" name="tracksSlider">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>8</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>4</number>
</property>
<property name="value">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="tracksLabel">
<property name="text">
<string>8 tracks</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>

Loading…
Cancel
Save