From ca309e685e88244c3b380acd5eabbc65364665b2 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 28 Mar 2016 16:35:42 -0700 Subject: [PATCH] Add a config dialog tab for decoder options --- utils/alsoft-config/mainwindow.cpp | 67 ++++++++++ utils/alsoft-config/mainwindow.h | 10 ++ utils/alsoft-config/mainwindow.ui | 264 ++++++++++++++++++++++++++++++++++++- 3 files changed, 336 insertions(+), 5 deletions(-) diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp index 5f57ce0f..53e2ffea 100644 --- a/utils/alsoft-config/mainwindow.cpp +++ b/utils/alsoft-config/mainwindow.cpp @@ -312,6 +312,19 @@ MainWindow::MainWindow(QWidget *parent) : connect(ui->stereoPanningComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(enableApplyButton())); + connect(ui->decoderHQModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(toggleHqState(int))); + connect(ui->decoderDistCompCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); + connect(ui->decoderQuadLineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(ui->decoderQuadButton, SIGNAL(clicked()), this, SLOT(selectQuadDecoderFile())); + connect(ui->decoder51LineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(ui->decoder51Button, SIGNAL(clicked()), this, SLOT(select51DecoderFile())); + connect(ui->decoder51RearLineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(ui->decoder51RearButton, SIGNAL(clicked()), this, SLOT(select51RearDecoderFile())); + connect(ui->decoder61LineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(ui->decoder61Button, SIGNAL(clicked()), this, SLOT(select71DecoderFile())); + connect(ui->decoder71LineEdit, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(ui->decoder71Button, SIGNAL(clicked()), this, SLOT(select61DecoderFile())); + connect(ui->preferredHrtfComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(enableApplyButton())); connect(ui->hrtfStateComboBox, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(enableApplyButton())); connect(ui->hrtfAddButton, SIGNAL(clicked()), this, SLOT(addHrtfFile())); @@ -610,6 +623,18 @@ void MainWindow::loadConfig(const QString &fname) } } + bool hqmode = settings.value("decoder/hq-mode", false).toBool(); + ui->decoderHQModeCheckBox->setChecked(hqmode); + bool distcomp = settings.value("decoder/distance-comp", true).toBool(); + ui->decoderDistCompCheckBox->setChecked(distcomp); + ui->decoderDistCompCheckBox->setEnabled(hqmode); + + ui->decoderQuadLineEdit->setText(settings.value("decoder/quad").toString()); + ui->decoder51LineEdit->setText(settings.value("decoder/surround51").toString()); + ui->decoder51RearLineEdit->setText(settings.value("decoder/surround51rear").toString()); + ui->decoder61LineEdit->setText(settings.value("decoder/surround61").toString()); + ui->decoder71LineEdit->setText(settings.value("decoder/surround71").toString()); + QStringList disabledCpuExts = settings.value("disable-cpu-exts").toStringList(); if(disabledCpuExts.size() == 1) disabledCpuExts = disabledCpuExts[0].split(QChar(',')); @@ -826,6 +851,19 @@ void MainWindow::saveConfig(const QString &fname) const settings.setValue("stereo-mode", getValueFromName(stereoModeList, ui->stereoModeCombo->currentText())); settings.setValue("stereo-panning", getValueFromName(stereoPanList, ui->stereoPanningComboBox->currentText())); + settings.setValue("decoder/hq-mode", + ui->decoderHQModeCheckBox->isChecked() ? QString("true") : QString(/*"false"*/) + ); + settings.setValue("decoder/distance-comp", + ui->decoderDistCompCheckBox->isChecked() ? QString(/*"true"*/) : QString("false") + ); + + settings.setValue("decoder/quad", ui->decoderQuadLineEdit->text()); + settings.setValue("decoder/surround51", ui->decoder51LineEdit->text()); + settings.setValue("decoder/surround51rear", ui->decoder51RearLineEdit->text()); + settings.setValue("decoder/surround61", ui->decoder61LineEdit->text()); + settings.setValue("decoder/surround71", ui->decoder71LineEdit->text()); + QStringList strlist; if(!ui->enableSSECheckBox->isChecked()) strlist.append("sse"); @@ -1035,6 +1073,35 @@ void MainWindow::updatePeriodCountSlider() } +void MainWindow::toggleHqState(int state) +{ + ui->decoderDistCompCheckBox->setEnabled(state); + enableApplyButton(); +} + +void MainWindow::selectQuadDecoderFile() +{ selectDecoderFile(ui->decoderQuadLineEdit, "Select Quadrophonic Decoder");} +void MainWindow::select51DecoderFile() +{ selectDecoderFile(ui->decoder51LineEdit, "Select 5.1 Surround (Side) Decoder");} +void MainWindow::select51RearDecoderFile() +{ selectDecoderFile(ui->decoder51RearLineEdit, "Select 5.1 Surround (Rear) Decoder");} +void MainWindow::select61DecoderFile() +{ selectDecoderFile(ui->decoder61LineEdit, "Select 6.1 Surround Decoder");} +void MainWindow::select71DecoderFile() +{ selectDecoderFile(ui->decoder71LineEdit, "Select 7.1 Surround Decoder");} +void MainWindow::selectDecoderFile(QLineEdit *line, const char *caption) +{ + QString fname = QFileDialog::getOpenFileName(this, tr(caption), + line->text(), tr("AmbDec Files (*.ambdec);;All Files (*.*)") + ); + if(!fname.isEmpty()) + { + line->setText(fname); + enableApplyButton(); + } +} + + void MainWindow::updateJackBufferSizeEdit(int size) { ui->jackBufferSizeLine->clear(); diff --git a/utils/alsoft-config/mainwindow.h b/utils/alsoft-config/mainwindow.h index 65e6e1b6..3bf2fb83 100644 --- a/utils/alsoft-config/mainwindow.h +++ b/utils/alsoft-config/mainwindow.h @@ -35,6 +35,14 @@ private slots: void updatePeriodCountEdit(int size); void updatePeriodCountSlider(); + void toggleHqState(int state); + + void selectQuadDecoderFile(); + void select51DecoderFile(); + void select51RearDecoderFile(); + void select61DecoderFile(); + void select71DecoderFile(); + void updateJackBufferSizeEdit(int size); void updateJackBufferSizeSlider(); @@ -68,6 +76,8 @@ private: void closeEvent(QCloseEvent *event); + void selectDecoderFile(QLineEdit *line, const char *name); + QStringList collectHrtfs(); void loadConfig(const QString &fname); diff --git a/utils/alsoft-config/mainwindow.ui b/utils/alsoft-config/mainwindow.ui index 9ed7840a..cb1df954 100644 --- a/utils/alsoft-config/mainwindow.ui +++ b/utils/alsoft-config/mainwindow.ui @@ -537,6 +537,258 @@ Pair-Wise uses standard pair-wise panning between + + + Renderer + + + + + 10 + 20 + 181 + 21 + + + + Enables high-quality ambisonic rendering. This mode is +capable of frequency-dependent processing, creating a +better reproduction of 3D sound rendering over +surround sound speakers. Enabling this also requires +specifying decoder configuration files for the +appropriate speaker configuration you intend to use. + + + Qt::RightToLeft + + + High Quality Mode: + + + + + + 10 + 50 + 181 + 21 + + + + This applies the necessary delays and attenuation +to make the speakers behave as though they are +all equidistant, which is important for proper +playback of 3D sound rendering. Requires the high +quality ambisonic renderer, as well as the proper +distances to be specified in the decoder +configuration file. + + + Qt::RightToLeft + + + Distance Compensation: + + + true + + + + + + 140 + 100 + 281 + 21 + + + + + + + 11 + 100 + 121 + 21 + + + + Quadrophonic: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 140 + 130 + 281 + 21 + + + + + + + 140 + 160 + 281 + 21 + + + + + + + 140 + 190 + 281 + 21 + + + + + + + 140 + 220 + 281 + 21 + + + + + + + 10 + 130 + 121 + 21 + + + + 5.1 Surround (Side): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 10 + 160 + 121 + 21 + + + + 5.1 Surround (Rear): + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 10 + 190 + 121 + 21 + + + + 6.1 Surround: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 10 + 220 + 121 + 21 + + + + 7.1 Surround: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 430 + 100 + 91 + 21 + + + + Browse... + + + + + + 430 + 130 + 91 + 21 + + + + Browse... + + + + + + 430 + 160 + 91 + 21 + + + + Browse... + + + + + + 430 + 190 + 91 + 21 + + + + Browse... + + + + + + 430 + 220 + 91 + 21 + + + + Browse... + + + HRTF @@ -1182,7 +1434,7 @@ during updates. 320 30 91 - 22 + 21 @@ -1195,7 +1447,7 @@ during updates. 320 60 91 - 22 + 21 @@ -1239,7 +1491,7 @@ during updates. 320 30 91 - 22 + 21 @@ -1293,7 +1545,7 @@ during updates. 320 30 91 - 22 + 21 @@ -1942,7 +2194,9 @@ added by the ALC_EXT_DEDICATED extension. Cancel - + + + -- 2.11.4.GIT