connect(ui->me_live, &GLWidget::transition_names_updated, this, &MainWindow::set_transition_names);
qRegisterMetaType<Mixer::Output>("Mixer::Output");
+ // Hook up the prev/next buttons on the audio views.
+ connect(ui->compact_prev_page, &QAbstractButton::clicked, bind(&QStackedWidget::setCurrentIndex, ui->audio_views, 1));
+ connect(ui->compact_next_page, &QAbstractButton::clicked, bind(&QStackedWidget::setCurrentIndex, ui->audio_views, 1));
+ connect(ui->full_prev_page, &QAbstractButton::clicked, bind(&QStackedWidget::setCurrentIndex, ui->audio_views, 0));
+ connect(ui->full_next_page, &QAbstractButton::clicked, bind(&QStackedWidget::setCurrentIndex, ui->audio_views, 0));
+
last_audio_level_callback = steady_clock::now() - seconds(1);
}
// TODO: Set the fader position.
ui->faders->addWidget(channel);
- connect(ui_audio_miniview->fader, &QAbstractSlider::valueChanged,
+ connect(ui_audio_miniview->fader, &NonLinearFader::dbValueChanged,
bind(&MainWindow::mini_fader_changed, this, ui_audio_miniview, bus_index, _1));
}
}
QString::fromStdString(format_db(threshold_dbfs, DB_WITH_SIGN)));
}
-void MainWindow::mini_fader_changed(Ui::AudioMiniView *ui, int channel, int value)
+void MainWindow::mini_fader_changed(Ui::AudioMiniView *ui, int channel, double volume_db)
{
- float volume_db = value * 0.1f;
-
char buf[256];
- snprintf(buf, sizeof(buf), "%+.1f dB", volume_db);
- ui->fader_label->setText(buf);
+ if (isfinite(volume_db)) {
+ snprintf(buf, sizeof(buf), "%+.1f dB", volume_db);
+ ui->fader_label->setText(buf);
+ } else {
+ ui->fader_label->setText("-∞ dB");
+ }
global_mixer->get_audio_mixer()->set_fader_volume(channel, volume_db);
}
// Space between the M/E displays and the audio strip.
remaining_height -= ui->vertical_layout->spacing();
+ // The label above the audio strip.
+ double compact_label_height = ui->compact_label->geometry().height() +
+ ui->compact_audio_layout->spacing();
+ remaining_height -= compact_label_height;
+
// The previews will be constrained by the remaining height, and the width.
double preview_label_height = previews[0]->title_bar->geometry().height() +
previews[0]->main_vertical_layout->spacing();
remaining_height -= preview_height + preview_label_height + ui->vertical_layout->spacing();
ui->vertical_layout->setStretch(0, lrintf(me_height));
- ui->vertical_layout->setStretch(1, lrintf(remaining_height)); // Audio strip.
- ui->vertical_layout->setStretch(2, lrintf(preview_height + preview_label_height));
+ ui->vertical_layout->setStretch(1,
+ lrintf(compact_label_height) +
+ lrintf(remaining_height) +
+ lrintf(preview_height + preview_label_height)); // Audio strip and previews together.
+
+ ui->compact_audio_layout->setStretch(0, lrintf(compact_label_height));
+ ui->compact_audio_layout->setStretch(1, lrintf(remaining_height)); // Audio strip.
+ ui->compact_audio_layout->setStretch(2, lrintf(preview_height + preview_label_height));
// Set the widths for the previews.
double preview_width = preview_height * 16.0 / 9.0;