+ cutoff_knob_changed(ui->locut_cutoff_knob->value());
+
+ // Not QDial::valueChanged, as we call setValue() all the time.
+ connect(ui->gainstaging_knob, &QAbstractSlider::sliderMoved, this, &MainWindow::gain_staging_knob_changed);
+ connect(ui->gainstaging_auto_checkbox, &QCheckBox::stateChanged, [this](int state){
+ global_mixer->set_gain_staging_auto(state == Qt::Checked);
+ });
+ connect(ui->makeup_gain_knob, &QAbstractSlider::sliderMoved, this, &MainWindow::final_makeup_gain_knob_changed);
+ connect(ui->makeup_gain_auto_checkbox, &QCheckBox::stateChanged, [this](int state){
+ global_mixer->set_final_makeup_gain_auto(state == Qt::Checked);
+ });
+
+ connect(ui->limiter_threshold_knob, &QDial::valueChanged, this, &MainWindow::limiter_threshold_knob_changed);
+ connect(ui->compressor_threshold_knob, &QDial::valueChanged, this, &MainWindow::compressor_threshold_knob_changed);
+ connect(ui->limiter_enabled, &QCheckBox::stateChanged, [this](int state){
+ global_mixer->set_limiter_enabled(state == Qt::Checked);
+ });
+ connect(ui->compressor_enabled, &QCheckBox::stateChanged, [this](int state){
+ global_mixer->set_compressor_enabled(state == Qt::Checked);
+ });
+ 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, _7));
+}
+
+void MainWindow::mixer_shutting_down()
+{
+ ui->me_live->clean_context();
+ ui->me_preview->clean_context();
+ for (Ui::Display *display : previews) {
+ display->display->clean_context();
+ }
+}
+
+void MainWindow::cut_triggered()
+{
+ global_mixer->schedule_cut();
+}
+
+void MainWindow::exit_triggered()
+{
+ close();
+}
+
+void MainWindow::about_triggered()
+{
+ AboutDialog().exec();
+}
+
+void MainWindow::gain_staging_knob_changed(int value)
+{
+ ui->gainstaging_auto_checkbox->setCheckState(Qt::Unchecked);
+
+ float gain_db = value * 0.1f;
+ global_mixer->set_gain_staging_db(gain_db);
+
+ // The label will be updated by the audio level callback.
+}
+
+void MainWindow::final_makeup_gain_knob_changed(int value)
+{
+ ui->makeup_gain_auto_checkbox->setCheckState(Qt::Unchecked);
+
+ float gain_db = value * 0.1f;
+ global_mixer->set_final_makeup_gain_db(gain_db);
+
+ // The label will be updated by the audio level callback.