]> git.sesse.net Git - nageru/blobdiff - futatabi/mainwindow.cpp
Show preview display when using cue in or cue out, not just on scrubbing.
[nageru] / futatabi / mainwindow.cpp
index dfc2ea5b2ec5514158d4f11bad9d684574ed1342..9885232eb1f4ea3e60d244ef0c4d1272151e00cb 100644 (file)
@@ -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));
@@ -437,6 +445,9 @@ void MainWindow::queue_clicked()
        } else {
                clip.stream_idx = ui->preview_display->get_stream_idx();
        }
+       if (clip.pts_out == -1) {
+               clip.pts_out = clip.pts_in + int64_t(TIMEBASE) * 86400 * 7;  // One week; effectively infinite, but without overflow issues.
+       }
 
        playlist_clips->add_clip(clip);
        playlist_selection_changed();