diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-01-10 00:07:47 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-01-10 00:07:47 +0000 |
| commit | 67a414dc3826761c8933640e85560644f5f02310 (patch) | |
| tree | 6fc3ab11423d5fdd15847890be56bb98ed241852 /src/font.cc | |
| parent | 9fc6bcde891567ca04fe2d9835ab48a17c9b69a7 (diff) | |
Fix handling of timing in SMPTE subtitles.
Diffstat (limited to 'src/font.cc')
| -rw-r--r-- | src/font.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/font.cc b/src/font.cc index 99f49f90..8656e909 100644 --- a/src/font.cc +++ b/src/font.cc @@ -23,6 +23,7 @@ #include "xml.h" #include "text.h" #include <libcxml/cxml.h> +#include <boost/foreach.hpp> using std::string; using std::list; @@ -30,7 +31,7 @@ using boost::shared_ptr; using boost::optional; using namespace dcp; -Font::Font (boost::shared_ptr<const cxml::Node> node) +Font::Font (cxml::ConstNodePtr node, int tcr) { text = node->content (); @@ -49,9 +50,21 @@ Font::Font (boost::shared_ptr<const cxml::Node> node) if (c) { effect_colour = Colour (c.get ()); } - subtitle_nodes = type_children<Subtitle> (node, "Subtitle"); - font_nodes = type_children<Font> (node, "Font"); - text_nodes = type_children<Text> (node, "Text"); + + list<cxml::NodePtr> s = node->node_children ("Subtitle"); + BOOST_FOREACH (cxml::NodePtr& i, s) { + subtitle_nodes.push_back (shared_ptr<Subtitle> (new Subtitle (i, tcr))); + } + + list<cxml::NodePtr> f = node->node_children ("Font"); + BOOST_FOREACH (cxml::NodePtr& i, f) { + font_nodes.push_back (shared_ptr<Font> (new Font (i, tcr))); + } + + list<cxml::NodePtr> t = node->node_children ("Text"); + BOOST_FOREACH (cxml::NodePtr& i, t) { + text_nodes.push_back (shared_ptr<Text> (new Text (i, tcr))); + } } Font::Font (std::list<boost::shared_ptr<Font> > const & font_nodes) |
