From 81f7693bfaaeb76c8868faa7df835c336dac4002 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 11 Jun 2018 23:03:31 +0200 Subject: [PATCH] Support playing back arbitrary camera angles. --- mainwindow.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index bbeeef9..1a5953d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -51,5 +51,16 @@ MainWindow::MainWindow() void MainWindow::preview_clicked() { - play_clip(*clips->back(), 0); + QItemSelectionModel *selected = ui->clip_list->selectionModel(); + if (!selected->hasSelection()) { + play_clip(*clips->back(), 0); + return; + } + + QModelIndex index = selected->currentIndex(); + if (index.column() >= ClipList::Column::CAMERA_1 && + index.column() <= ClipList::Column::CAMERA_4) { + unsigned stream_idx = index.column() - ClipList::Column::CAMERA_1; + play_clip(*clips->clip(index.row()), stream_idx); + } } -- 2.39.2