X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=futatabi%2Fexport.cpp;h=a865ac6e9369331a3806ef430c70c82b12d33392;hb=36ae902913f91a6e4d3d6a1f5d16a0ab1b92c3ae;hp=5481007c79f055ec3c7a2835cda01008a369793f;hpb=e64a84bb856263242278afa9770ae5d05e21b055;p=nageru diff --git a/futatabi/export.cpp b/futatabi/export.cpp index 5481007..a865ac6 100644 --- a/futatabi/export.cpp +++ b/futatabi/export.cpp @@ -223,11 +223,11 @@ void export_interpolated_clip(const string &filename, const vector &clips) progress.setMaximum(100000); progress.setValue(0); - vector clips_with_row; + vector clips_with_id; for (const Clip &clip : clips) { - clips_with_row.emplace_back(Player::ClipWithRow{ clip, 0 }); + clips_with_id.emplace_back(ClipWithID{ clip, 0 }); } - double total_length = compute_total_time(clips_with_row); + TimeRemaining total_length = compute_total_time(clips_with_id); promise done_promise; future done = done_promise.get_future(); @@ -237,10 +237,10 @@ void export_interpolated_clip(const string &filename, const vector &clips) player.set_done_callback([&done_promise] { done_promise.set_value(); }); - player.set_progress_callback([¤t_value, &clips, total_length](const std::map &player_progress, double time_remaining) { - current_value = 1.0 - time_remaining / total_length; + player.set_progress_callback([¤t_value, total_length](const std::map &player_progress, TimeRemaining time_remaining) { + current_value = 1.0 - time_remaining.t / total_length.t; // Nothing to do about the infinite clips. }); - player.play(clips_with_row); + player.play(clips_with_id); while (done.wait_for(std::chrono::milliseconds(100)) != future_status::ready && !progress.wasCanceled()) { progress.setValue(lrint(100000.0 * current_value)); }