Add Atmos read/write and untested MXF decryption tool.
[libdcp.git] / src / interop_subtitle_asset.cc
index b0b9499540d58f6a62ca4ace99ca7661d05759c7..9951122285b17d51b00808b61e0f54e26d247c9a 100644 (file)
@@ -35,7 +35,6 @@
 #include "interop_load_font_node.h"
 #include "xml.h"
 #include "raw_convert.h"
-#include "font_node.h"
 #include "util.h"
 #include "font_asset.h"
 #include "dcp_assert.h"
@@ -66,17 +65,16 @@ InteropSubtitleAsset::InteropSubtitleAsset (boost::filesystem::path file)
        _movie_title = xml->string_child ("MovieTitle");
        _load_font_nodes = type_children<dcp::InteropLoadFontNode> (xml, "LoadFont");
 
-       list<shared_ptr<dcp::FontNode> > font_nodes;
-       BOOST_FOREACH (cxml::NodePtr const & i, xml->node_children ("Font")) {
-               font_nodes.push_back (shared_ptr<FontNode> (new FontNode (i, optional<int>(), INTEROP)));
-       }
+       /* Now we need to drop down to xmlpp */
 
-       list<shared_ptr<dcp::SubtitleNode> > subtitle_nodes;
-       BOOST_FOREACH (cxml::NodePtr const & i, xml->node_children ("Subtitle")) {
-               subtitle_nodes.push_back (shared_ptr<SubtitleNode> (new SubtitleNode (i, optional<int>(), INTEROP)));
+       list<ParseState> ps;
+       xmlpp::Node::NodeList c = xml->node()->get_children ();
+       for (xmlpp::Node::NodeList::const_iterator i = c.begin(); i != c.end(); ++i) {
+               xmlpp::Element const * e = dynamic_cast<xmlpp::Element const *> (*i);
+               if (e && (e->get_name() == "Font" || e->get_name() == "Subtitle")) {
+                       parse_subtitles (e, ps, optional<int>(), INTEROP);
+               }
        }
-
-       parse_subtitles (xml, font_nodes, subtitle_nodes);
 }
 
 InteropSubtitleAsset::InteropSubtitleAsset ()
@@ -204,8 +202,8 @@ InteropSubtitleAsset::resolve_fonts (list<shared_ptr<Asset> > assets)
                }
 
                BOOST_FOREACH (shared_ptr<InteropLoadFontNode> j, _load_font_nodes) {
-                       if (j->uri == font->file().leaf().string ()) {
-                               _fonts.push_back (Font (j->id, i->id(), font->file ()));
+                       if (font->file() && j->uri == font->file()->leaf().string ()) {
+                               _fonts.push_back (Font (j->id, i->id(), font->file().get()));
                        }
                }
        }