From 61116d03f84a53e96445c2b5d8686f2ea7e7c855 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 20 Sep 2016 23:50:34 +0200 Subject: [PATCH] Actually set the fader positions when making the views for each audio bus. --- audio_mixer.h | 1 + mainwindow.cpp | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/audio_mixer.h b/audio_mixer.h index 3a1334a..faa0cc5 100644 --- a/audio_mixer.h +++ b/audio_mixer.h @@ -63,6 +63,7 @@ public: std::vector get_output(double pts, unsigned num_samples, ResamplingQueue::RateAdjustmentPolicy rate_adjustment_policy); + float get_fader_volume(unsigned bus_index) const { return fader_volume_db[bus_index]; } void set_fader_volume(unsigned bus_index, float level_db) { fader_volume_db[bus_index] = level_db; } // Note: This operation holds all ALSA devices (see ALSAPool::get_devices()). diff --git a/mainwindow.cpp b/mainwindow.cpp index 0fad15a..3245fdd 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -339,7 +339,8 @@ void MainWindow::setup_audio_miniview() peak_meter->set_max_level(0.0f); peak_meter->set_ref_level(0.0f); - // TODO: Set the fader position. + ui_audio_miniview->fader->setDbValue(global_audio_mixer->get_fader_volume(bus_index)); + ui->faders->addWidget(channel); connect(ui_audio_miniview->fader, &NonLinearFader::dbValueChanged, @@ -373,7 +374,7 @@ void MainWindow::setup_audio_expanded_view() update_eq_label(bus_index, EQ_BAND_TREBLE, global_audio_mixer->get_eq(bus_index, EQ_BAND_TREBLE)); update_eq_label(bus_index, EQ_BAND_MID, global_audio_mixer->get_eq(bus_index, EQ_BAND_MID)); update_eq_label(bus_index, EQ_BAND_BASS, global_audio_mixer->get_eq(bus_index, EQ_BAND_BASS)); - // TODO: Set the fader position. + ui_audio_expanded_view->fader->setDbValue(global_audio_mixer->get_fader_volume(bus_index)); ui->buses->addWidget(channel); ui_audio_expanded_view->locut_enabled->setChecked(global_audio_mixer->get_locut_enabled(bus_index)); -- 2.39.2