mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-22 23:26:15 +00:00
Fixed: Choice of sound driver
--HG-- branch : develop
This commit is contained in:
parent
1c872d9ef9
commit
8f6aa83a7b
2 changed files with 177 additions and 139 deletions
|
@ -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() )
|
||||
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()
|
||||
|
|
|
@ -6,18 +6,64 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>391</width>
|
||||
<height>429</height>
|
||||
<width>294</width>
|
||||
<height>317</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Sound</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="driverGroupBox">
|
||||
<property name="title">
|
||||
<string>Driver</string>
|
||||
</property>
|
||||
<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>
|
||||
<widget class="QGroupBox" name="parametersGroupBox">
|
||||
<property name="title">
|
||||
<string>Parameters</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="soundCheckBox">
|
||||
<property name="text">
|
||||
|
@ -32,13 +78,6 @@
|
|||
</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">
|
||||
|
@ -47,48 +86,14 @@
|
|||
</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">
|
||||
<widget class="QLabel" name="soundTracksLabel">
|
||||
<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">
|
||||
<layout class="QHBoxLayout" name="soundTracksHorizontalLayout">
|
||||
<item>
|
||||
<widget class="QSlider" name="tracksSlider">
|
||||
<property name="minimum">
|
||||
|
@ -120,36 +125,24 @@
|
|||
</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>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer_3">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>223</height>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
Loading…
Reference in a new issue