X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=futatabi%2Fmainwindow.cpp;h=22b8d9cda553bd51ce56db7da295dfb35132524a;hb=b3a7a9eddd8b800f1b921332e8fdacb72e0d9b20;hp=bbaa5a417ab8c9c636d76f324f3b396e7ef236b4;hpb=4d7015171fbd6c36c480d1d7992b76bbb45410c5;p=nageru diff --git a/futatabi/mainwindow.cpp b/futatabi/mainwindow.cpp index bbaa5a4..22b8d9c 100644 --- a/futatabi/mainwindow.cpp +++ b/futatabi/mainwindow.cpp @@ -516,31 +516,11 @@ void MainWindow::live_player_clip_done() set_output_status("paused"); playlist_clips->set_progress({}); playlist_clips->set_currently_playing(-1, 0.0f); + ui->stop_btn->setEnabled(false); } else { playlist_clips->set_progress({ { row + 1, 0.0f } }); playlist_clips->set_currently_playing(row + 1, 0.0f); } - ui->stop_btn->setEnabled(false); -} - -pair MainWindow::live_player_get_next_clip() -{ - // playlist_clips can only be accessed on the main thread. - // Hopefully, we won't have to wait too long for this to come back. - // - // TODO: If MainWindow is in the process of being destroyed and waiting - // for Player to shut down, we could have a deadlock here. - promise> clip_promise; - future> clip = clip_promise.get_future(); - post_to_main_thread([&clip_promise] { - int row = playlist_clips->get_currently_playing(); - if (row != -1 && row < int(playlist_clips->size()) - 1) { - clip_promise.set_value(make_pair(*playlist_clips->clip(row + 1), row + 1)); - } else { - clip_promise.set_value(make_pair(Clip(), 0)); - } - }); - return clip.get(); } static string format_duration(double t)