From 9e3a1942a39efedf685c74f49763f917ca404269 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 28 Feb 2016 09:27:52 -0800 Subject: [PATCH] Add an ALSA backend tab --- utils/alsoft-config/mainwindow.cpp | 27 ++++++++++ utils/alsoft-config/mainwindow.ui | 107 ++++++++++++++++++++++++++++++++++++- 2 files changed, 133 insertions(+), 1 deletion(-) diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp index 127350f1..44302e53 100644 --- a/utils/alsoft-config/mainwindow.cpp +++ b/utils/alsoft-config/mainwindow.cpp @@ -310,6 +310,11 @@ MainWindow::MainWindow(QWidget *parent) : connect(ui->pulseAllowMovesCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); connect(ui->pulseFixRateCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); + connect(ui->alsaDefaultDeviceLine, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(ui->alsaDefaultCaptureLine, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); + connect(ui->alsaResamplerCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); + connect(ui->alsaMmapCheckBox, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton())); + ui->backendListWidget->setCurrentRow(0); ui->tabWidget->setCurrentIndex(0); @@ -672,6 +677,11 @@ void MainWindow::loadConfig(const QString &fname) ui->pulseAllowMovesCheckBox->setChecked(settings.value("pulse/allow-moves", false).toBool()); ui->pulseFixRateCheckBox->setChecked(settings.value("pulse/fix-rate", false).toBool()); + ui->alsaDefaultDeviceLine->setText(settings.value("alsa/device", QString()).toString()); + ui->alsaDefaultCaptureLine->setText(settings.value("alsa/capture", QString()).toString()); + ui->alsaResamplerCheckBox->setChecked(settings.value("alsa/allow-resampler", false).toBool()); + ui->alsaMmapCheckBox->setChecked(settings.value("alsa/mmap", true).toBool()); + ui->applyButton->setEnabled(false); ui->closeCancelButton->setText(tr("Close")); mNeedsSave = false; @@ -881,6 +891,23 @@ void MainWindow::saveConfig(const QString &fname) const settings.setValue("pulse/fix-rate", "true"); else settings.remove("pulse/fix-rate"/*, "false"*/); + + str = ui->alsaDefaultDeviceLine->text(); + if(str.isEmpty()) settings.remove("alsa/device"); + else settings.setValue("alsa/device", str); + + str = ui->alsaDefaultCaptureLine->text(); + if(str.isEmpty()) settings.remove("alsa/capture"); + else settings.setValue("alsa/capture", str); + + if(ui->alsaResamplerCheckBox->isChecked()) + settings.setValue("alsa/allow-resampler", "true"); + else + settings.remove("alsa/allow-resampler"); + if(ui->alsaMmapCheckBox->isChecked()) + settings.remove("alsa/mmap"); + else + settings.setValue("alsa/mmap", "false"); } diff --git a/utils/alsoft-config/mainwindow.ui b/utils/alsoft-config/mainwindow.ui index 888546ce..3c6629f0 100644 --- a/utils/alsoft-config/mainwindow.ui +++ b/utils/alsoft-config/mainwindow.ui @@ -734,13 +734,18 @@ application or system to determine if it should be used. PulseAudio + + + ALSA + + 110 10 - 411 + 421 361 @@ -882,6 +887,106 @@ rate to match the PulseAudio device. + + + + + 10 + 30 + 141 + 21 + + + + Default Playback Device: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 160 + 30 + 231 + 21 + + + + default + + + + + + 10 + 60 + 141 + 21 + + + + Default Capture Device: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 160 + 60 + 231 + 21 + + + + default + + + + + + 20 + 100 + 191 + 21 + + + + Allow use of ALSA's software resampler. This lets +the OpenAL device to be set to a different sample +rate than the backend device, but incurs another +resample pass on top of OpenAL's resampler. + + + Allow Resampler + + + + + + 210 + 100 + 191 + 21 + + + + Accesses the audio device buffer through an mmap, +potentially avoiding an extra sample buffer copy +during updates. + + + MMap Buffer + + + true + + + -- 2.11.4.GIT