]> 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 05ea5821a090451bf79fe8f8f80255d7e7e462c4..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));