Centralize legacy video export bridge
This commit is contained in:
@@ -566,19 +566,28 @@ void App::dialog_timelapse_export()
|
||||
|
||||
pick_file_save("mp4", target.value().name,
|
||||
[this](std::string path) {
|
||||
rec_export(path);
|
||||
const auto status = pp::panopainter::execute_legacy_document_video_export(
|
||||
*this,
|
||||
pp::app::DocumentVideoExportKind::timelapse,
|
||||
path,
|
||||
false);
|
||||
if (!status.ok())
|
||||
LOG("Document timelapse export failed: %s", status.message);
|
||||
},
|
||||
[this](const std::string& path, bool saved) {
|
||||
message_box("Export Timelapse", "Timelapse exported successfully.");
|
||||
[](const std::string& path, bool saved) {
|
||||
(void)path;
|
||||
(void)saved;
|
||||
}
|
||||
);
|
||||
#else
|
||||
pick_file_save({ "mp4" }, [this](std::string path) {
|
||||
std::thread([this, path] {
|
||||
BT_SetTerminate();
|
||||
rec_export(path);
|
||||
message_box("Export Timelapse", "Timelapse exported to: " + path);
|
||||
}).detach();
|
||||
const auto status = pp::panopainter::execute_legacy_document_video_export(
|
||||
*this,
|
||||
pp::app::DocumentVideoExportKind::timelapse,
|
||||
path,
|
||||
true);
|
||||
if (!status.ok())
|
||||
LOG("Document timelapse export failed: %s", status.message);
|
||||
});
|
||||
#endif
|
||||
}
|
||||
@@ -597,17 +606,28 @@ void App::dialog_export_mp4()
|
||||
|
||||
pick_file_save("mp4", target.value().name,
|
||||
[this](std::string path) {
|
||||
export_anim_mp4(path);
|
||||
const auto status = pp::panopainter::execute_legacy_document_video_export(
|
||||
*this,
|
||||
pp::app::DocumentVideoExportKind::animation_mp4,
|
||||
path,
|
||||
false);
|
||||
if (!status.ok())
|
||||
LOG("Document animation export failed: %s", status.message);
|
||||
},
|
||||
[this](const std::string& path, bool saved) {
|
||||
message_box("Export Animation", "Animation exported successfully.");
|
||||
[](const std::string& path, bool saved) {
|
||||
(void)path;
|
||||
(void)saved;
|
||||
}
|
||||
);
|
||||
#else
|
||||
pick_file_save({ "mp4" }, [this](std::string path) {
|
||||
Canvas::I->export_anim_mp4(path, [this, path] {
|
||||
message_box("Export Animation", "Animation exported to: " + path);
|
||||
});
|
||||
const auto status = pp::panopainter::execute_legacy_document_video_export(
|
||||
*this,
|
||||
pp::app::DocumentVideoExportKind::animation_mp4,
|
||||
path,
|
||||
true);
|
||||
if (!status.ok())
|
||||
LOG("Document animation export failed: %s", status.message);
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user