aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-03-12 16:10:49 -0700
committerChris Robinson <[email protected]>2017-03-12 16:10:49 -0700
commitdc17f287fe685f8f211dd8a7b14f46d2c719f1de (patch)
tree110c009b8f7c0fd4a3bc30cd2195ee6ac08838ad /utils
parentd9e2a0cbf04e8e2feab6597a5fc5c74bd5026a34 (diff)
Use a spinbox for the nfc-ref-delay value
Diffstat (limited to 'utils')
-rw-r--r--utils/alsoft-config/mainwindow.cpp38
-rw-r--r--utils/alsoft-config/mainwindow.h4
-rw-r--r--utils/alsoft-config/mainwindow.ui49
3 files changed, 19 insertions, 72 deletions
diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp
index 4510781e..c2e36fb4 100644
--- a/utils/alsoft-config/mainwindow.cpp
+++ b/utils/alsoft-config/mainwindow.cpp
@@ -293,9 +293,6 @@ MainWindow::MainWindow(QWidget *parent) :
mPeriodCountValidator = new QIntValidator(2, 16, this);
ui->periodCountEdit->setValidator(mPeriodCountValidator);
- mRefDelayValidator = new QDoubleValidator(0.0, 1000.0, 3, this);
- ui->decoderNFRefDelayEdit->setValidator(mRefDelayValidator);
-
mSourceCountValidator = new QIntValidator(0, 4096, this);
ui->srcCountLineEdit->setValidator(mSourceCountValidator);
mEffectSlotValidator = new QIntValidator(0, 64, this);
@@ -335,8 +332,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->decoderHQModeCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
connect(ui->decoderDistCompCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
connect(ui->decoderNFEffectsCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
- connect(ui->decoderNFRefDelaySlider, SIGNAL(valueChanged(int)), this, SLOT(updateRefDelayEdit(int)));
- connect(ui->decoderNFRefDelayEdit, SIGNAL(editingFinished()), this, SLOT(updateRefDelaySlider()));
+ connect(ui->decoderNFRefDelaySpinBox, SIGNAL(valueChanged(double)), 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()));
@@ -430,7 +426,6 @@ MainWindow::~MainWindow()
delete ui;
delete mPeriodSizeValidator;
delete mPeriodCountValidator;
- delete mRefDelayValidator;
delete mSourceCountValidator;
delete mEffectSlotValidator;
delete mSourceSendValidator;
@@ -675,12 +670,7 @@ void MainWindow::loadConfig(const QString &fname)
bool nfeffects = settings.value("decoder/nfc", true).toBool();
ui->decoderNFEffectsCheckBox->setChecked(nfeffects);
double refdelay = settings.value("decoder/nfc-ref-delay", 0.0).toDouble();
- ui->decoderNFRefDelayEdit->clear();
- if(refdelay > 0.0)
- {
- ui->decoderNFRefDelayEdit->insert(QString::number(refdelay));
- updateRefDelaySlider();
- }
+ ui->decoderNFRefDelaySpinBox->setValue(refdelay);
ui->decoderQuadLineEdit->setText(settings.value("decoder/quad").toString());
ui->decoder51LineEdit->setText(settings.value("decoder/surround51").toString());
@@ -913,7 +903,10 @@ void MainWindow::saveConfig(const QString &fname) const
settings.setValue("decoder/nfc",
ui->decoderNFEffectsCheckBox->isChecked() ? QString(/*"true"*/) : QString("false")
);
- settings.setValue("decoder/nfc-ref-delay", ui->decoderNFRefDelayEdit->text());
+ double refdelay = ui->decoderNFRefDelaySpinBox->value();
+ settings.setValue("decoder/nfc-ref-delay",
+ (refdelay > 0.0) ? QString::number(refdelay) : QString()
+ );
settings.setValue("decoder/quad", ui->decoderQuadLineEdit->text());
settings.setValue("decoder/surround51", ui->decoder51LineEdit->text());
@@ -1129,25 +1122,6 @@ void MainWindow::updatePeriodCountSlider()
}
-void MainWindow::updateRefDelayEdit(int delay)
-{
- ui->decoderNFRefDelayEdit->clear();
- if(delay > 0)
- ui->decoderNFRefDelayEdit->insert(
- QString("%1").arg(delay/1000.0, 0, 'f', 3)
- );
- enableApplyButton();
-}
-
-void MainWindow::updateRefDelaySlider()
-{
- double pos = ui->decoderNFRefDelayEdit->text().toDouble();
- if(pos > 1.0) pos = 1.0;
- ui->decoderNFRefDelaySlider->setSliderPosition((int)(pos*1000.0));
- enableApplyButton();
-}
-
-
void MainWindow::selectQuadDecoderFile()
{ selectDecoderFile(ui->decoderQuadLineEdit, "Select Quadrophonic Decoder");}
void MainWindow::select51DecoderFile()
diff --git a/utils/alsoft-config/mainwindow.h b/utils/alsoft-config/mainwindow.h
index 766c138c..8b763845 100644
--- a/utils/alsoft-config/mainwindow.h
+++ b/utils/alsoft-config/mainwindow.h
@@ -35,9 +35,6 @@ private slots:
void updatePeriodCountEdit(int size);
void updatePeriodCountSlider();
- void updateRefDelayEdit(int delay);
- void updateRefDelaySlider();
-
void selectQuadDecoderFile();
void select51DecoderFile();
void select61DecoderFile();
@@ -66,7 +63,6 @@ private:
QValidator *mPeriodSizeValidator;
QValidator *mPeriodCountValidator;
- QValidator *mRefDelayValidator;
QValidator *mSourceCountValidator;
QValidator *mEffectSlotValidator;
QValidator *mSourceSendValidator;
diff --git a/utils/alsoft-config/mainwindow.ui b/utils/alsoft-config/mainwindow.ui
index 3a5a3190..b186e744 100644
--- a/utils/alsoft-config/mainwindow.ui
+++ b/utils/alsoft-config/mainwindow.ui
@@ -823,7 +823,7 @@ Quality Mode to be enabled.</string>
<rect>
<x>-10</x>
<y>110</y>
- <width>551</width>
+ <width>281</width>
<height>21</height>
</rect>
</property>
@@ -843,7 +843,7 @@ normal output is created with no near-field simulation.</string>
<rect>
<x>20</x>
<y>0</y>
- <width>161</width>
+ <width>151</width>
<height>21</height>
</rect>
</property>
@@ -854,49 +854,26 @@ normal output is created with no near-field simulation.</string>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
- <widget class="QSlider" name="decoderNFRefDelaySlider">
- <property name="geometry">
- <rect>
- <x>190</x>
- <y>0</y>
- <width>251</width>
- <height>20</height>
- </rect>
- </property>
- <property name="maximum">
- <number>1000</number>
- </property>
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- </widget>
- <widget class="QLineEdit" name="decoderNFRefDelayEdit">
+ <widget class="QDoubleSpinBox" name="decoderNFRefDelaySpinBox">
<property name="geometry">
<rect>
- <x>450</x>
+ <x>180</x>
<y>0</y>
- <width>51</width>
+ <width>91</width>
<height>21</height>
</rect>
</property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+ <property name="suffix">
+ <string>sec</string>
</property>
- <property name="placeholderText">
- <string>off</string>
+ <property name="decimals">
+ <number>4</number>
</property>
- </widget>
- <widget class="QLabel" name="label_31">
- <property name="geometry">
- <rect>
- <x>510</x>
- <y>0</y>
- <width>31</width>
- <height>21</height>
- </rect>
+ <property name="maximum">
+ <double>1000.000000000000000</double>
</property>
- <property name="text">
- <string>sec.</string>
+ <property name="singleStep">
+ <double>0.010000000000000</double>
</property>
</widget>
</widget>