From: Steinar H. Gunderson Date: Tue, 25 Sep 2018 22:02:51 +0000 (+0200) Subject: If doing preview or queue with the in or out column marked, reuse the current one. X-Git-Tag: 1.8.0~76^2~92 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=4254221b8923fb72b877703d8ede6c2b316b9bbf;p=nageru If doing preview or queue with the in or out column marked, reuse the current one. --- diff --git a/jpeg_frame_view.h b/jpeg_frame_view.h index 5854172..8b2c93c 100644 --- a/jpeg_frame_view.h +++ b/jpeg_frame_view.h @@ -58,7 +58,7 @@ protected: private: // The stream index of the latest frame we displayed. - unsigned current_stream_idx; + unsigned current_stream_idx = 0; std::unique_ptr chain; std::shared_ptr current_frame; // So that we hold on to the pixels. diff --git a/mainwindow.cpp b/mainwindow.cpp index c168611..8377c74 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -150,13 +150,16 @@ void MainWindow::queue_clicked() } QModelIndex index = selected->currentIndex(); + Clip clip = *cliplist_clips->clip(index.row()); if (index.column() >= int(ClipList::Column::CAMERA_1) && index.column() <= int(ClipList::Column::CAMERA_4)) { - Clip clip = *cliplist_clips->clip(index.row()); clip.stream_idx = index.column() - int(ClipList::Column::CAMERA_1); - playlist_clips->add_clip(clip); - playlist_selection_changed(); + } else { + clip.stream_idx = ui->preview_display->get_stream_idx(); } + + playlist_clips->add_clip(clip); + playlist_selection_changed(); } void MainWindow::preview_clicked() @@ -170,11 +173,14 @@ void MainWindow::preview_clicked() } QModelIndex index = selected->currentIndex(); + unsigned stream_idx; if (index.column() >= int(ClipList::Column::CAMERA_1) && index.column() <= int(ClipList::Column::CAMERA_4)) { - unsigned stream_idx = index.column() - int(ClipList::Column::CAMERA_1); - preview_player->play_clip(*cliplist_clips->clip(index.row()), stream_idx); + stream_idx = index.column() - int(ClipList::Column::CAMERA_1); + } else { + stream_idx = ui->preview_display->get_stream_idx(); } + preview_player->play_clip(*cliplist_clips->clip(index.row()), stream_idx); } void MainWindow::preview_angle_clicked(unsigned stream_idx)