aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-03-05 19:20:38 -0800
committerChris Robinson <[email protected]>2016-03-05 19:20:38 -0800
commit58aa1751c3374d500e800499202d8fa528f000fb (patch)
tree1ebb56b81eae9d62111eeb9a7107ddd23068336a
parent1ca45fa3eb1ad303bbcd1e40ec97891ca8c3fab1 (diff)
Handle the stereo panning option dynamically
-rw-r--r--utils/alsoft-config/mainwindow.cpp47
-rw-r--r--utils/alsoft-config/mainwindow.ui15
2 files changed, 33 insertions, 29 deletions
diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp
index 9fef1242..a21b8c15 100644
--- a/utils/alsoft-config/mainwindow.cpp
+++ b/utils/alsoft-config/mainwindow.cpp
@@ -104,6 +104,12 @@ static const struct {
{ "Headphones", "headphones" },
{ "", "" }
+}, stereoPanList[] = {
+ { "Default", "" },
+ { "UHJ", "uhj" },
+ { "Pair-Wise", "paired" },
+
+ { "", "" }
};
static QString getDefaultConfigName()
@@ -193,6 +199,9 @@ MainWindow::MainWindow(QWidget *parent) :
for(int i = 0;stereoModeList[i].name[0];i++)
ui->stereoModeCombo->addItem(stereoModeList[i].name);
ui->stereoModeCombo->adjustSize();
+ for(int i = 0;stereoPanList[i].name[0];i++)
+ ui->stereoPanningComboBox->addItem(stereoPanList[i].name);
+ ui->stereoPanningComboBox->adjustSize();
int count;
for(count = 0;resamplerList[count].name[0];count++) {
@@ -478,7 +487,7 @@ void MainWindow::loadConfig(const QString &fname)
ui->sampleFormatCombo->setCurrentIndex(0);
if(sampletype.isEmpty() == false)
{
- for(int i = 0;sampleTypeList[i].name[i];i++)
+ for(int i = 0;sampleTypeList[i].name[0];i++)
{
if(sampletype == sampleTypeList[i].value)
{
@@ -539,7 +548,7 @@ void MainWindow::loadConfig(const QString &fname)
ui->stereoModeCombo->setCurrentIndex(0);
if(stereomode.isEmpty() == false)
{
- for(int i = 0;stereoModeList[i].name[i];i++)
+ for(int i = 0;stereoModeList[i].name[0];i++)
{
if(stereomode == stereoModeList[i].value)
{
@@ -567,12 +576,19 @@ void MainWindow::loadConfig(const QString &fname)
}
QString stereopan = settings.value("stereo-panning").toString();
- if(stereopan == "uhj")
- ui->stereoPanningComboBox->setCurrentIndex(1);
- else if(stereopan == "paired")
- ui->stereoPanningComboBox->setCurrentIndex(2);
- else
- ui->stereoPanningComboBox->setCurrentIndex(0);
+ ui->stereoPanningComboBox->setCurrentIndex(0);
+ if(stereopan.isEmpty() == false)
+ {
+ for(int i = 0;stereoPanList[i].name[0];i++)
+ {
+ if(stereopan == stereoPanList[i].value)
+ {
+ int j = ui->stereoPanningComboBox->findText(stereoPanList[i].name);
+ if(j > 0) ui->stereoPanningComboBox->setCurrentIndex(j);
+ break;
+ }
+ }
+ }
QStringList disabledCpuExts = settings.value("disable-cpu-exts").toStringList();
if(disabledCpuExts.size() == 1)
@@ -814,12 +830,15 @@ void MainWindow::saveConfig(const QString &fname) const
}
}
- if(ui->stereoPanningComboBox->currentIndex() == 1)
- settings.setValue("stereo-panning", "uhj");
- else if(ui->stereoPanningComboBox->currentIndex() == 2)
- settings.setValue("stereo-panning", "paired");
- else
- settings.remove("stereo-panning");
+ str = ui->stereoPanningComboBox->currentText();
+ for(int i = 0;stereoPanList[i].name[0];i++)
+ {
+ if(str == stereoPanList[i].name)
+ {
+ settings.setValue("stereo-panning", stereoPanList[i].value);
+ break;
+ }
+ }
QStringList strlist;
if(!ui->enableSSECheckBox->isChecked())
diff --git a/utils/alsoft-config/mainwindow.ui b/utils/alsoft-config/mainwindow.ui
index 28c699f3..f6bcc05b 100644
--- a/utils/alsoft-config/mainwindow.ui
+++ b/utils/alsoft-config/mainwindow.ui
@@ -444,21 +444,6 @@ output, which encodes some surround information.
Pair-Wise uses standard pair-wise panning between
-30 and +30 degrees. The default is UHJ.</string>
</property>
- <item>
- <property name="text">
- <string>Default</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>UHJ</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Pair-Wise</string>
- </property>
- </item>
</widget>
<widget class="QLabel" name="label_19">
<property name="geometry">