]> git.sesse.net Git - nageru/commitdiff
If doing preview or queue with the in or out column marked, reuse the current one.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 25 Sep 2018 22:02:51 +0000 (00:02 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 25 Sep 2018 22:02:51 +0000 (00:02 +0200)
jpeg_frame_view.h
mainwindow.cpp

index 585417279ca8ebcfbbed1263abcdcfb6d3f7bbc3..8b2c93c8d5dbe245b19c4d80d38f108e2247e1c6 100644 (file)
@@ -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<movit::EffectChain> chain;
        std::shared_ptr<Frame> current_frame;  // So that we hold on to the pixels.
index c16861102ce4dada625002a8337ec82219ae2c62..8377c74d4320d4ec27ace875334cba8710dcdac0 100644 (file)
@@ -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)