- player.set_done_callback([&done_promise, &clip_idx, &clips] {
- if (clip_idx >= clips.size()) {
- done_promise.set_value();
- }
- });
- player.set_next_clip_callback([&clip_idx, &clips]() -> pair<Clip, int> {
- if (++clip_idx >= clips.size()) {
- return make_pair(Clip(), -1);
- } else {
- return make_pair(clips[clip_idx], clip_idx);
- }