Add direction support for SMPTE subtitles; fix pragma warnings with non-openmp builds.
[libdcp.git] / src / text_node.cc
index 666e58460c52970e4576efcafd2054305686792e..7618c460da7d42e3810692e43e86d76f99cc0796 100644 (file)
@@ -37,11 +37,12 @@ using namespace dcp;
  *  in this object's member variables.
  *  @param node Node to read.
  */
-TextNode::TextNode (boost::shared_ptr<const cxml::Node> node, int tcr)
+TextNode::TextNode (boost::shared_ptr<const cxml::Node> node, int tcr, string font_id_attribute)
        : h_position (0)
        , h_align (HALIGN_CENTER)
        , v_position (0)
        , v_align (VALIGN_CENTER)
+       , direction (DIRECTION_LTR)
 {
        text = node->content ();
 
@@ -77,8 +78,13 @@ TextNode::TextNode (boost::shared_ptr<const cxml::Node> node, int tcr)
                v_align = string_to_valign (va.get ());
        }
 
+       optional<string> d = node->optional_string_attribute ("Direction");
+       if (d) {
+               direction = string_to_direction (d.get ());
+       }
+
        list<cxml::NodePtr> f = node->node_children ("Font");
        BOOST_FOREACH (cxml::NodePtr& i, f) {
-               font_nodes.push_back (shared_ptr<FontNode> (new FontNode (i, tcr)));
+               font_nodes.push_back (shared_ptr<FontNode> (new FontNode (i, tcr, font_id_attribute)));
        }
 }