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));
update_eq_label(bus_index, EQ_BAND_MID, global_audio_mixer->get_eq(bus_index, EQ_BAND_MID));
update_eq_label(bus_index, EQ_BAND_BASS, global_audio_mixer->get_eq(bus_index, EQ_BAND_BASS));
ui_audio_expanded_view->fader->setDbValue(global_audio_mixer->get_fader_volume(bus_index));
- ui_audio_expanded_view->mute_button->setChecked(global_audio_mixer->get_mute(bus_index) ? Qt::Checked : Qt::Unchecked);
+ ui_audio_expanded_view->mute_button->setChecked(global_audio_mixer->get_mute(bus_index));
connect(ui_audio_expanded_view->mute_button, &QPushButton::toggled,
bind(&MainWindow::mute_button_toggled, this, bus_index, _1));
ui->buses->addWidget(channel);
unsigned channel = output - Mixer::OUTPUT_INPUT0;
previews[channel]->label->setText(name.c_str());
}
+
+ analyzer->update_channel_name(output, name);
}
void MainWindow::update_channel_color(Mixer::Output output, const string &color)
}
}
+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;
void MainWindow::closeEvent(QCloseEvent *event)
{
+ if (global_mixer->get_num_connected_clients() > 0) {
+ QMessageBox::StandardButton reply =
+ QMessageBox::question(this, "Nageru", "There are clients connected. Do you really want to quit?",
+ QMessageBox::Yes | QMessageBox::No);
+ if (reply != QMessageBox::Yes) {
+ event->ignore();
+ return;
+ }
+ }
+
analyzer->hide();
event->accept();
}