X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fatmos_content.cc;h=22bd431a22fe9e7102de2b67cadab94516d24dbe;hb=6d95d9689831a74fade32038a808f206c03d8aa2;hp=c424f96d3e4b321cb71de6016d495264872fd12d;hpb=ca981c8cfa23111e92be329f1c2dfbe3a07b4247;p=dcpomatic.git diff --git a/src/lib/atmos_content.cc b/src/lib/atmos_content.cc index c424f96d3..22bd431a2 100644 --- a/src/lib/atmos_content.cc +++ b/src/lib/atmos_content.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2020 Carl Hetherington + Copyright (C) 2020-2021 Carl Hetherington This file is part of DCP-o-matic. @@ -21,11 +21,15 @@ #include "atmos_content.h" #include +#include +LIBDCP_DISABLE_WARNINGS #include +LIBDCP_ENABLE_WARNINGS +using std::make_shared; using std::string; -using boost::shared_ptr; +using std::shared_ptr; int const AtmosContentProperty::EDIT_RATE = 700; @@ -42,23 +46,27 @@ AtmosContent::AtmosContent (Content* parent) AtmosContent::AtmosContent (Content* parent, cxml::ConstNodePtr node) : ContentPart (parent) { - _length = node->number_child("Length"); - _edit_rate = dcp::Fraction (node->string_child("EditRate")); + _length = node->number_child("AtmosLength"); + _edit_rate = dcp::Fraction (node->string_child("AtmosEditRate")); } shared_ptr AtmosContent::from_xml (Content* parent, cxml::ConstNodePtr node) { - return shared_ptr (new AtmosContent(parent, node)); + if (!node->optional_node_child("AtmosLength")) { + return {}; + } + + return make_shared(parent, node); } void -AtmosContent::as_xml (xmlpp::Node* node) const +AtmosContent::as_xml(xmlpp::Element* element) const { - node->add_child("Length")->add_child_text(dcp::raw_convert(_length)); - node->add_child("EditRate")->add_child_text(_edit_rate.as_string()); + cxml::add_text_child(element, "AtmosLength", dcp::raw_convert(_length)); + cxml::add_text_child(element, "AtmosEditRate", _edit_rate.as_string()); }