]> git.sesse.net Git - nageru/commitdiff
Add quick-cut keys (Q, W, E, etc.) below the preview keys.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 20 Oct 2017 22:29:12 +0000 (00:29 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 20 Oct 2017 22:29:12 +0000 (00:29 +0200)
mainwindow.cpp
mainwindow.h

index b7510debe560f0d7d3c4079e6d4063a1c8d40168..eb7fb54a769d9f30022ef581fe82efc77ffc3b85 100644 (file)
@@ -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;
index 13cbedd1bd2bfa1a0e87b3d6178cbf608842ef22..beb4eed75c61fe0bb6260793c58d1b5eaae52a5a 100644 (file)
@@ -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<std::string> transition_names);
        void update_channel_name(Mixer::Output output, const std::string &name);