From dd6c5270b6e9dd041dd7560e4836d269482fa5b7 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 23 May 2017 01:12:49 -0700 Subject: Add a dithering option to alsoft-config --- utils/alsoft-config/mainwindow.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'utils/alsoft-config/mainwindow.cpp') diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp index 4f16726f..a743ca6a 100644 --- a/utils/alsoft-config/mainwindow.cpp +++ b/utils/alsoft-config/mainwindow.cpp @@ -329,6 +329,7 @@ MainWindow::MainWindow(QWidget *parent) : connect(ui->stereoEncodingComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(enableApplyButton())); connect(ui->ambiFormatComboBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(enableApplyButton())); connect(ui->outputLimiterCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); + connect(ui->outputDitherCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->decoderHQModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->decoderDistCompCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); @@ -654,6 +655,13 @@ void MainWindow::loadConfig(const QString &fname) settings.value("output-limiter").toBool() ? Qt::Checked : Qt::Unchecked ); + if(settings.value("dither").isNull()) + ui->outputDitherCheckBox->setCheckState(Qt::PartiallyChecked); + else + ui->outputDitherCheckBox->setCheckState( + settings.value("dither").toBool() ? Qt::Checked : Qt::Unchecked + ); + QString stereopan = settings.value("stereo-encoding").toString(); ui->stereoEncodingComboBox->setCurrentIndex(0); if(stereopan.isEmpty() == false) @@ -917,6 +925,14 @@ void MainWindow::saveConfig(const QString &fname) const else if(limiter == Qt::Unchecked) settings.setValue("output-limiter", QString("false")); + Qt::CheckState dither = ui->outputDitherCheckBox->checkState(); + if(dither == Qt::PartiallyChecked) + settings.setValue("dither", QString()); + else if(dither == Qt::Checked) + settings.setValue("dither", QString("true")); + else if(dither == Qt::Unchecked) + settings.setValue("dither", QString("false")); + settings.setValue("decoder/hq-mode", ui->decoderHQModeCheckBox->isChecked() ? QString("true") : QString(/*"false"*/) ); -- cgit v1.2.3