From: Steinar H. Gunderson Date: Mon, 11 Jun 2018 21:03:31 +0000 (+0200) Subject: Support playing back arbitrary camera angles. X-Git-Tag: 1.8.0~76^2~282 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=81f7693bfaaeb76c8868faa7df835c336dac4002;p=nageru Support playing back arbitrary camera angles. --- 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); + } }