Add an ALSA backend tab

This commit is contained in:
Chris Robinson 2016-02-28 09:27:52 -08:00
parent 11acbfebf7
commit 9e3a1942a3
2 changed files with 133 additions and 1 deletions

View File

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

View File

@ -734,13 +734,18 @@ application or system to determine if it should be used.</string>
<string>PulseAudio</string>
</property>
</item>
<item>
<property name="text">
<string>ALSA</string>
</property>
</item>
</widget>
<widget class="QStackedWidget" name="backendStackedWidget">
<property name="geometry">
<rect>
<x>110</x>
<y>10</y>
<width>411</width>
<width>421</width>
<height>361</height>
</rect>
</property>
@ -882,6 +887,106 @@ rate to match the PulseAudio device.</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="page_3">
<widget class="QLabel" name="label_17">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>141</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Default Playback Device:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLineEdit" name="alsaDefaultDeviceLine">
<property name="geometry">
<rect>
<x>160</x>
<y>30</y>
<width>231</width>
<height>21</height>
</rect>
</property>
<property name="placeholderText">
<string>default</string>
</property>
</widget>
<widget class="QLabel" name="label_18">
<property name="geometry">
<rect>
<x>10</x>
<y>60</y>
<width>141</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Default Capture Device:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLineEdit" name="alsaDefaultCaptureLine">
<property name="geometry">
<rect>
<x>160</x>
<y>60</y>
<width>231</width>
<height>21</height>
</rect>
</property>
<property name="placeholderText">
<string>default</string>
</property>
</widget>
<widget class="QCheckBox" name="alsaResamplerCheckBox">
<property name="geometry">
<rect>
<x>20</x>
<y>100</y>
<width>191</width>
<height>21</height>
</rect>
</property>
<property name="toolTip">
<string>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.</string>
</property>
<property name="text">
<string>Allow Resampler</string>
</property>
</widget>
<widget class="QCheckBox" name="alsaMmapCheckBox">
<property name="geometry">
<rect>
<x>210</x>
<y>100</y>
<width>191</width>
<height>21</height>
</rect>
</property>
<property name="toolTip">
<string>Accesses the audio device buffer through an mmap,
potentially avoiding an extra sample buffer copy
during updates.</string>
</property>
<property name="text">
<string>MMap Buffer</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</widget>
</widget>
</widget>
<widget class="QWidget" name="tab_2">