]> git.sesse.net Git - nageru/blobdiff - mainwindow.cpp
Hook up the reset meters button.
[nageru] / mainwindow.cpp
index 7ec6f0c311077ea613ce3663f3d7da045e362fff..854eb08663176a4a1e1a1fcf627e48d30c2edf98 100644 (file)
@@ -93,6 +93,7 @@ void MainWindow::mixer_created(Mixer *mixer)
        }
 
        connect(ui->locut_cutoff_knob, &QDial::valueChanged, this, &MainWindow::cutoff_knob_changed);
+       connect(ui->reset_meters_button, &QPushButton::clicked, this, &MainWindow::reset_meters_button_clicked);
        mixer->set_audio_level_callback(bind(&MainWindow::audio_level_callback, this, _1, _2, _3, _4, _5, _6));
 }
 
@@ -107,6 +108,13 @@ void MainWindow::cutoff_knob_changed(int value)
        ui->locut_cutoff_display->setText(buf);
 }
 
+void MainWindow::reset_meters_button_clicked()
+{
+       global_mixer->reset_meters();
+       ui->peak_display->setText("-inf");
+       ui->peak_display->setStyleSheet("");
+}
+
 void MainWindow::audio_level_callback(float level_lufs, float peak_db, float global_level_lufs, float range_low_lufs, float range_high_lufs, float auto_gain_staging_db)
 {
        post_to_main_thread([=]() {