]> git.sesse.net Git - nageru/commitdiff
Fix an issue where cutoff would not be properly marked when setting new mappings.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 29 Aug 2016 18:26:16 +0000 (20:26 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 19 Oct 2016 22:55:44 +0000 (00:55 +0200)
audio_mixer.h
mainwindow.cpp
mainwindow.h

index 1e25f52f32ef6b62e10e3d60e1de1a8cedf3fc72..34e7dc075a1d614073b1a5c430f1f9bccf3e49ee 100644 (file)
@@ -108,6 +108,11 @@ public:
                locut_cutoff_hz = cutoff_hz;
        }
 
+       float get_locut_cutoff() const
+       {
+               return locut_cutoff_hz;
+       }
+
        void set_locut_enabled(unsigned bus, bool enabled)
        {
                locut_enabled[bus] = enabled;
index ea742f701dc40cef3c37685c670cb8e046b59194..f59824cabd053364246c22558df64147ed5991a8 100644 (file)
@@ -421,6 +421,8 @@ void MainWindow::setup_audio_expanded_view()
                reduction_meter->set_ref_level(0.0f);
                reduction_meter->set_flip(true);
        }
+
+       update_cutoff_labels(global_mixer->get_audio_mixer()->get_locut_cutoff());
 }
 
 void MainWindow::mixer_shutting_down()
@@ -495,7 +497,11 @@ void MainWindow::cutoff_knob_changed(int value)
        float octaves = value * 0.1f;
        float cutoff_hz = 20.0 * pow(2.0, octaves);
        global_mixer->get_audio_mixer()->set_locut_cutoff(cutoff_hz);
+       update_cutoff_labels(cutoff_hz);
+}
 
+void MainWindow::update_cutoff_labels(float cutoff_hz)
+{
        char buf[256];
        snprintf(buf, sizeof(buf), "%ld Hz", lrintf(cutoff_hz));
        ui->locut_cutoff_display->setText(buf);
index 4c9d0b886bcb08523503dc61f06e85d242d6c81d..09fc887598d27c937a7d56a4042f75e880a0fdb0 100644 (file)
@@ -62,6 +62,7 @@ private:
        void setup_audio_expanded_view();
        bool eventFilter(QObject *watched, QEvent *event) override;
        void set_white_balance(int channel_number, int x, int y);
+       void update_cutoff_labels(float cutoff_hz);
        void update_eq_label(unsigned bus_index, EQBand band, float gain_db);
 
        // Called from DiskSpaceEstimator.