}
}
-pair<Clip, size_t> 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<pair<Clip, size_t>> clip_promise;
- future<pair<Clip, size_t>> 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)
{
int t_ms = lrint(t * 1e3);
void play_clicked();
void stop_clicked();
void live_player_clip_done();
- std::pair<Clip, size_t> live_player_get_next_clip();
void live_player_clip_progress(const std::map<size_t, double> &progress, double time_remaining);
void set_output_status(const std::string &status);
void playlist_duplicate();