More c++ tidying.
[dcpomatic.git] / src / lib / atmos_content.cc
index c424f96d3e4b321cb71de6016d495264872fd12d..e69474e01807756763c7f24fa4890a7a97358e56 100644 (file)
 
 
 #include "atmos_content.h"
+#include "warnings.h"
 #include <dcp/raw_convert.h>
+DCPOMATIC_DISABLE_WARNINGS
 #include <libxml++/libxml++.h>
+DCPOMATIC_ENABLE_WARNINGS
 
 
 using std::string;
-using boost::shared_ptr;
+using std::shared_ptr;
 
 
 int const AtmosContentProperty::EDIT_RATE = 700;
@@ -42,14 +45,18 @@ AtmosContent::AtmosContent (Content* parent)
 AtmosContent::AtmosContent (Content* parent, cxml::ConstNodePtr node)
        : ContentPart (parent)
 {
-       _length = node->number_child<Frame>("Length");
-       _edit_rate = dcp::Fraction (node->string_child("EditRate"));
+       _length = node->number_child<Frame>("AtmosLength");
+       _edit_rate = dcp::Fraction (node->string_child("AtmosEditRate"));
 }
 
 
 shared_ptr<AtmosContent>
 AtmosContent::from_xml (Content* parent, cxml::ConstNodePtr node)
 {
+       if (!node->optional_node_child("AtmosLength")) {
+               return shared_ptr<AtmosContent>();
+       }
+
        return shared_ptr<AtmosContent> (new AtmosContent(parent, node));
 }
 
@@ -57,8 +64,8 @@ AtmosContent::from_xml (Content* parent, cxml::ConstNodePtr node)
 void
 AtmosContent::as_xml (xmlpp::Node* node) const
 {
-       node->add_child("Length")->add_child_text(dcp::raw_convert<string>(_length));
-       node->add_child("EditRate")->add_child_text(_edit_rate.as_string());
+       node->add_child("AtmosLength")->add_child_text(dcp::raw_convert<string>(_length));
+       node->add_child("AtmosEditRate")->add_child_text(_edit_rate.as_string());
 }