Add support for bs2b

Improve headphone listening of stereo audio records
This commit is contained in:
Jonas Kvinge
2022-03-05 01:30:49 +01:00
parent 4cd0128919
commit 5a35099043
7 changed files with 71 additions and 14 deletions

View File

@@ -164,6 +164,8 @@ void BackendSettingsPage::Load() {
ui_->spinbox_channels->setValue(s.value("channels", 2).toInt());
ui_->widget_channels->setEnabled(ui_->checkbox_channels->isChecked());
ui_->checkbox_bs2b->setChecked(s.value("bs2b", false).toBool());
ui_->spinbox_bufferduration->setValue(s.value("bufferduration", kDefaultBufferDuration).toInt());
ui_->spinbox_low_watermark->setValue(s.value("bufferlowwatermark", kDefaultBufferLowWatermark).toDouble());
ui_->spinbox_high_watermark->setValue(s.value("bufferhighwatermark", kDefaultBufferHighWatermark).toDouble());
@@ -460,6 +462,20 @@ void BackendSettingsPage::Save() {
s.setValue("output", output_name);
s.setValue("device", device_value);
#ifdef HAVE_ALSA
if (ui_->radiobutton_alsa_hw->isChecked()) s.setValue("alsaplugin", static_cast<int>(alsa_plugin::alsa_hw));
else if (ui_->radiobutton_alsa_plughw->isChecked()) s.setValue("alsaplugin", static_cast<int>(alsa_plugin::alsa_plughw));
else if (ui_->radiobutton_alsa_pcm->isChecked()) s.setValue("alsaplugin", static_cast<int>(alsa_plugin::alsa_pcm));
else s.remove("alsaplugin");
#endif
s.setValue("volume_control", ui_->checkbox_volume_control->isChecked());
s.setValue("channels_enabled", ui_->checkbox_channels->isChecked());
s.setValue("channels", ui_->spinbox_channels->value());
s.setValue("bs2b", ui_->checkbox_bs2b->isChecked());
s.setValue("bufferduration", ui_->spinbox_bufferduration->value());
s.setValue("bufferlowwatermark", ui_->spinbox_low_watermark->value());
s.setValue("bufferhighwatermark", ui_->spinbox_high_watermark->value());
@@ -478,18 +494,6 @@ void BackendSettingsPage::Save() {
s.setValue("FadeoutDuration", ui_->spinbox_fadeduration->value());
s.setValue("FadeoutPauseDuration", ui_->spinbox_fadeduration_pauseresume->value());
#ifdef HAVE_ALSA
if (ui_->radiobutton_alsa_hw->isChecked()) s.setValue("alsaplugin", static_cast<int>(alsa_plugin::alsa_hw));
else if (ui_->radiobutton_alsa_plughw->isChecked()) s.setValue("alsaplugin", static_cast<int>(alsa_plugin::alsa_plughw));
else if (ui_->radiobutton_alsa_pcm->isChecked()) s.setValue("alsaplugin", static_cast<int>(alsa_plugin::alsa_pcm));
else s.remove("alsaplugin");
#endif
s.setValue("volume_control", ui_->checkbox_volume_control->isChecked());
s.setValue("channels_enabled", ui_->checkbox_channels->isChecked());
s.setValue("channels", ui_->spinbox_channels->value());
s.endGroup();
}