From 8db504e0abc3d6b5d64f2fc790c4f751c5e0e778 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 22 Aug 2016 01:03:47 +0200 Subject: [PATCH] Add some pagination to the main window. This allows us to switch between compact and full audio layout. The full audio layout is not really populated yet; there are only some widgets (a subset of the compact ones), and they are not hooked up. --- mainwindow.cpp | 21 +- ui_mainwindow.ui | 1104 +++++++++++++++++++++++++++++++--------------- 2 files changed, 762 insertions(+), 363 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 3f9873f..e0db1b6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -133,6 +133,12 @@ MainWindow::MainWindow() connect(ui->me_live, &GLWidget::transition_names_updated, this, &MainWindow::set_transition_names); qRegisterMetaType("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); } @@ -469,6 +475,11 @@ void MainWindow::relayout() // 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(); @@ -477,8 +488,14 @@ void MainWindow::relayout() 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; diff --git a/ui_mainwindow.ui b/ui_mainwindow.ui index 3a55b88..256390a 100644 --- a/ui_mainwindow.ui +++ b/ui_mainwindow.ui @@ -25,7 +25,7 @@ - + @@ -520,383 +520,765 @@ - - - 6 - - + + 0 - - - - QLayout::SetFixedSize + + + + 0 - - - - - - Qt::Horizontal + + 0 - - - 40 - 20 - + + 0 - - - - 0 - - - - -0.0 dB - - - Qt::AlignCenter - - - - - - - Enabled - - - true - - - - - - - Enabled - - - true - - - - - - - -0.0 dB - - - Qt::AlignCenter - - - - - - - -14.0 dB - - - Qt::AlignCenter - - - - - - - 120 Hz - - - Qt::AlignCenter - - - - - - - Enabled - - - true - - - - - - - -26.0 dB - - - Qt::AlignCenter - - - - - - - - 64 - 64 - - - - - 16777215 - 64 - - - - -300 - - - 300 - - - 60.000000000000000 - - - true - - - - - - - - 64 - 64 - - - - - 16777215 - 64 - - - - -400 - - + + + 0 - - -260 - - - 30.000000000000000 - - - true - - - - - - - Auto - - - true - - - - - - - Auto - - - true - - + + + + Compact audio view + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + + 15 + 15 + + + + ... + + + true + + + Qt::LeftArrow + + + + + + + + 15 + 15 + + + + ... + + + true + + + Qt::RightArrow + + + + - - - - - 64 - 64 - - - - - 16777215 - 64 - - - - -400 + + + + 6 - + 0 - - -140 - - - 30.000000000000000 - - - true - - - - - - - Makeup gain - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 64 - 64 - - - - - 16777215 - 64 - - - - 60 - - - 26 - - - - - - - - 64 - 64 - - - - - 16777215 - 64 - - - - -300 - - - 300 - - - 60.000000000000000 - - - true - - - - - - - Limiter threshold - - - Qt::AlignCenter - - - - - - - Compr. threshold - - - - - - - Gain staging - - - Qt::AlignCenter - - + + + + QLayout::SetFixedSize + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 0 + + + + + + 64 + 64 + + + + + 16777215 + 64 + + + + -400 + + + 0 + + + -260 + + + 30.000000000000000 + + + true + + + + + + + Auto + + + true + + + + + + + Compr. threshold + + + + + + + Gain staging + + + Qt::AlignCenter + + + + + + + -26.0 dB + + + Qt::AlignCenter + + + + + + + + 64 + 64 + + + + + 16777215 + 64 + + + + -300 + + + 300 + + + 60.000000000000000 + + + true + + + + + + + -0.0 dB + + + Qt::AlignCenter + + + + + + + -14.0 dB + + + Qt::AlignCenter + + + + + + + Enabled + + + true + + + + + + + Auto + + + true + + + + + + + + 64 + 64 + + + + + 16777215 + 64 + + + + -400 + + + 0 + + + -140 + + + 30.000000000000000 + + + true + + + + + + + 120 Hz + + + Qt::AlignCenter + + + + + + + Enabled + + + true + + + + + + + -0.0 dB + + + Qt::AlignCenter + + + + + + + Enabled + + + true + + + + + + + Lo-cut (24dB/oct) + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 64 + 64 + + + + + 16777215 + 64 + + + + -300 + + + 300 + + + 60.000000000000000 + + + true + + + + + + + Limiter threshold + + + Qt::AlignCenter + + + + + + + Makeup gain + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 64 + 64 + + + + + 16777215 + 64 + + + + 60 + + + 26 + + + + + + - - - - Lo-cut (24dB/oct) - - + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 0 + 40 + + + + + - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 40 - + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 0 - + + + + Full audio view + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + + 15 + 15 + + + + ... + + + true + + + Qt::LeftArrow + + + + + + + + 15 + 15 + + + + ... + + + true + + + Qt::RightArrow + + + + - - - - Qt::Vertical + + + + 6 - - - 20 - 40 - + + 0 - + + + + QLayout::SetFixedSize + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 0 + + + + + 120 Hz + + + Qt::AlignCenter + + + + + + + -0.0 dB + + + Qt::AlignCenter + + + + + + + -14.0 dB + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 64 + 64 + + + + + 16777215 + 64 + + + + 60 + + + 26 + + + + + + + Enabled + + + true + + + + + + + + 64 + 64 + + + + + 16777215 + 64 + + + + -400 + + + 0 + + + -140 + + + 30.000000000000000 + + + true + + + + + + + Auto + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Lo-cut (24dB/oct) + + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 20 + 40 + + + + + + + + + 64 + 64 + + + + + 16777215 + 64 + + + + -300 + + + 300 + + + 60.000000000000000 + + + true + + + + + + + Limiter threshold + + + Qt::AlignCenter + + + + + + + Makeup gain + + + Qt::AlignCenter + + + + + + - - - - - - - 0 - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 0 - 40 - - - - - + + @@ -963,17 +1345,17 @@ - - GLWidget - QWidget -
glwidget.h
-
VUMeter QWidget
vumeter.h
1
+ + GLWidget + QWidget +
glwidget.h
+
LRAMeter QWidget -- 2.39.2