connect(new QShortcut(QKeySequence::MoveToNextPage, this), &QShortcut::activated, switch_page);
connect(new QShortcut(QKeySequence::MoveToPreviousPage, this), &QShortcut::activated, switch_page);
+ if (global_flags.enable_quick_cut_keys) {
+ ui->quick_cut_enable_action->setChecked(true);
+ }
+ connect(ui->quick_cut_enable_action, &QAction::changed, [this](){
+ global_flags.enable_quick_cut_keys = ui->quick_cut_enable_action->isChecked();
+ });
+
last_audio_level_callback = steady_clock::now() - seconds(1);
if (!global_flags.midi_mapping_filename.empty()) {
// 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);
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));
}
}
+void MainWindow::quick_cut_activated(int channel_number)
+{
+ if (!global_flags.enable_quick_cut_keys) {
+ return;
+ }
+ 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;