add info header to pptl

This commit is contained in:
2019-11-17 17:20:49 +01:00
parent ff73e98a2e
commit 0901138019

View File

@@ -2317,6 +2317,12 @@ bool Canvas::project_save_thread(std::string file_path, bool show_progress)
{
BinaryStreamWriter sw;
sw.init(BinaryStream::ByteOrder::LittleEndian);
Serializer::Descriptor info;
info.class_id = "tracks-info";
info.name = L"Timelapse Tracks";
info.props["has-track-360"] = std::make_shared<Serializer::Boolean>(true);
info.props["version"] = std::make_shared<Serializer::Integer>(1);
sw << info;
sw << *Canvas::I->m_encoder;
if (!sw.save(lapse_path))
LOG("cannot save timelase to %s", lapse_path.c_str());
@@ -2524,9 +2530,14 @@ bool Canvas::project_open_thread(std::string file_path)
{
BinaryStreamReader sr;
sr.load(lapse_path, BinaryStream::ByteOrder::LittleEndian);
m_encoder = std::make_unique<MP4Encoder>();
sr >> *m_encoder;
m_encoder->init();
Serializer::Descriptor info;
sr >> info;
if (info.value<Serializer::Boolean>("has-track-360"))
{
m_encoder = std::make_unique<MP4Encoder>();
sr >> *m_encoder;
m_encoder->init();
}
}
else
{