]> git.sesse.net Git - nageru/blobdiff - futatabi/mainwindow.cpp
Fix the previous fix for the infinite display; it was causing crashes and odd stuff...
[nageru] / futatabi / mainwindow.cpp
index 9bea809b8c63dc2ebe0ac840e9900a313402cd09..f55ad0e489083572e9d86fa80e0dd2f8c749d656 100644 (file)
@@ -289,7 +289,7 @@ MainWindow::MainWindow()
                if (!load_midi_mapping_from_file(global_flags.midi_mapping_filename, &midi_mapping)) {
                        fprintf(stderr, "Couldn't load MIDI mapping '%s'; exiting.\n",
                                global_flags.midi_mapping_filename.c_str());
-                       exit(1);
+                       abort();
                }
                midi_mapper.set_midi_mapping(midi_mapping);
        }
@@ -388,6 +388,10 @@ void MainWindow::cue_in_clicked()
                playlist_selection_changed();
        }
 
+       // Show the clip in the preview.
+       unsigned stream_idx = ui->preview_display->get_stream_idx();
+       preview_single_frame(cliplist_clips->mutable_back()->pts_in, stream_idx, FIRST_AT_OR_AFTER);
+
        // Select the item so that we can jog it.
        ui->clip_list->setFocus();
        QModelIndex index = cliplist_clips->index(cliplist_clips->size() - 1, int(ClipList::Column::IN));
@@ -404,6 +408,10 @@ void MainWindow::cue_out_clicked()
 
        cliplist_clips->mutable_back()->pts_out = current_pts + lrint(global_flags.cue_out_point_padding_seconds * TIMEBASE);
 
+       // Show the clip in the preview. (TODO: This won't take padding into account.)
+       unsigned stream_idx = ui->preview_display->get_stream_idx();
+       preview_single_frame(cliplist_clips->mutable_back()->pts_out, stream_idx, LAST_BEFORE);
+
        // Select the item so that we can jog it.
        ui->clip_list->setFocus();
        QModelIndex index = cliplist_clips->index(cliplist_clips->size() - 1, int(ClipList::Column::OUT));
@@ -844,6 +852,11 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event)
                if (mouse->modifiers() & Qt::KeyboardModifier::ShiftModifier) {
                        scrub_sensitivity *= 10;
                        wheel_sensitivity *= 10;
+                       if (mouse->modifiers() & Qt::KeyboardModifier::ControlModifier) {
+                               // Ctrl+Shift is a super-modifier, meant only for things like “go back two hours”.
+                               scrub_sensitivity *= 100;
+                               wheel_sensitivity *= 100;
+                       }
                }
                if (mouse->modifiers() & Qt::KeyboardModifier::AltModifier) {  // Note: Shift + Alt cancel each other out.
                        scrub_sensitivity /= 10;
@@ -899,6 +912,11 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event)
                if (wheel->modifiers() & Qt::KeyboardModifier::ShiftModifier) {
                        scrub_sensitivity *= 10;
                        wheel_sensitivity *= 10;
+                       if (wheel->modifiers() & Qt::KeyboardModifier::ControlModifier) {
+                               // Ctrl+Shift is a super-modifier, meant only for things like “go back two hours”.
+                               scrub_sensitivity *= 100;
+                               wheel_sensitivity *= 100;
+                       }
                }
                if (wheel->modifiers() & Qt::KeyboardModifier::AltModifier) {  // Note: Shift + Alt cancel each other out.
                        scrub_sensitivity /= 10;