From 773e2846e735c55c123cecb2ff57a50f64e90aa7 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 2 Mar 2016 15:31:14 -0800 Subject: [PATCH] Add a Wave Writer backend config page --- utils/alsoft-config/mainwindow.cpp | 24 +++++++++++++ utils/alsoft-config/mainwindow.h | 2 ++ utils/alsoft-config/mainwindow.ui | 72 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 98 insertions(+) diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp index 1a7c7fef..dca1816c 100644 --- a/utils/alsoft-config/mainwindow.cpp +++ b/utils/alsoft-config/mainwindow.cpp @@ -325,6 +325,10 @@ MainWindow::MainWindow(QWidget *parent) : connect(ui->solarisDefaultDeviceLine, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); connect(ui->solarisPlaybackPushButton, SIGNAL(pressed()), this, SLOT(selectSolarisPlayback())); + connect(ui->waveOutputLine, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(ui->waveOutputButton, SIGNAL(pressed()), this, SLOT(selectWaveOutput())); + connect(ui->waveBFormatCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); + ui->backendListWidget->setCurrentRow(0); ui->tabWidget->setCurrentIndex(0); @@ -707,6 +711,9 @@ void MainWindow::loadConfig(const QString &fname) ui->solarisDefaultDeviceLine->setText(settings.value("solaris/device", QString()).toString()); + ui->waveOutputLine->setText(settings.value("wave/file", QString()).toString()); + ui->waveBFormatCheckBox->setChecked(settings.value("wave/bformat", false).toBool()); + ui->applyButton->setEnabled(false); ui->closeCancelButton->setText(tr("Close")); mNeedsSave = false; @@ -924,6 +931,11 @@ void MainWindow::saveConfig(const QString &fname) const settings.setValue("solaris/device", ui->solarisDefaultDeviceLine->text()); + settings.setValue("wave/file", ui->waveOutputLine->text()); + settings.setValue("wave/bformat", + ui->waveBFormatCheckBox->isChecked() ? QString("true") : QString(/*"false"*/) + ); + /* Remove empty keys * FIXME: Should only remove keys whose value matches the globally-specified value. */ @@ -1127,3 +1139,15 @@ void MainWindow::selectSolarisPlayback() enableApplyButton(); } } + +void MainWindow::selectWaveOutput() +{ + QString fname = QFileDialog::getSaveFileName(this, tr("Select Wave File Output"), + ui->waveOutputLine->text(), tr("Wave Files (*.wav *.amb);;All Files (*.*)") + ); + if(!fname.isEmpty()) + { + ui->waveOutputLine->setText(fname); + enableApplyButton(); + } +} diff --git a/utils/alsoft-config/mainwindow.h b/utils/alsoft-config/mainwindow.h index 78285dfa..27f3c252 100644 --- a/utils/alsoft-config/mainwindow.h +++ b/utils/alsoft-config/mainwindow.h @@ -46,6 +46,8 @@ private slots: void selectSolarisPlayback(); + void selectWaveOutput(); + private: Ui::MainWindow *ui; diff --git a/utils/alsoft-config/mainwindow.ui b/utils/alsoft-config/mainwindow.ui index 5adfc89c..28540a73 100644 --- a/utils/alsoft-config/mainwindow.ui +++ b/utils/alsoft-config/mainwindow.ui @@ -797,6 +797,11 @@ application or system to determine if it should be used. Solaris + + + Wave Writer + + @@ -1175,6 +1180,73 @@ during updates. + + + + + 10 + 30 + 71 + 21 + + + + Output File: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 90 + 30 + 221 + 21 + + + + + + + 0 + 90 + 421 + 71 + + + + <html><head/><body><p align="center"><span style=" font-style:italic;">Warning: The specified output file will be OVERWRITTEN WITHOUT</span></p><p align="center"><span style=" font-style:italic;">QUESTION when the Wave Writer device is opened.</span></p></body></html> + + + + + + 320 + 30 + 91 + 22 + + + + Browse... + + + + + + 120 + 60 + 191 + 21 + + + + Create .amb (B-Format) files + + + -- 2.11.4.GIT