add info header to pptl
This commit is contained in:
@@ -2317,6 +2317,12 @@ bool Canvas::project_save_thread(std::string file_path, bool show_progress)
|
|||||||
{
|
{
|
||||||
BinaryStreamWriter sw;
|
BinaryStreamWriter sw;
|
||||||
sw.init(BinaryStream::ByteOrder::LittleEndian);
|
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;
|
sw << *Canvas::I->m_encoder;
|
||||||
if (!sw.save(lapse_path))
|
if (!sw.save(lapse_path))
|
||||||
LOG("cannot save timelase to %s", lapse_path.c_str());
|
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;
|
BinaryStreamReader sr;
|
||||||
sr.load(lapse_path, BinaryStream::ByteOrder::LittleEndian);
|
sr.load(lapse_path, BinaryStream::ByteOrder::LittleEndian);
|
||||||
m_encoder = std::make_unique<MP4Encoder>();
|
Serializer::Descriptor info;
|
||||||
sr >> *m_encoder;
|
sr >> info;
|
||||||
m_encoder->init();
|
if (info.value<Serializer::Boolean>("has-track-360"))
|
||||||
|
{
|
||||||
|
m_encoder = std::make_unique<MP4Encoder>();
|
||||||
|
sr >> *m_encoder;
|
||||||
|
m_encoder->init();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user