From 71d927333f15c2c43ec0f1974c819cd277386dfa Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 2 Mar 2016 12:08:22 -0800 Subject: [PATCH] Add OSS and Solaris config pages --- utils/alsoft-config/mainwindow.cpp | 48 +++++++++++++ utils/alsoft-config/mainwindow.h | 5 ++ utils/alsoft-config/mainwindow.ui | 140 +++++++++++++++++++++++++++++++++++++ 3 files changed, 193 insertions(+) diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp index 1fd6f81e..1a7c7fef 100644 --- a/utils/alsoft-config/mainwindow.cpp +++ b/utils/alsoft-config/mainwindow.cpp @@ -317,6 +317,14 @@ MainWindow::MainWindow(QWidget *parent) : connect(ui->alsaResamplerCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->alsaMmapCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); + connect(ui->ossDefaultDeviceLine, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(ui->ossPlaybackPushButton, SIGNAL(pressed()), this, SLOT(selectOSSPlayback())); + connect(ui->ossDefaultCaptureLine, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(ui->ossCapturePushButton, SIGNAL(pressed()), this, SLOT(selectOSSCapture())); + + connect(ui->solarisDefaultDeviceLine, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(ui->solarisPlaybackPushButton, SIGNAL(pressed()), this, SLOT(selectSolarisPlayback())); + ui->backendListWidget->setCurrentRow(0); ui->tabWidget->setCurrentIndex(0); @@ -694,6 +702,11 @@ void MainWindow::loadConfig(const QString &fname) ui->alsaResamplerCheckBox->setChecked(settings.value("alsa/allow-resampler", false).toBool()); ui->alsaMmapCheckBox->setChecked(settings.value("alsa/mmap", true).toBool()); + ui->ossDefaultDeviceLine->setText(settings.value("oss/device", QString()).toString()); + ui->ossDefaultCaptureLine->setText(settings.value("oss/capture", QString()).toString()); + + ui->solarisDefaultDeviceLine->setText(settings.value("solaris/device", QString()).toString()); + ui->applyButton->setEnabled(false); ui->closeCancelButton->setText(tr("Close")); mNeedsSave = false; @@ -906,6 +919,11 @@ void MainWindow::saveConfig(const QString &fname) const ui->alsaMmapCheckBox->isChecked() ? QString(/*"true"*/) : QString("false") ); + settings.setValue("oss/device", ui->ossDefaultDeviceLine->text()); + settings.setValue("oss/capture", ui->ossDefaultCaptureLine->text()); + + settings.setValue("solaris/device", ui->solarisDefaultDeviceLine->text()); + /* Remove empty keys * FIXME: Should only remove keys whose value matches the globally-specified value. */ @@ -1079,3 +1097,33 @@ void MainWindow::showDisabledBackendMenu(QPoint pt) enableApplyButton(); } } + +void MainWindow::selectOSSPlayback() +{ + QString fname = QFileDialog::getOpenFileName(this, tr("Select Playback Device")); + if(!fname.isEmpty()) + { + ui->ossDefaultDeviceLine->setText(fname); + enableApplyButton(); + } +} + +void MainWindow::selectOSSCapture() +{ + QString fname = QFileDialog::getOpenFileName(this, tr("Select Capture Device")); + if(!fname.isEmpty()) + { + ui->ossDefaultCaptureLine->setText(fname); + enableApplyButton(); + } +} + +void MainWindow::selectSolarisPlayback() +{ + QString fname = QFileDialog::getOpenFileName(this, tr("Select Playback Device")); + if(!fname.isEmpty()) + { + ui->solarisDefaultDeviceLine->setText(fname); + enableApplyButton(); + } +} diff --git a/utils/alsoft-config/mainwindow.h b/utils/alsoft-config/mainwindow.h index 69c2fda4..78285dfa 100644 --- a/utils/alsoft-config/mainwindow.h +++ b/utils/alsoft-config/mainwindow.h @@ -41,6 +41,11 @@ private slots: void showEnabledBackendMenu(QPoint pt); void showDisabledBackendMenu(QPoint pt); + void selectOSSPlayback(); + void selectOSSCapture(); + + void selectSolarisPlayback(); + private: Ui::MainWindow *ui; diff --git a/utils/alsoft-config/mainwindow.ui b/utils/alsoft-config/mainwindow.ui index 8eb3162c..5adfc89c 100644 --- a/utils/alsoft-config/mainwindow.ui +++ b/utils/alsoft-config/mainwindow.ui @@ -787,6 +787,16 @@ application or system to determine if it should be used. ALSA + + + OSS + + + + + Solaris + + @@ -1035,6 +1045,136 @@ during updates. + + + + + 10 + 30 + 141 + 21 + + + + Default Playback Device: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 160 + 30 + 151 + 21 + + + + /dev/dsp + + + + + + 10 + 60 + 141 + 21 + + + + Default Capture Device: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 160 + 60 + 151 + 21 + + + + /dev/dsp + + + + + + 320 + 30 + 91 + 22 + + + + Browse... + + + + + + 320 + 60 + 91 + 22 + + + + Browse... + + + + + + + + 160 + 30 + 151 + 21 + + + + /dev/audio + + + + + + 10 + 30 + 141 + 21 + + + + Default Playback Device: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 320 + 30 + 91 + 22 + + + + Browse... + + + -- 2.11.4.GIT