summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/interop_subtitle_asset.cc8
-rw-r--r--src/smpte_subtitle_asset.cc8
-rw-r--r--src/subtitle_asset.cc7
-rw-r--r--src/subtitle_asset.h7
4 files changed, 26 insertions, 4 deletions
diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc
index 5777c31a..f450d360 100644
--- a/src/interop_subtitle_asset.cc
+++ b/src/interop_subtitle_asset.cc
@@ -58,7 +58,13 @@ InteropSubtitleAsset::InteropSubtitleAsset (boost::filesystem::path file)
font_nodes.push_back (shared_ptr<FontNode> (new FontNode (i, 250, "Id")));
}
- parse_subtitles (xml, font_nodes);
+ f = xml->node_children ("Subtitle");
+ list<shared_ptr<dcp::SubtitleNode> > subtitle_nodes;
+ BOOST_FOREACH (cxml::NodePtr& i, f) {
+ subtitle_nodes.push_back (shared_ptr<SubtitleNode> (new SubtitleNode (i, 250, "Id")));
+ }
+
+ parse_subtitles (xml, font_nodes, subtitle_nodes);
}
InteropSubtitleAsset::InteropSubtitleAsset ()
diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc
index 070ade73..165e88e3 100644
--- a/src/smpte_subtitle_asset.cc
+++ b/src/smpte_subtitle_asset.cc
@@ -124,7 +124,13 @@ SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file)
font_nodes.push_back (shared_ptr<FontNode> (new FontNode (i, _time_code_rate, "ID")));
}
- parse_subtitles (xml, font_nodes);
+ f = subtitle_list->node_children ("Subtitle");
+ list<shared_ptr<dcp::SubtitleNode> > subtitle_nodes;
+ BOOST_FOREACH (cxml::NodePtr& i, f) {
+ subtitle_nodes.push_back (shared_ptr<SubtitleNode> (new SubtitleNode (i, _time_code_rate, "ID")));
+ }
+
+ parse_subtitles (xml, font_nodes, subtitle_nodes);
if (reader) {
ASDCP::TimedText::TimedTextDescriptor descriptor;
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc
index 414825a4..3dcc9ad6 100644
--- a/src/subtitle_asset.cc
+++ b/src/subtitle_asset.cc
@@ -59,11 +59,16 @@ SubtitleAsset::SubtitleAsset (boost::filesystem::path file)
}
void
-SubtitleAsset::parse_subtitles (shared_ptr<cxml::Document> xml, list<shared_ptr<dcp::FontNode> > font_nodes)
+SubtitleAsset::parse_subtitles (
+ shared_ptr<cxml::Document> xml,
+ list<shared_ptr<dcp::FontNode> > font_nodes,
+ list<shared_ptr<dcp::SubtitleNode> > subtitle_nodes
+ )
{
/* Make Subtitle objects to represent the raw XML nodes in a sane way */
ParseState parse_state;
examine_font_nodes (xml, font_nodes, parse_state);
+ examine_subtitle_nodes (xml, subtitle_nodes, parse_state);
}
void
diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h
index 8532d6a3..ebd6b745 100644
--- a/src/subtitle_asset.h
+++ b/src/subtitle_asset.h
@@ -84,7 +84,12 @@ protected:
friend struct ::interop_dcp_font_test;
friend struct ::smpte_dcp_font_test;
- void parse_subtitles (boost::shared_ptr<cxml::Document> xml, std::list<boost::shared_ptr<FontNode> > font_nodes);
+ void parse_subtitles (
+ boost::shared_ptr<cxml::Document> xml,
+ std::list<boost::shared_ptr<FontNode> > font_nodes,
+ std::list<boost::shared_ptr<SubtitleNode> > subtitle_nodes
+ );
+
void subtitles_as_xml (xmlpp::Element* root, int time_code_rate, Standard standard) const;
/** All our subtitles, in no particular order */