Modify CPU extensions and effect options to be enabled when checked

It looks nicer and more featured for options to be checked when they're
allowed, rather than when disallowed.
This commit is contained in:
Chris Robinson 2014-08-07 05:16:05 -07:00
parent 6048d70232
commit 10c01110f3
2 changed files with 114 additions and 72 deletions

View File

@ -260,10 +260,10 @@ void MainWindow::loadConfig(const QString &fname)
disabledCpuExts = disabledCpuExts[0].split(QChar(',')); disabledCpuExts = disabledCpuExts[0].split(QChar(','));
std::transform(disabledCpuExts.begin(), disabledCpuExts.end(), std::transform(disabledCpuExts.begin(), disabledCpuExts.end(),
disabledCpuExts.begin(), std::mem_fun_ref(&QString::trimmed)); disabledCpuExts.begin(), std::mem_fun_ref(&QString::trimmed));
ui->disableSSECheckBox->setChecked(disabledCpuExts.contains("sse", Qt::CaseInsensitive)); ui->enableSSECheckBox->setChecked(!disabledCpuExts.contains("sse", Qt::CaseInsensitive));
ui->disableSSE2CheckBox->setChecked(disabledCpuExts.contains("sse2", Qt::CaseInsensitive)); ui->enableSSE2CheckBox->setChecked(!disabledCpuExts.contains("sse2", Qt::CaseInsensitive));
ui->disableSSE41CheckBox->setChecked(disabledCpuExts.contains("sse4.1", Qt::CaseInsensitive)); ui->enableSSE41CheckBox->setChecked(!disabledCpuExts.contains("sse4.1", Qt::CaseInsensitive));
ui->disableNeonCheckBox->setChecked(disabledCpuExts.contains("neon", Qt::CaseInsensitive)); ui->enableNeonCheckBox->setChecked(!disabledCpuExts.contains("neon", Qt::CaseInsensitive));
if(settings.value("hrtf").toString() == QString()) if(settings.value("hrtf").toString() == QString())
ui->hrtfEnableButton->setChecked(true); ui->hrtfEnableButton->setChecked(true);
@ -331,16 +331,16 @@ void MainWindow::loadConfig(const QString &fname)
excludefx = excludefx[0].split(QChar(',')); excludefx = excludefx[0].split(QChar(','));
std::transform(excludefx.begin(), excludefx.end(), std::transform(excludefx.begin(), excludefx.end(),
excludefx.begin(), std::mem_fun_ref(&QString::trimmed)); excludefx.begin(), std::mem_fun_ref(&QString::trimmed));
ui->disableEaxReverbCheck->setChecked(excludefx.contains("eaxreverb", Qt::CaseInsensitive)); ui->enableEaxReverbCheck->setChecked(!excludefx.contains("eaxreverb", Qt::CaseInsensitive));
ui->disableStdReverbCheck->setChecked(excludefx.contains("reverb", Qt::CaseInsensitive)); ui->enableStdReverbCheck->setChecked(!excludefx.contains("reverb", Qt::CaseInsensitive));
ui->disableChorusCheck->setChecked(excludefx.contains("chorus", Qt::CaseInsensitive)); ui->enableChorusCheck->setChecked(!excludefx.contains("chorus", Qt::CaseInsensitive));
ui->disableCompressorCheck->setChecked(excludefx.contains("compressor", Qt::CaseInsensitive)); ui->enableCompressorCheck->setChecked(!excludefx.contains("compressor", Qt::CaseInsensitive));
ui->disableDistortionCheck->setChecked(excludefx.contains("distortion", Qt::CaseInsensitive)); ui->enableDistortionCheck->setChecked(!excludefx.contains("distortion", Qt::CaseInsensitive));
ui->disableEchoCheck->setChecked(excludefx.contains("echo", Qt::CaseInsensitive)); ui->enableEchoCheck->setChecked(!excludefx.contains("echo", Qt::CaseInsensitive));
ui->disableEqualizerCheck->setChecked(excludefx.contains("equalizer", Qt::CaseInsensitive)); ui->enableEqualizerCheck->setChecked(!excludefx.contains("equalizer", Qt::CaseInsensitive));
ui->disableFlangerCheck->setChecked(excludefx.contains("flanger", Qt::CaseInsensitive)); ui->enableFlangerCheck->setChecked(!excludefx.contains("flanger", Qt::CaseInsensitive));
ui->disableModulatorCheck->setChecked(excludefx.contains("modulator", Qt::CaseInsensitive)); ui->enableModulatorCheck->setChecked(!excludefx.contains("modulator", Qt::CaseInsensitive));
ui->disableDedicatedCheck->setChecked(excludefx.contains("dedicated", Qt::CaseInsensitive)); ui->enableDedicatedCheck->setChecked(!excludefx.contains("dedicated", Qt::CaseInsensitive));
} }
void MainWindow::saveCurrentConfig() void MainWindow::saveCurrentConfig()
@ -399,13 +399,13 @@ void MainWindow::saveConfig(const QString &fname) const
} }
QStringList strlist; QStringList strlist;
if(ui->disableSSECheckBox->isChecked()) if(!ui->enableSSECheckBox->isChecked())
strlist.append("sse"); strlist.append("sse");
if(ui->disableSSE2CheckBox->isChecked()) if(!ui->enableSSE2CheckBox->isChecked())
strlist.append("sse2"); strlist.append("sse2");
if(ui->disableSSE41CheckBox->isChecked()) if(!ui->enableSSE41CheckBox->isChecked())
strlist.append("sse4.1"); strlist.append("sse4.1");
if(ui->disableNeonCheckBox->isChecked()) if(!ui->enableNeonCheckBox->isChecked())
strlist.append("neon"); strlist.append("neon");
settings.setValue("disable-cpu-exts", strlist.join(QChar(','))); settings.setValue("disable-cpu-exts", strlist.join(QChar(',')));
@ -456,25 +456,25 @@ void MainWindow::saveConfig(const QString &fname) const
settings.setValue("reverb/boost", ui->reverbBoostEdit->text()); settings.setValue("reverb/boost", ui->reverbBoostEdit->text());
strlist.clear(); strlist.clear();
if(ui->disableEaxReverbCheck->isChecked()) if(!ui->enableEaxReverbCheck->isChecked())
strlist.append("eaxreverb"); strlist.append("eaxreverb");
if(ui->disableStdReverbCheck->isChecked()) if(!ui->enableStdReverbCheck->isChecked())
strlist.append("reverb"); strlist.append("reverb");
if(ui->disableChorusCheck->isChecked()) if(!ui->enableChorusCheck->isChecked())
strlist.append("chorus"); strlist.append("chorus");
if(ui->disableDistortionCheck->isChecked()) if(!ui->enableDistortionCheck->isChecked())
strlist.append("distortion"); strlist.append("distortion");
if(ui->disableCompressorCheck->isChecked()) if(!ui->enableCompressorCheck->isChecked())
strlist.append("compressor"); strlist.append("compressor");
if(ui->disableEchoCheck->isChecked()) if(!ui->enableEchoCheck->isChecked())
strlist.append("echo"); strlist.append("echo");
if(ui->disableEqualizerCheck->isChecked()) if(!ui->enableEqualizerCheck->isChecked())
strlist.append("equalizer"); strlist.append("equalizer");
if(ui->disableFlangerCheck->isChecked()) if(!ui->enableFlangerCheck->isChecked())
strlist.append("flanger"); strlist.append("flanger");
if(ui->disableModulatorCheck->isChecked()) if(!ui->enableModulatorCheck->isChecked())
strlist.append("modulator"); strlist.append("modulator");
if(ui->disableDedicatedCheck->isChecked()) if(!ui->enableDedicatedCheck->isChecked())
strlist.append("dedicated"); strlist.append("dedicated");
settings.setValue("excludefx", strlist.join(QChar(','))); settings.setValue("excludefx", strlist.join(QChar(',')));

View File

@ -778,63 +778,75 @@ value currently possible is 4.</string>
</rect> </rect>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Disables use of specific CPU extensions. Certain methods may <string>Enables use of specific CPU extensions. Certain methods may
utilize CPU extensions when detected, and this is useful for utilize CPU extensions when detected, and disabling these can
preventing those extensions from being used.</string> be useful for preventing those extensions from being used.</string>
</property> </property>
<property name="title"> <property name="title">
<string>CPU Extensions</string> <string>CPU Extensions</string>
</property> </property>
<widget class="QCheckBox" name="disableSSECheckBox"> <widget class="QCheckBox" name="enableSSECheckBox">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>10</x> <x>180</x>
<y>20</y> <y>20</y>
<width>101</width> <width>71</width>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>Disable SSE</string> <string>SSE</string>
</property>
<property name="checked">
<bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="disableSSE2CheckBox"> <widget class="QCheckBox" name="enableSSE2CheckBox">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>200</x> <x>180</x>
<y>20</y>
<width>111</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>Disable SSE2</string>
</property>
</widget>
<widget class="QCheckBox" name="disableNeonCheckBox">
<property name="geometry">
<rect>
<x>200</x>
<y>50</y> <y>50</y>
<width>111</width> <width>71</width>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>Disable Neon</string> <string>SSE2</string>
</property>
<property name="checked">
<bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="disableSSE41CheckBox"> <widget class="QCheckBox" name="enableNeonCheckBox">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>370</x> <x>260</x>
<y>20</y> <y>50</y>
<width>121</width> <width>71</width>
<height>31</height> <height>31</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>Disable SSE4.1</string> <string>Neon</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
<widget class="QCheckBox" name="enableSSE41CheckBox">
<property name="geometry">
<rect>
<x>260</x>
<y>20</y>
<width>71</width>
<height>31</height>
</rect>
</property>
<property name="text">
<string>SSE4.1</string>
</property>
<property name="checked">
<bool>true</bool>
</property> </property>
</widget> </widget>
</widget> </widget>
@ -1030,14 +1042,14 @@ value of 0 means no change.</string>
</rect> </rect>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Disables effects, preventing apps from recognizing them. This <string>Specifies which effects apps can recognize. Disabling effects
can help for apps that try to use effects which are too CPU can help for apps that try to use ones that are too intensive
intensive for the system to handle.</string> for the system to handle.</string>
</property> </property>
<property name="title"> <property name="title">
<string>Disabled Effects</string> <string>Enabled Effects</string>
</property> </property>
<widget class="QCheckBox" name="disableEaxReverbCheck"> <widget class="QCheckBox" name="enableEaxReverbCheck">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>70</x> <x>70</x>
@ -1049,8 +1061,11 @@ intensive for the system to handle.</string>
<property name="text"> <property name="text">
<string>EAX Reverb</string> <string>EAX Reverb</string>
</property> </property>
<property name="checked">
<bool>true</bool>
</property>
</widget> </widget>
<widget class="QCheckBox" name="disableStdReverbCheck"> <widget class="QCheckBox" name="enableStdReverbCheck">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>70</x> <x>70</x>
@ -1062,8 +1077,11 @@ intensive for the system to handle.</string>
<property name="text"> <property name="text">
<string>Standard Reverb</string> <string>Standard Reverb</string>
</property> </property>
<property name="checked">
<bool>true</bool>
</property>
</widget> </widget>
<widget class="QCheckBox" name="disableChorusCheck"> <widget class="QCheckBox" name="enableChorusCheck">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>70</x> <x>70</x>
@ -1075,8 +1093,11 @@ intensive for the system to handle.</string>
<property name="text"> <property name="text">
<string>Chorus</string> <string>Chorus</string>
</property> </property>
<property name="checked">
<bool>true</bool>
</property>
</widget> </widget>
<widget class="QCheckBox" name="disableDistortionCheck"> <widget class="QCheckBox" name="enableDistortionCheck">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>70</x> <x>70</x>
@ -1088,8 +1109,11 @@ intensive for the system to handle.</string>
<property name="text"> <property name="text">
<string>Distortion</string> <string>Distortion</string>
</property> </property>
<property name="checked">
<bool>true</bool>
</property>
</widget> </widget>
<widget class="QCheckBox" name="disableEchoCheck"> <widget class="QCheckBox" name="enableEchoCheck">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>320</x> <x>320</x>
@ -1101,8 +1125,11 @@ intensive for the system to handle.</string>
<property name="text"> <property name="text">
<string>Echo</string> <string>Echo</string>
</property> </property>
<property name="checked">
<bool>true</bool>
</property>
</widget> </widget>
<widget class="QCheckBox" name="disableEqualizerCheck"> <widget class="QCheckBox" name="enableEqualizerCheck">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>320</x> <x>320</x>
@ -1114,8 +1141,11 @@ intensive for the system to handle.</string>
<property name="text"> <property name="text">
<string>Equalizer</string> <string>Equalizer</string>
</property> </property>
<property name="checked">
<bool>true</bool>
</property>
</widget> </widget>
<widget class="QCheckBox" name="disableFlangerCheck"> <widget class="QCheckBox" name="enableFlangerCheck">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>320</x> <x>320</x>
@ -1127,8 +1157,11 @@ intensive for the system to handle.</string>
<property name="text"> <property name="text">
<string>Flanger</string> <string>Flanger</string>
</property> </property>
<property name="checked">
<bool>true</bool>
</property>
</widget> </widget>
<widget class="QCheckBox" name="disableModulatorCheck"> <widget class="QCheckBox" name="enableModulatorCheck">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>320</x> <x>320</x>
@ -1140,8 +1173,11 @@ intensive for the system to handle.</string>
<property name="text"> <property name="text">
<string>Ring Modulator</string> <string>Ring Modulator</string>
</property> </property>
<property name="checked">
<bool>true</bool>
</property>
</widget> </widget>
<widget class="QCheckBox" name="disableDedicatedCheck"> <widget class="QCheckBox" name="enableDedicatedCheck">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>320</x> <x>320</x>
@ -1151,14 +1187,17 @@ intensive for the system to handle.</string>
</rect> </rect>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Disables both the Dedicated Dialog and Dedicated LFE effects <string>Enables both the Dedicated Dialog and Dedicated LFE effects
added by the ALC_EXT_DEDICATED extension.</string> added by the ALC_EXT_DEDICATED extension.</string>
</property> </property>
<property name="text"> <property name="text">
<string>Dedicated ...</string> <string>Dedicated ...</string>
</property> </property>
<property name="checked">
<bool>true</bool>
</property>
</widget> </widget>
<widget class="QCheckBox" name="disableCompressorCheck"> <widget class="QCheckBox" name="enableCompressorCheck">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>70</x> <x>70</x>
@ -1170,6 +1209,9 @@ added by the ALC_EXT_DEDICATED extension.</string>
<property name="text"> <property name="text">
<string>Compressor</string> <string>Compressor</string>
</property> </property>
<property name="checked">
<bool>true</bool>
</property>
</widget> </widget>
</widget> </widget>
<widget class="QLabel" name="label_13"> <widget class="QLabel" name="label_13">