diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp index 01f59e4b..c05e343e 100644 --- a/utils/alsoft-config/mainwindow.cpp +++ b/utils/alsoft-config/mainwindow.cpp @@ -86,12 +86,12 @@ static const struct { { "", "" } }, resamplerList[] = { - { "Default", "" }, - { "Point (low quality, very fast)", "point" }, - { "Linear (basic quality, fast)", "linear" }, - { "4-Point Sinc (good quality)", "sinc4" }, - { "8-Point Sinc (high quality, slow)", "sinc8" }, - { "Band-limited Sinc (very high quality, very slow)", "bsinc" }, + { "Point", "point" }, + { "Linear", "linear" }, + { "Default (Linear)", "" }, + { "4-Point Sinc", "sinc4" }, + { "8-Point Sinc", "sinc8" }, + { "Band-limited Sinc", "bsinc" }, { "", "" } }, stereoModeList[] = { @@ -183,13 +183,15 @@ 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(); for(int i = 0;stereoModeList[i].name[0];i++) ui->stereoModeCombo->addItem(stereoModeList[i].name); ui->stereoModeCombo->adjustSize(); + int count; + for(count = 0;resamplerList[count].name[0];count++) { + } + ui->resamplerSlider->setRange(0, count-1); + ui->hrtfStateComboBox->adjustSize(); #if !defined(HAVE_NEON) && !defined(HAVE_SSE) @@ -251,6 +253,8 @@ MainWindow::MainWindow(QWidget *parent) : connect(ui->applyButton, SIGNAL(clicked()), this, SLOT(saveCurrentConfig())); + connect(ui->resamplerSlider, SIGNAL(valueChanged(int)), this, SLOT(updateResamplerLabel(int))); + connect(ui->periodSizeSlider, SIGNAL(valueChanged(int)), this, SLOT(updatePeriodSizeEdit(int))); connect(ui->periodSizeEdit, SIGNAL(editingFinished()), this, SLOT(updatePeriodSizeSlider())); connect(ui->periodCountSlider, SIGNAL(valueChanged(int)), this, SLOT(updatePeriodCountEdit(int))); @@ -352,29 +356,17 @@ void MainWindow::loadConfig(const QString &fname) ui->srcSendLineEdit->insert(settings.value("sends").toString()); QString resampler = settings.value("resampler").toString().trimmed(); - ui->resamplerComboBox->setCurrentIndex(0); - if(resampler.isEmpty() == false) + ui->resamplerSlider->setValue(0); + /* The "cubic" resampler is no longer supported. It's been replaced by + * "sinc4". */ + if(resampler == "cubic") + resampler = "sinc4"; + for(int i = 0;resamplerList[i].name[i];i++) { - /* The "cubic" resampler is no longer supported. It's been replaced by - * "sinc4". */ - if(resampler == "cubic") - resampler = "sinc4"; - - for(int i = 0;resamplerList[i].name[i];i++) + if(resampler == resamplerList[i].value) { - if(resampler == resamplerList[i].value) - { - 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; - } + ui->resamplerSlider->setValue(i); + break; } } @@ -442,6 +434,14 @@ void MainWindow::loadConfig(const QString &fname) hrtf_tables = hrtf_tables[0].split(QChar(',')); std::transform(hrtf_tables.begin(), hrtf_tables.end(), hrtf_tables.begin(), std::mem_fun_ref(&QString::trimmed)); + hrtf_tables.removeDuplicates(); + if(!hrtf_tables.empty() && !hrtf_tables.contains("%s.mhr")) + ui->defaultHrtfPathsCheckBox->setCheckState(Qt::Unchecked); + else + { + hrtf_tables.removeOne("%s.mhr"); + ui->defaultHrtfPathsCheckBox->setCheckState(Qt::Checked); + } ui->hrtfFileList->clear(); ui->hrtfFileList->addItems(hrtf_tables); updateHrtfRemoveButton(); @@ -562,15 +562,7 @@ void MainWindow::saveConfig(const QString &fname) const settings.setValue("sources", ui->srcCountLineEdit->text()); settings.setValue("slots", ui->effectSlotLineEdit->text()); - str = ui->resamplerComboBox->currentText(); - for(int i = 0;resamplerList[i].name[0];i++) - { - if(str == resamplerList[i].name) - { - settings.setValue("resampler", resamplerList[i].value); - break; - } - } + settings.setValue("resampler", resamplerList[ui->resamplerSlider->value()].value); str = ui->stereoModeCombo->currentText(); for(int i = 0;stereoModeList[i].name[0];i++) @@ -606,6 +598,8 @@ void MainWindow::saveConfig(const QString &fname) const QList items = ui->hrtfFileList->findItems("*", Qt::MatchWildcard); foreach(const QListWidgetItem *item, items) strlist.append(item->text()); + if(!strlist.empty() && ui->defaultHrtfPathsCheckBox->isChecked()) + strlist.append("%s.mhr"); settings.setValue("hrtf_tables", strlist.join(QChar(','))); strlist.clear(); @@ -671,6 +665,12 @@ void MainWindow::saveConfig(const QString &fname) const } +void MainWindow::updateResamplerLabel(int num) +{ + ui->resamplerLabel->setText(resamplerList[num].name); +} + + void MainWindow::updatePeriodSizeEdit(int size) { ui->periodSizeEdit->clear(); diff --git a/utils/alsoft-config/mainwindow.h b/utils/alsoft-config/mainwindow.h index b5a1ae7c..0f94c0ce 100644 --- a/utils/alsoft-config/mainwindow.h +++ b/utils/alsoft-config/mainwindow.h @@ -22,6 +22,8 @@ private slots: void saveConfigAsFile(); void loadConfigFromFile(); + void updateResamplerLabel(int num); + void updatePeriodSizeEdit(int size); void updatePeriodSizeSlider(); void updatePeriodCountEdit(int size); diff --git a/utils/alsoft-config/mainwindow.ui b/utils/alsoft-config/mainwindow.ui index ab575fee..30e53d15 100644 --- a/utils/alsoft-config/mainwindow.ui +++ b/utils/alsoft-config/mainwindow.ui @@ -10,6 +10,18 @@ 454 + + + 564 + 454 + + + + + 564 + 454 + + OpenAL Soft Configuration @@ -198,310 +210,6 @@ to stereo output. Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - 10 - 180 - 511 - 191 - - - - HRTF (Stereo only) - - - - - 20 - 30 - 391 - 121 - - - - A list of files containing HRTF data sets. The listed data sets -are used in place of the default sets. The filenames may -contain these markers, which will be replaced as needed: -%r - Device sampling rate -%s - Non-greedy string (up to the following matching characters) -%% - Percent sign (%) - - - false - - - QAbstractItemView::InternalMove - - - true - - - QAbstractItemView::ExtendedSelection - - - Qt::ElideNone - - - - - - 420 - 30 - 81 - 25 - - - - Add... - - - - - - - - false - - - - - - 420 - 60 - 81 - 25 - - - - Remove - - - - - - - - - - - 110 - 160 - 161 - 22 - - - - QComboBox::AdjustToContentsOnFirstShow - - - - Application preference - - - - - Force on - - - - - Force off - - - - - - - 30 - 160 - 71 - 21 - - - - HRTF Mode: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - 10 - 90 - 511 - 91 - - - - Buffer Metrics - - - - - 260 - 20 - 241 - 51 - - - - The number of update periods. Higher values create a larger -mix ahead, which helps protect against skips when the CPU is -under load, but increases the delay between a sound getting -mixed and being heard. - - - - - 20 - 0 - 201 - 21 - - - - Period Count - - - Qt::AlignCenter - - - - - - 70 - 20 - 160 - 23 - - - - 1 - - - 16 - - - 1 - - - 2 - - - 1 - - - true - - - Qt::Horizontal - - - QSlider::TicksBelow - - - 1 - - - - - - 20 - 20 - 51 - 22 - - - - 4 - - - - - - - 10 - 20 - 241 - 51 - - - - The update period size, in sample frames. This is the number of -frames needed for each mixing update. - - - - - 60 - 20 - 160 - 23 - - - - 0 - - - 8192 - - - 64 - - - 1024 - - - 0 - - - true - - - Qt::Horizontal - - - QSlider::TicksBelow - - - 512 - - - - - - 10 - 0 - 201 - 21 - - - - Period Samples - - - Qt::AlignCenter - - - - - - 10 - 20 - 51 - 22 - - - - 1024 - - - - @@ -533,6 +241,446 @@ filters may be used to improve binaural quality, which may not otherwise be suitable for speakers. + + + + -11 + 200 + 551 + 181 + + + + Advanced Settings + + + Qt::AlignCenter + + + + + 20 + 30 + 511 + 91 + + + + Buffer Metrics + + + Qt::AlignCenter + + + + + 260 + 20 + 241 + 51 + + + + The number of update periods. Higher values create a larger +mix ahead, which helps protect against skips when the CPU is +under load, but increases the delay between a sound getting +mixed and being heard. + + + + + 20 + 0 + 201 + 21 + + + + Period Count + + + Qt::AlignCenter + + + + + + 70 + 20 + 160 + 23 + + + + 1 + + + 16 + + + 1 + + + 2 + + + 1 + + + true + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 1 + + + + + + 20 + 20 + 51 + 22 + + + + 4 + + + + + + + 10 + 20 + 241 + 51 + + + + The update period size, in sample frames. This is the number of +frames needed for each mixing update. + + + + + 60 + 20 + 160 + 23 + + + + 0 + + + 8192 + + + 64 + + + 1024 + + + 0 + + + true + + + Qt::Horizontal + + + QSlider::TicksBelow + + + 512 + + + + + + 10 + 0 + 201 + 21 + + + + Period Samples + + + Qt::AlignCenter + + + + + + 10 + 20 + 51 + 22 + + + + 1024 + + + + + + + + + 90 + 80 + 351 + 81 + + + + Resampler Quality + + + Qt::AlignCenter + + + + + 20 + 50 + 311 + 21 + + + + Default + + + Qt::AlignCenter + + + + + + 20 + 30 + 311 + 23 + + + + Qt::Horizontal + + + + + + + HRTF + + + + + -10 + 200 + 551 + 181 + + + + Advanced Settings + + + Qt::AlignCenter + + + false + + + false + + + + + 20 + 30 + 511 + 141 + + + + HRTF Profiles + + + Qt::AlignCenter + + + + + 20 + 20 + 391 + 81 + + + + A list of files containing HRTF data sets. The listed data sets +are used in place of the default sets. The filenames may +contain these markers, which will be replaced as needed: +%r - Device sampling rate +%s - Non-greedy string (up to the following matching characters) +%% - Percent sign (%) + + + false + + + QAbstractItemView::InternalMove + + + true + + + QAbstractItemView::ExtendedSelection + + + Qt::ElideNone + + + + + + 420 + 20 + 81 + 25 + + + + Add... + + + + + + + + false + + + + + + 180 + 110 + 151 + 21 + + + + Include Default Paths + + + true + + + + + + 420 + 50 + 81 + 25 + + + + Remove + + + + + + + + + + + + + 40 + 50 + 71 + 21 + + + + HRTF Mode: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 130 + 50 + 161 + 22 + + + + QComboBox::AdjustToContentsOnFirstShow + + + + Application preference + + + + + Force on + + + + + Force off + + + + + + + 20 + 20 + 91 + 21 + + + + Preferred HRTF: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 130 + 20 + 161 + 22 + + + @@ -662,40 +810,11 @@ value currently possible is 4. Auto - - - - 30 - 120 - 71 - 21 - - - - Resampler: - - - - - - 110 - 120 - 78 - 22 - - - - The resampling method used when mixing sources. - - - QComboBox::AdjustToContents - - 10 - 150 + 120 511 121