From: Steinar H. Gunderson Date: Fri, 20 Oct 2017 22:29:12 +0000 (+0200) Subject: Add quick-cut keys (Q, W, E, etc.) below the preview keys. X-Git-Tag: 1.6.3~8 X-Git-Url: https://git.sesse.net/?p=nageru;a=commitdiff_plain;h=dad4af8aab1e98176e2cc54f1d614ef9d64fc8ad Add quick-cut keys (Q, W, E, etc.) below the preview keys. --- diff --git a/mainwindow.cpp b/mainwindow.cpp index b7510de..eb7fb54 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -282,6 +282,7 @@ void MainWindow::mixer_created(Mixer *mixer) // Make the previews. unsigned num_previews = mixer->get_num_channels(); + const char qwerty[] = "QWERTYUIOP"; for (unsigned i = 0; i < num_previews; ++i) { Mixer::Output output = Mixer::Output(Mixer::OUTPUT_INPUT0 + i); @@ -304,6 +305,12 @@ void MainWindow::mixer_created(Mixer *mixer) QShortcut *shortcut = new QShortcut(QKeySequence(Qt::Key_1 + i), this); connect(shortcut, &QShortcut::activated, bind(&MainWindow::channel_clicked, this, i)); + // Hook up the quick-cut key. + if (i < strlen(qwerty)) { + QShortcut *shortcut = new QShortcut(QKeySequence(qwerty[i]), this); + connect(shortcut, &QShortcut::activated, bind(&MainWindow::quick_cut_activated, this, i)); + } + // Hook up the white balance button (irrelevant if invisible). ui_display->wb_button->setVisible(mixer->get_supports_set_wb(output)); connect(ui_display->wb_button, &QPushButton::clicked, bind(&MainWindow::wb_button_clicked, this, i)); @@ -1281,6 +1288,12 @@ void MainWindow::channel_clicked(int channel_number) } } +void MainWindow::quick_cut_activated(int channel_number) +{ + global_mixer->channel_clicked(channel_number); + global_mixer->transition_clicked(0); +} + void MainWindow::wb_button_clicked(int channel_number) { current_wb_pick_display = channel_number; diff --git a/mainwindow.h b/mainwindow.h index 13cbedd..beb4eed 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -57,6 +57,7 @@ public slots: void timecode_stdout_triggered(); void transition_clicked(int transition_number); void channel_clicked(int channel_number); + void quick_cut_activated(int channel_number); void wb_button_clicked(int channel_number); void set_transition_names(std::vector transition_names); void update_channel_name(Mixer::Output output, const std::string &name);