From: Steinar H. Gunderson Date: Wed, 31 Oct 2018 22:02:21 +0000 (+0100) Subject: Allow previewing playlist clips. X-Git-Tag: 1.8.0~76^2~18 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=22b4e6bf1e9d397f4393175f83ab71b4c2b061e7;p=nageru Allow previewing playlist clips. --- diff --git a/mainwindow.cpp b/mainwindow.cpp index ee300c5..13a9bd5 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -199,6 +199,17 @@ void MainWindow::queue_clicked() void MainWindow::preview_clicked() { + if (ui->playlist->hasFocus()) { + // Allow the playlist as preview iff it has focus and something is selected. + QItemSelectionModel *selected = ui->playlist->selectionModel(); + if (selected->hasSelection()) { + QModelIndex index = selected->currentIndex(); + const Clip &clip = *playlist_clips->clip(index.row()); + preview_player->play_clip(clip, index.row(), clip.stream_idx); + return; + } + } + if (cliplist_clips->empty()) return;