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, 2));
- 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, 2));
- connect(ui->video_grid_prev_page, &QAbstractButton::clicked, bind(&QStackedWidget::setCurrentIndex, ui->audio_views, 1));
- connect(ui->video_grid_next_page, &QAbstractButton::clicked, bind(&QStackedWidget::setCurrentIndex, ui->audio_views, 0));
-
- // And bind the same to PgUp/PgDown.
auto prev_page = [this]{
if (global_audio_mixer->get_mapping_mode() == AudioMixer::MappingMode::MULTICHANNEL) {
ui->audio_views->setCurrentIndex((ui->audio_views->currentIndex() + 2) % 3);
+ } else {
+ ui->audio_views->setCurrentIndex(2 - ui->audio_views->currentIndex()); // Switch between 0 and 2.
}
};
auto next_page = [this]{
if (global_audio_mixer->get_mapping_mode() == AudioMixer::MappingMode::MULTICHANNEL) {
ui->audio_views->setCurrentIndex((ui->audio_views->currentIndex() + 1) % 3);
+ } else {
+ ui->audio_views->setCurrentIndex(2 - ui->audio_views->currentIndex()); // Switch between 0 and 2.
}
};
+ connect(ui->compact_prev_page, &QAbstractButton::clicked, prev_page);
+ connect(ui->compact_next_page, &QAbstractButton::clicked, next_page);
+ connect(ui->full_prev_page, &QAbstractButton::clicked, prev_page);
+ connect(ui->full_next_page, &QAbstractButton::clicked, next_page);
+ connect(ui->video_grid_prev_page, &QAbstractButton::clicked, prev_page);
+ connect(ui->video_grid_next_page, &QAbstractButton::clicked, next_page);
+
+ // And bind the same to PgUp/PgDown.
connect(new QShortcut(QKeySequence::MoveToNextPage, this), &QShortcut::activated, next_page);
connect(new QShortcut(QKeySequence::MoveToPreviousPage, this), &QShortcut::activated, prev_page);
analyzer.reset(new Analyzer);
+ global_mixer->set_theme_menu_callback(bind(&MainWindow::setup_theme_menu, this));
+ setup_theme_menu();
+
struct sigaction act;
memset(&act, 0, sizeof(act));
act.sa_handler = schedule_cut_signal;
setup_audio_expanded_view();
if (simple) {
- ui->audio_views->setCurrentIndex(0);
+ ui->compact_label->setText("Compact audio view (1/2) ");
+ ui->video_grid_label->setText("Video grid display (2/2) ");
+ if (ui->audio_views->currentIndex() == 1) {
+ // Full audio view is not available in simple mode.
+ ui->audio_views->setCurrentIndex(0);
+ }
+ } else {
+ ui->compact_label->setText("Compact audio view (1/3) ");
+ ui->full_label->setText("Full audio view (2/3) ");
+ ui->video_grid_label->setText("Video grid display (3/3) ");
}
- ui->compact_header->setVisible(!simple);
midi_mapper.refresh_highlights();
midi_mapper.refresh_lights();
}
}
+void MainWindow::setup_theme_menu()
+{
+ std::vector<Theme::MenuEntry> theme_menu_entries = global_mixer->get_theme_menu();
+
+ if (theme_menu != nullptr) {
+ ui->menuBar->removeAction(theme_menu->menuAction());
+ theme_menu = nullptr;
+ }
+
+ if (!theme_menu_entries.empty()) {
+ theme_menu = new QMenu("&Theme");
+ for (const Theme::MenuEntry &entry : theme_menu_entries) {
+ QAction *action = theme_menu->addAction(QString::fromStdString(entry.text));
+ connect(action, &QAction::triggered, [entry] {
+ global_mixer->theme_menu_entry_clicked(entry.lua_ref);
+ });
+ }
+ ui->menuBar->insertMenu(ui->menu_Help->menuAction(), theme_menu);
+ }
+}
+
void MainWindow::limiter_threshold_knob_changed(int value)
{
float threshold_dbfs = value * 0.1f;