aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/alsoft-config/mainwindow.cpp44
-rw-r--r--utils/alsoft-config/mainwindow.ui22
2 files changed, 31 insertions, 35 deletions
diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp
index 099c74f9..9eaf14ed 100644
--- a/utils/alsoft-config/mainwindow.cpp
+++ b/utils/alsoft-config/mainwindow.cpp
@@ -57,6 +57,13 @@ static const struct {
{ "32-bit float", "float32" },
{ "", "" }
+}, resamplerList[] = {
+ { "Default", "" },
+ { "Point (low quality, fast)", "point" },
+ { "Linear (basic quality, fast)", "linear" },
+ { "Cubic Spline (good quality)", "cubic" },
+
+ { "", "" }
};
static QString getDefaultConfigName()
@@ -141,6 +148,9 @@ MainWindow::MainWindow(QWidget *parent) :
for(int i = 0;sampleTypeList[i].name[0];i++)
ui->sampleFormatCombo->addItem(sampleTypeList[i].name);
ui->sampleFormatCombo->adjustSize();
+ for(int i = 0;resamplerList[i].name[0];i++)
+ ui->resamplerComboBox->addItem(resamplerList[i].name);
+ ui->resamplerComboBox->adjustSize();
mPeriodSizeValidator = new QIntValidator(64, 8192, this);
ui->periodSizeEdit->setValidator(mPeriodSizeValidator);
@@ -269,18 +279,22 @@ void MainWindow::loadConfig(const QString &fname)
ui->srcSendLineEdit->insert(settings.value("sends").toString());
QString resampler = settings.value("resampler").toString().trimmed();
- if(resampler.isEmpty())
- ui->resamplerComboBox->setCurrentIndex(0);
- else
+ ui->resamplerComboBox->setCurrentIndex(0);
+ if(resampler.isEmpty() == false)
{
- for(int i = 1;i < ui->resamplerComboBox->count();i++)
+ for(int i = 0;resamplerList[i].name[i];i++)
{
- QString item = ui->resamplerComboBox->itemText(i);
- int end = item.indexOf(' ');
- if(end < 0) end = item.size();
- if(resampler.size() == end && resampler.compare(item.leftRef(end), Qt::CaseInsensitive) == 0)
+ if(resampler == resamplerList[i].value)
{
- ui->resamplerComboBox->setCurrentIndex(i);
+ for(int j = 1;j < ui->resamplerComboBox->count();j++)
+ {
+ QString item = ui->resamplerComboBox->itemText(j);
+ if(item == resamplerList[i].name)
+ {
+ ui->resamplerComboBox->setCurrentIndex(j);
+ break;
+ }
+ }
break;
}
}
@@ -449,12 +463,14 @@ void MainWindow::saveConfig(const QString &fname) const
settings.setValue("sources", ui->srcCountLineEdit->text());
settings.setValue("slots", ui->effectSlotLineEdit->text());
- if(ui->resamplerComboBox->currentIndex() == 0)
- settings.setValue("resampler", QString());
- else
+ str = ui->resamplerComboBox->currentText();
+ for(int i = 0;resamplerList[i].name[0];i++)
{
- str = ui->resamplerComboBox->currentText();
- settings.setValue("resampler", str.split(' ').first().toLower());
+ if(str == resamplerList[i].name)
+ {
+ settings.setValue("resampler", resamplerList[i].value);
+ break;
+ }
}
QStringList strlist;
diff --git a/utils/alsoft-config/mainwindow.ui b/utils/alsoft-config/mainwindow.ui
index 54bae81c..6a2fed14 100644
--- a/utils/alsoft-config/mainwindow.ui
+++ b/utils/alsoft-config/mainwindow.ui
@@ -662,7 +662,7 @@ value currently possible is 4.</string>
<rect>
<x>110</x>
<y>120</y>
- <width>185</width>
+ <width>78</width>
<height>22</height>
</rect>
</property>
@@ -672,26 +672,6 @@ value currently possible is 4.</string>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
- <item>
- <property name="text">
- <string>- Default -</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Point (low quality, fast)</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Linear (basic quality, fast)</string>
- </property>
- </item>
- <item>
- <property name="text">
- <string>Cubic Spline (good quality)</string>
- </property>
- </item>
</widget>
<widget class="QGroupBox" name="groupBox_2">
<property name="geometry">