aboutsummaryrefslogtreecommitdiffstats
path: root/utils/alsoft-config/mainwindow.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2015-08-28 22:09:07 -0700
committerChris Robinson <[email protected]>2015-08-28 22:09:07 -0700
commit7b4f1cfb4a2cdbc203299b0b89710545f2d2d287 (patch)
tree06d0c60779b92575f5258a48d8e3038ba5f4206d /utils/alsoft-config/mainwindow.cpp
parent2cb974df40526bec50092edf1cfe9551c93e2f50 (diff)
Handle the stereo-mode config option with alsoft-config
Diffstat (limited to 'utils/alsoft-config/mainwindow.cpp')
-rw-r--r--utils/alsoft-config/mainwindow.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp
index 05afc918..60e5f999 100644
--- a/utils/alsoft-config/mainwindow.cpp
+++ b/utils/alsoft-config/mainwindow.cpp
@@ -66,6 +66,12 @@ static const struct {
{ "Cubic Spline (good quality)", "cubic" },
{ "", "" }
+}, stereoModeList[] = {
+ { "Autodetect", "" },
+ { "Speakers", "speakers" },
+ { "Headphones", "headphones" },
+
+ { "", "" }
};
static QString getDefaultConfigName()
@@ -153,6 +159,9 @@ MainWindow::MainWindow(QWidget *parent) :
for(int i = 0;resamplerList[i].name[0];i++)
ui->resamplerComboBox->addItem(resamplerList[i].name);
ui->resamplerComboBox->adjustSize();
+ for(int i = 0;stereoModeList[i].name[0];i++)
+ ui->stereoModeCombo->addItem(stereoModeList[i].name);
+ ui->stereoModeCombo->adjustSize();
mPeriodSizeValidator = new QIntValidator(64, 8192, this);
ui->periodSizeEdit->setValidator(mPeriodSizeValidator);
@@ -302,6 +311,28 @@ void MainWindow::loadConfig(const QString &fname)
}
}
+ QString stereomode = settings.value("stereo-mode").toString().trimmed();
+ ui->stereoModeCombo->setCurrentIndex(0);
+ if(stereomode.isEmpty() == false)
+ {
+ for(int i = 0;stereoModeList[i].name[i];i++)
+ {
+ if(stereomode == stereoModeList[i].value)
+ {
+ for(int j = 1;j < ui->stereoModeCombo->count();j++)
+ {
+ QString item = ui->stereoModeCombo->itemText(j);
+ if(item == stereoModeList[i].name)
+ {
+ ui->stereoModeCombo->setCurrentIndex(j);
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+
int periodsize = settings.value("period_size").toInt();
ui->periodSizeEdit->clear();
if(periodsize >= 64)
@@ -475,6 +506,16 @@ void MainWindow::saveConfig(const QString &fname) const
}
}
+ str = ui->stereoModeCombo->currentText();
+ for(int i = 0;stereoModeList[i].name[0];i++)
+ {
+ if(str == stereoModeList[i].name)
+ {
+ settings.setValue("stereo-mode", stereoModeList[i].value);
+ break;
+ }
+ }
+
QStringList strlist;
if(!ui->enableSSECheckBox->isChecked())
strlist.append("sse");