Add a Wave Writer backend config page

This commit is contained in:
Chris Robinson 2016-03-02 15:31:14 -08:00
parent 71d927333f
commit 773e2846e7
3 changed files with 98 additions and 0 deletions

View File

@ -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();
}
}

View File

@ -46,6 +46,8 @@ private slots:
void selectSolarisPlayback();
void selectWaveOutput();
private:
Ui::MainWindow *ui;

View File

@ -797,6 +797,11 @@ application or system to determine if it should be used.</string>
<string>Solaris</string>
</property>
</item>
<item>
<property name="text">
<string>Wave Writer</string>
</property>
</item>
</widget>
<widget class="QStackedWidget" name="backendStackedWidget">
<property name="geometry">
@ -1175,6 +1180,73 @@ during updates.</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="page_6">
<widget class="QLabel" name="label_23">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>71</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Output File:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLineEdit" name="waveOutputLine">
<property name="geometry">
<rect>
<x>90</x>
<y>30</y>
<width>221</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QLabel" name="label_24">
<property name="geometry">
<rect>
<x>0</x>
<y>90</y>
<width>421</width>
<height>71</height>
</rect>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;Warning: The specified output file will be OVERWRITTEN WITHOUT&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-style:italic;&quot;&gt;QUESTION when the Wave Writer device is opened.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
<widget class="QPushButton" name="waveOutputButton">
<property name="geometry">
<rect>
<x>320</x>
<y>30</y>
<width>91</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>Browse...</string>
</property>
</widget>
<widget class="QCheckBox" name="waveBFormatCheckBox">
<property name="geometry">
<rect>
<x>120</x>
<y>60</y>
<width>191</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Create .amb (B-Format) files</string>
</property>
</widget>
</widget>
</widget>
</widget>
<widget class="QWidget" name="tab_2">