+++ /dev/null
-/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "types.h"
-#include "raw_convert.h"
-#include "font.h"
-#include "xml.h"
-#include "text.h"
-#include <libcxml/cxml.h>
-#include <boost/foreach.hpp>
-
-using std::string;
-using std::list;
-using boost::shared_ptr;
-using boost::optional;
-using namespace dcp;
-
-Font::Font (cxml::ConstNodePtr node, int tcr)
-{
- text = node->content ();
-
- id = node->optional_string_attribute ("Id");
- size = node->optional_number_attribute<int64_t> ("Size").get_value_or (0);
- italic = node->optional_bool_attribute ("Italic");
- optional<string> c = node->optional_string_attribute ("Color");
- if (c) {
- colour = Colour (c.get ());
- }
- optional<string> const e = node->optional_string_attribute ("Effect");
- if (e) {
- effect = string_to_effect (e.get ());
- }
- c = node->optional_string_attribute ( "EffectColor");
- if (c) {
- effect_colour = Colour (c.get ());
- }
-
- 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)
- : size (0)
- , italic (false)
- , colour ("FFFFFFFF")
- , effect_colour ("FFFFFFFF")
-{
- for (list<shared_ptr<Font> >::const_iterator i = font_nodes.begin(); i != font_nodes.end(); ++i) {
- if ((*i)->id) {
- id = (*i)->id;
- }
- if ((*i)->size != 0) {
- size = (*i)->size;
- }
- if ((*i)->italic) {
- italic = (*i)->italic.get ();
- }
- if ((*i)->colour) {
- colour = (*i)->colour.get ();
- }
- if ((*i)->effect) {
- effect = (*i)->effect.get ();
- }
- if ((*i)->effect_colour) {
- effect_colour = (*i)->effect_colour.get ();
- }
- }
-}
+++ /dev/null
-/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-/** @file src/font.h
- * @brief Font class
- */
-
-#include "types.h"
-#include "subtitle.h"
-#include <libcxml/cxml.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/optional.hpp>
-#include <list>
-
-namespace dcp {
-
-/** @class Font
- * @brief Helper class for parsing subtitle XML.
- */
-class Font
-{
-public:
- Font ()
- : size (0)
- {}
-
- Font (cxml::ConstNodePtr node, int tcr);
- Font (std::list<boost::shared_ptr<Font> > const & font_nodes);
-
- std::string text;
- boost::optional<std::string> id;
- int size;
- boost::optional<bool> italic;
- boost::optional<Colour> colour;
- boost::optional<Effect> effect;
- boost::optional<Colour> effect_colour;
-
- std::list<boost::shared_ptr<Subtitle> > subtitle_nodes;
- std::list<boost::shared_ptr<Font> > font_nodes;
- std::list<boost::shared_ptr<Text> > text_nodes;
-};
-
-}
--- /dev/null
+/*
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "types.h"
+#include "raw_convert.h"
+#include "font_node.h"
+#include "xml.h"
+#include "text_node.h"
+#include <libcxml/cxml.h>
+#include <boost/foreach.hpp>
+
+using std::string;
+using std::list;
+using boost::shared_ptr;
+using boost::optional;
+using namespace dcp;
+
+FontNode::FontNode (cxml::ConstNodePtr node, int tcr)
+{
+ text = node->content ();
+
+ id = node->optional_string_attribute ("Id");
+ size = node->optional_number_attribute<int64_t> ("Size").get_value_or (0);
+ italic = node->optional_bool_attribute ("Italic");
+ optional<string> c = node->optional_string_attribute ("Color");
+ if (c) {
+ colour = Colour (c.get ());
+ }
+ optional<string> const e = node->optional_string_attribute ("Effect");
+ if (e) {
+ effect = string_to_effect (e.get ());
+ }
+ c = node->optional_string_attribute ( "EffectColor");
+ if (c) {
+ effect_colour = Colour (c.get ());
+ }
+
+ list<cxml::NodePtr> s = node->node_children ("Subtitle");
+ BOOST_FOREACH (cxml::NodePtr& i, s) {
+ subtitle_nodes.push_back (shared_ptr<SubtitleNode> (new SubtitleNode (i, tcr)));
+ }
+
+ 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)));
+ }
+
+ list<cxml::NodePtr> t = node->node_children ("Text");
+ BOOST_FOREACH (cxml::NodePtr& i, t) {
+ text_nodes.push_back (shared_ptr<TextNode> (new TextNode (i, tcr)));
+ }
+}
+
+FontNode::FontNode (std::list<boost::shared_ptr<FontNode> > const & font_nodes)
+ : size (0)
+ , italic (false)
+ , colour ("FFFFFFFF")
+ , effect_colour ("FFFFFFFF")
+{
+ for (list<shared_ptr<FontNode> >::const_iterator i = font_nodes.begin(); i != font_nodes.end(); ++i) {
+ if ((*i)->id) {
+ id = (*i)->id;
+ }
+ if ((*i)->size != 0) {
+ size = (*i)->size;
+ }
+ if ((*i)->italic) {
+ italic = (*i)->italic.get ();
+ }
+ if ((*i)->colour) {
+ colour = (*i)->colour.get ();
+ }
+ if ((*i)->effect) {
+ effect = (*i)->effect.get ();
+ }
+ if ((*i)->effect_colour) {
+ effect_colour = (*i)->effect_colour.get ();
+ }
+ }
+}
--- /dev/null
+/*
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+/** @file src/font_node.h
+ * @brief FontNode class
+ */
+
+#include "types.h"
+#include "subtitle_node.h"
+#include <libcxml/cxml.h>
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+#include <list>
+
+namespace dcp {
+
+/** @class Font
+ * @brief Helper class for parsing subtitle XML.
+ */
+class FontNode
+{
+public:
+ FontNode ()
+ : size (0)
+ {}
+
+ FontNode (cxml::ConstNodePtr node, int tcr);
+ FontNode (std::list<boost::shared_ptr<FontNode> > const & font_nodes);
+
+ std::string text;
+ boost::optional<std::string> id;
+ int size;
+ boost::optional<bool> italic;
+ boost::optional<Colour> colour;
+ boost::optional<Effect> effect;
+ boost::optional<Colour> effect_colour;
+
+ std::list<boost::shared_ptr<SubtitleNode> > subtitle_nodes;
+ std::list<boost::shared_ptr<FontNode> > font_nodes;
+ std::list<boost::shared_ptr<TextNode> > text_nodes;
+};
+
+}
+++ /dev/null
-/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "interop_load_font.h"
-#include <libcxml/cxml.h>
-
-using std::string;
-using boost::shared_ptr;
-using boost::optional;
-using namespace dcp;
-
-InteropLoadFont::InteropLoadFont (string id_, string uri_)
- : LoadFont (id_)
- , uri (uri_)
-{
-
-}
-
-InteropLoadFont::InteropLoadFont (cxml::ConstNodePtr node)
-{
- optional<string> x = node->optional_string_attribute ("Id");
- if (!x) {
- x = node->optional_string_attribute ("ID");
- }
- id = x.get_value_or ("");
-
- uri = node->string_attribute ("URI");
-}
-
-bool
-dcp::operator== (InteropLoadFont const & a, InteropLoadFont const & b)
-{
- return a.id == b.id && a.uri == b.uri;
-}
-
-bool
-dcp::operator!= (InteropLoadFont const & a, InteropLoadFont const & b)
-{
- return !(a == b);
-}
+++ /dev/null
-/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "load_font.h"
-#include <libcxml/cxml.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/optional.hpp>
-
-namespace dcp {
-
-class InteropLoadFont : public LoadFont
-{
-public:
- InteropLoadFont () {}
- InteropLoadFont (std::string id, std::string uri);
- InteropLoadFont (cxml::ConstNodePtr node);
-
- std::string uri;
-};
-
-bool operator== (InteropLoadFont const & a, InteropLoadFont const & b);
-bool operator!= (InteropLoadFont const & a, InteropLoadFont const & b);
-
-}
--- /dev/null
+/*
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "interop_load_font_node.h"
+#include <libcxml/cxml.h>
+
+using std::string;
+using boost::shared_ptr;
+using boost::optional;
+using namespace dcp;
+
+InteropLoadFontNode::InteropLoadFontNode (string id_, string uri_)
+ : LoadFontNode (id_)
+ , uri (uri_)
+{
+
+}
+
+InteropLoadFontNode::InteropLoadFontNode (cxml::ConstNodePtr node)
+{
+ optional<string> x = node->optional_string_attribute ("Id");
+ if (!x) {
+ x = node->optional_string_attribute ("ID");
+ }
+ id = x.get_value_or ("");
+
+ uri = node->string_attribute ("URI");
+}
+
+bool
+dcp::operator== (InteropLoadFontNode const & a, InteropLoadFontNode const & b)
+{
+ return a.id == b.id && a.uri == b.uri;
+}
+
+bool
+dcp::operator!= (InteropLoadFontNode const & a, InteropLoadFontNode const & b)
+{
+ return !(a == b);
+}
--- /dev/null
+/*
+ Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "load_font_node.h"
+#include <libcxml/cxml.h>
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+
+namespace dcp {
+
+class InteropLoadFontNode : public LoadFontNode
+{
+public:
+ InteropLoadFontNode () {}
+ InteropLoadFontNode (std::string id, std::string uri);
+ InteropLoadFontNode (cxml::ConstNodePtr node);
+
+ std::string uri;
+};
+
+bool operator== (InteropLoadFontNode const & a, InteropLoadFontNode const & b);
+bool operator!= (InteropLoadFontNode const & a, InteropLoadFontNode const & b);
+
+}
*/
#include "interop_subtitle_content.h"
-#include "interop_load_font.h"
+#include "interop_load_font_node.h"
#include "xml.h"
#include "raw_convert.h"
-#include "font.h"
+#include "font_node.h"
#include <boost/foreach.hpp>
using std::list;
_id = xml->string_child ("SubtitleID");
_movie_title = xml->string_child ("MovieTitle");
- _load_font_nodes = type_children<dcp::InteropLoadFont> (xml, "LoadFont");
+ _load_font_nodes = type_children<dcp::InteropLoadFontNode> (xml, "LoadFont");
list<cxml::NodePtr> f = xml->node_children ("Font");
- list<shared_ptr<dcp::Font> > font_nodes;
+ list<shared_ptr<dcp::FontNode> > font_nodes;
BOOST_FOREACH (cxml::NodePtr& i, f) {
- font_nodes.push_back (shared_ptr<Font> (new Font (i, 250)));
+ font_nodes.push_back (shared_ptr<FontNode> (new FontNode (i, 250)));
}
parse_common (xml, font_nodes);
root->add_child("ReelNumber")->add_child_text (raw_convert<string> (_reel_number));
root->add_child("Language")->add_child_text (_language);
- for (list<shared_ptr<InteropLoadFont> >::const_iterator i = _load_font_nodes.begin(); i != _load_font_nodes.end(); ++i) {
+ for (list<shared_ptr<InteropLoadFontNode> >::const_iterator i = _load_font_nodes.begin(); i != _load_font_nodes.end(); ++i) {
xmlpp::Element* load_font = root->add_child("LoadFont");
load_font->set_attribute ("Id", (*i)->id);
load_font->set_attribute ("URI", (*i)->uri);
void
InteropSubtitleContent::add_font (string id, string uri)
{
- _load_font_nodes.push_back (shared_ptr<InteropLoadFont> (new InteropLoadFont (id, uri)));
+ _load_font_nodes.push_back (shared_ptr<InteropLoadFontNode> (new InteropLoadFontNode (id, uri)));
}
bool
return false;
}
- list<shared_ptr<InteropLoadFont> >::const_iterator i = _load_font_nodes.begin ();
- list<shared_ptr<InteropLoadFont> >::const_iterator j = other->_load_font_nodes.begin ();
+ list<shared_ptr<InteropLoadFontNode> >::const_iterator i = _load_font_nodes.begin ();
+ list<shared_ptr<InteropLoadFontNode> >::const_iterator j = other->_load_font_nodes.begin ();
while (i != _load_font_nodes.end ()) {
if (j == _load_font_nodes.end ()) {
return true;
}
-list<shared_ptr<LoadFont> >
+list<shared_ptr<LoadFontNode> >
InteropSubtitleContent::load_font_nodes () const
{
- list<shared_ptr<LoadFont> > lf;
+ list<shared_ptr<LoadFontNode> > lf;
copy (_load_font_nodes.begin(), _load_font_nodes.end(), back_inserter (lf));
return lf;
}
/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
namespace dcp {
-class InteropLoadFont;
+class InteropLoadFontNode;
class InteropSubtitleContent : public SubtitleContent
{
NoteHandler note
) const;
- std::list<boost::shared_ptr<LoadFont> > load_font_nodes () const;
+ std::list<boost::shared_ptr<LoadFontNode> > load_font_nodes () const;
void add_font (std::string id, std::string uri);
private:
std::string _movie_title;
- std::list<boost::shared_ptr<InteropLoadFont> > _load_font_nodes;
+ std::list<boost::shared_ptr<InteropLoadFontNode> > _load_font_nodes;
};
}
+++ /dev/null
-/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include <string>
-
-namespace dcp {
-
-class LoadFont
-{
-public:
- LoadFont () {}
- LoadFont (std::string id_)
- : id (id_)
- {}
-
- std::string id;
-};
-
-}
--- /dev/null
+/*
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include <string>
+
+namespace dcp {
+
+class LoadFontNode
+{
+public:
+ LoadFontNode () {}
+ LoadFontNode (std::string id_)
+ : id (id_)
+ {}
+
+ std::string id;
+};
+
+}
+++ /dev/null
-/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "smpte_load_font.h"
-#include <libcxml/cxml.h>
-
-using std::string;
-using boost::shared_ptr;
-using namespace dcp;
-
-SMPTELoadFont::SMPTELoadFont (shared_ptr<const cxml::Node> node)
- : LoadFont (node->string_attribute ("ID"))
-{
- urn = node->content().substr (9);
-}
+++ /dev/null
-/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "load_font.h"
-#include <boost/shared_ptr.hpp>
-#include <boost/optional.hpp>
-
-namespace cxml {
- class Node;
-}
-
-namespace dcp {
-
-class SMPTELoadFont : public LoadFont
-{
-public:
- SMPTELoadFont () {}
- SMPTELoadFont (boost::shared_ptr<const cxml::Node> node);
-
- std::string urn;
-};
-
-}
--- /dev/null
+/*
+ Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "smpte_load_font_node.h"
+#include <libcxml/cxml.h>
+
+using std::string;
+using boost::shared_ptr;
+using namespace dcp;
+
+SMPTELoadFontNode::SMPTELoadFontNode (shared_ptr<const cxml::Node> node)
+ : LoadFontNode (node->string_attribute ("ID"))
+{
+ urn = node->content().substr (9);
+}
--- /dev/null
+/*
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "load_font_node.h"
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+
+namespace cxml {
+ class Node;
+}
+
+namespace dcp {
+
+class SMPTELoadFontNode : public LoadFontNode
+{
+public:
+ SMPTELoadFontNode () {}
+ SMPTELoadFontNode (boost::shared_ptr<const cxml::Node> node);
+
+ std::string urn;
+};
+
+}
*/
#include "smpte_subtitle_content.h"
-#include "smpte_load_font.h"
-#include "font.h"
+#include "smpte_load_font_node.h"
+#include "font_node.h"
#include "exceptions.h"
#include "xml.h"
#include "AS_DCP.h"
_id = xml->string_child("Id").substr (9);
}
- _load_font_nodes = type_children<dcp::SMPTELoadFont> (xml, "LoadFont");
+ _load_font_nodes = type_children<dcp::SMPTELoadFontNode> (xml, "LoadFont");
int tcr = xml->number_child<int> ("TimeCodeRate");
shared_ptr<cxml::Node> subtitle_list = xml->optional_node_child ("SubtitleList");
list<cxml::NodePtr> f = subtitle_list->node_children ("Font");
- list<shared_ptr<dcp::Font> > font_nodes;
+ list<shared_ptr<dcp::FontNode> > font_nodes;
BOOST_FOREACH (cxml::NodePtr& i, f) {
- font_nodes.push_back (shared_ptr<Font> (new Font (i, tcr)));
+ font_nodes.push_back (shared_ptr<FontNode> (new FontNode (i, tcr)));
}
parse_common (xml, font_nodes);
}
-list<shared_ptr<LoadFont> >
+list<shared_ptr<LoadFontNode> >
SMPTESubtitleContent::load_font_nodes () const
{
- list<shared_ptr<LoadFont> > lf;
+ list<shared_ptr<LoadFontNode> > lf;
copy (_load_font_nodes.begin(), _load_font_nodes.end(), back_inserter (lf));
return lf;
}
namespace dcp {
-class SMPTELoadFont;
+class SMPTELoadFontNode;
class SMPTESubtitleContent : public SubtitleContent
{
*/
SMPTESubtitleContent (boost::filesystem::path file, bool mxf = true);
- std::list<boost::shared_ptr<LoadFont> > load_font_nodes () const;
+ std::list<boost::shared_ptr<LoadFontNode> > load_font_nodes () const;
static bool valid_mxf (boost::filesystem::path);
private:
- std::list<boost::shared_ptr<SMPTELoadFont> > _load_font_nodes;
+ std::list<boost::shared_ptr<SMPTELoadFontNode> > _load_font_nodes;
};
}
+++ /dev/null
-/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#include "subtitle.h"
-#include "xml.h"
-#include "font.h"
-#include "text.h"
-#include <libcxml/cxml.h>
-#include <boost/lexical_cast.hpp>
-
-using std::string;
-using std::list;
-using boost::optional;
-using boost::shared_ptr;
-using boost::lexical_cast;
-using namespace dcp;
-
-Subtitle::Subtitle (boost::shared_ptr<const cxml::Node> node, int tcr)
-{
- in = Time (node->string_attribute ("TimeIn"), tcr);
- out = Time (node->string_attribute ("TimeOut"), tcr);
-
- list<cxml::NodePtr> f = node->node_children ("Font");
- for (list<cxml::NodePtr>::iterator i = f.begin(); i != f.end(); ++i) {
- font_nodes.push_back (shared_ptr<Font> (new Font (*i, tcr)));
- }
-
- list<cxml::NodePtr> t = node->node_children ("Text");
- for (list<cxml::NodePtr>::iterator i = t.begin(); i != t.end(); ++i) {
- text_nodes.push_back (shared_ptr<Text> (new Text (*i, tcr)));
- }
-
- fade_up_time = fade_time (node, "FadeUpTime", tcr);
- fade_down_time = fade_time (node, "FadeDownTime", tcr);
-}
-
-Time
-Subtitle::fade_time (shared_ptr<const cxml::Node> node, string name, int tcr)
-{
- string const u = node->optional_string_attribute (name).get_value_or ("");
- Time t;
-
- if (u.empty ()) {
- t = Time (0, 0, 0, 20, 250);
- } else if (u.find (":") != string::npos) {
- t = Time (u, tcr);
- } else {
- t = Time (0, 0, 0, lexical_cast<int> (u), tcr);
- }
-
- if (t > Time (0, 0, 8, 0, 250)) {
- t = Time (0, 0, 8, 0, 250);
- }
-
- return t;
-}
+++ /dev/null
-/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-#ifndef LIBDCP_SUBTITLE_H
-#define LIBDCP_SUBTITLE_H
-
-#include "dcp_time.h"
-#include <boost/shared_ptr.hpp>
-#include <boost/optional.hpp>
-#include <list>
-
-namespace cxml {
- class Node;
-}
-
-namespace dcp {
-
-class Font;
-class Text;
-
-class Subtitle
-{
-public:
- Subtitle () {}
- Subtitle (boost::shared_ptr<const cxml::Node> node, int tcr);
-
- Time in;
- Time out;
- Time fade_up_time;
- Time fade_down_time;
- std::list<boost::shared_ptr<Font> > font_nodes;
- std::list<boost::shared_ptr<Text> > text_nodes;
-
-private:
- Time fade_time (boost::shared_ptr<const cxml::Node>, std::string name, int tcr);
-};
-
-}
-
-#endif
#include "subtitle_content.h"
#include "util.h"
#include "xml.h"
-#include "font.h"
-#include "text.h"
+#include "font_node.h"
+#include "text_node.h"
#include "subtitle_string.h"
#include "dcp_assert.h"
#include "AS_DCP.h"
}
void
-SubtitleContent::parse_common (shared_ptr<cxml::Document> xml, list<shared_ptr<dcp::Font> > font_nodes)
+SubtitleContent::parse_common (shared_ptr<cxml::Document> xml, list<shared_ptr<dcp::FontNode> > font_nodes)
{
_reel_number = xml->string_child ("ReelNumber");
_language = xml->string_child ("Language");
void
SubtitleContent::examine_font_nodes (
shared_ptr<const cxml::Node> xml,
- list<shared_ptr<dcp::Font> > const & font_nodes,
+ list<shared_ptr<dcp::FontNode> > const & font_nodes,
ParseState& parse_state
)
{
- for (list<shared_ptr<dcp::Font> >::const_iterator i = font_nodes.begin(); i != font_nodes.end(); ++i) {
+ for (list<shared_ptr<dcp::FontNode> >::const_iterator i = font_nodes.begin(); i != font_nodes.end(); ++i) {
parse_state.font_nodes.push_back (*i);
maybe_add_subtitle ((*i)->text, parse_state);
- for (list<shared_ptr<dcp::Subtitle> >::iterator j = (*i)->subtitle_nodes.begin(); j != (*i)->subtitle_nodes.end(); ++j) {
+ for (list<shared_ptr<dcp::SubtitleNode> >::iterator j = (*i)->subtitle_nodes.begin(); j != (*i)->subtitle_nodes.end(); ++j) {
parse_state.subtitle_nodes.push_back (*j);
examine_text_nodes (xml, (*j)->text_nodes, parse_state);
examine_font_nodes (xml, (*j)->font_nodes, parse_state);
void
SubtitleContent::examine_text_nodes (
shared_ptr<const cxml::Node> xml,
- list<shared_ptr<dcp::Text> > const & text_nodes,
+ list<shared_ptr<dcp::TextNode> > const & text_nodes,
ParseState& parse_state
)
{
- for (list<shared_ptr<dcp::Text> >::const_iterator i = text_nodes.begin(); i != text_nodes.end(); ++i) {
+ for (list<shared_ptr<dcp::TextNode> >::const_iterator i = text_nodes.begin(); i != text_nodes.end(); ++i) {
parse_state.text_nodes.push_back (*i);
maybe_add_subtitle ((*i)->text, parse_state);
examine_font_nodes (xml, (*i)->font_nodes, parse_state);
DCP_ASSERT (!parse_state.text_nodes.empty ());
DCP_ASSERT (!parse_state.subtitle_nodes.empty ());
- dcp::Font effective_font (parse_state.font_nodes);
- dcp::Text effective_text (*parse_state.text_nodes.back ());
- dcp::Subtitle effective_subtitle (*parse_state.subtitle_nodes.back ());
+ dcp::FontNode effective_font (parse_state.font_nodes);
+ dcp::TextNode effective_text (*parse_state.text_nodes.back ());
+ dcp::SubtitleNode effective_subtitle (*parse_state.subtitle_nodes.back ());
_subtitles.push_back (
SubtitleString (
/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
{
class SubtitleString;
-class Font;
-class Text;
-class Subtitle;
-class LoadFont;
+class FontNode;
+class TextNode;
+class SubtitleNode;
+class LoadFontNode;
/** @class SubtitleContent
* @brief A parent for classes representing a file containing subtitles.
Time latest_subtitle_out () const;
- virtual std::list<boost::shared_ptr<LoadFont> > load_font_nodes () const = 0;
+ virtual std::list<boost::shared_ptr<LoadFontNode> > load_font_nodes () const = 0;
protected:
- void parse_common (boost::shared_ptr<cxml::Document> xml, std::list<boost::shared_ptr<Font> > font_nodes);
+ void parse_common (boost::shared_ptr<cxml::Document> xml, std::list<boost::shared_ptr<FontNode> > font_nodes);
std::string pkl_type (Standard) const {
return "text/xml";
private:
struct ParseState {
- std::list<boost::shared_ptr<Font> > font_nodes;
- std::list<boost::shared_ptr<Text> > text_nodes;
- std::list<boost::shared_ptr<Subtitle> > subtitle_nodes;
+ std::list<boost::shared_ptr<FontNode> > font_nodes;
+ std::list<boost::shared_ptr<TextNode> > text_nodes;
+ std::list<boost::shared_ptr<SubtitleNode> > subtitle_nodes;
};
void maybe_add_subtitle (std::string text, ParseState const & parse_state);
void examine_font_nodes (
boost::shared_ptr<const cxml::Node> xml,
- std::list<boost::shared_ptr<Font> > const & font_nodes,
+ std::list<boost::shared_ptr<FontNode> > const & font_nodes,
ParseState& parse_state
);
void examine_text_nodes (
boost::shared_ptr<const cxml::Node> xml,
- std::list<boost::shared_ptr<Text> > const & text_nodes,
+ std::list<boost::shared_ptr<TextNode> > const & text_nodes,
ParseState& parse_state
);
};
--- /dev/null
+/*
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "subtitle_node.h"
+#include "xml.h"
+#include "font_node.h"
+#include "text_node.h"
+#include <libcxml/cxml.h>
+#include <boost/lexical_cast.hpp>
+
+using std::string;
+using std::list;
+using boost::optional;
+using boost::shared_ptr;
+using boost::lexical_cast;
+using namespace dcp;
+
+SubtitleNode::SubtitleNode (boost::shared_ptr<const cxml::Node> node, int tcr)
+{
+ in = Time (node->string_attribute ("TimeIn"), tcr);
+ out = Time (node->string_attribute ("TimeOut"), tcr);
+
+ list<cxml::NodePtr> f = node->node_children ("Font");
+ for (list<cxml::NodePtr>::iterator i = f.begin(); i != f.end(); ++i) {
+ font_nodes.push_back (shared_ptr<FontNode> (new FontNode (*i, tcr)));
+ }
+
+ list<cxml::NodePtr> t = node->node_children ("Text");
+ for (list<cxml::NodePtr>::iterator i = t.begin(); i != t.end(); ++i) {
+ text_nodes.push_back (shared_ptr<TextNode> (new TextNode (*i, tcr)));
+ }
+
+ fade_up_time = fade_time (node, "FadeUpTime", tcr);
+ fade_down_time = fade_time (node, "FadeDownTime", tcr);
+}
+
+Time
+SubtitleNode::fade_time (shared_ptr<const cxml::Node> node, string name, int tcr)
+{
+ string const u = node->optional_string_attribute (name).get_value_or ("");
+ Time t;
+
+ if (u.empty ()) {
+ t = Time (0, 0, 0, 20, 250);
+ } else if (u.find (":") != string::npos) {
+ t = Time (u, tcr);
+ } else {
+ t = Time (0, 0, 0, lexical_cast<int> (u), tcr);
+ }
+
+ if (t > Time (0, 0, 8, 0, 250)) {
+ t = Time (0, 0, 8, 0, 250);
+ }
+
+ return t;
+}
--- /dev/null
+/*
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef LIBDCP_SUBTITLE_NODE_H
+#define LIBDCP_SUBTITLE_NODE_H
+
+#include "dcp_time.h"
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+#include <list>
+
+namespace cxml {
+ class Node;
+}
+
+namespace dcp {
+
+class FontNode;
+class TextNode;
+
+class SubtitleNode
+{
+public:
+ SubtitleNode () {}
+ SubtitleNode (boost::shared_ptr<const cxml::Node> node, int tcr);
+
+ Time in;
+ Time out;
+ Time fade_up_time;
+ Time fade_down_time;
+ std::list<boost::shared_ptr<FontNode> > font_nodes;
+ std::list<boost::shared_ptr<TextNode> > text_nodes;
+
+private:
+ Time fade_time (boost::shared_ptr<const cxml::Node>, std::string name, int tcr);
+};
+
+}
+
+#endif
+++ /dev/null
-/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-/** @file src/text.cc
- * @brief Text class for parsing subtitle XML.
- */
-
-#include "text.h"
-#include "xml.h"
-#include "font.h"
-#include <libcxml/cxml.h>
-#include <boost/foreach.hpp>
-
-using std::string;
-using std::list;
-using boost::shared_ptr;
-using boost::optional;
-using namespace dcp;
-
-/** Read a <Text> node from a subtitle XML file, noting its contents
- * in this object's member variables.
- * @param node Node to read.
- */
-Text::Text (boost::shared_ptr<const cxml::Node> node, int tcr)
- : v_align (CENTER)
-{
- text = node->content ();
- optional<float> x = node->optional_number_attribute<float> ("VPosition");
- if (!x) {
- x = node->number_attribute<float> ("Vposition");
- }
- v_position = x.get () / 100;
-
- optional<string> v = node->optional_string_attribute ("VAlign");
- if (!v) {
- v = node->optional_string_attribute ("Valign");
- }
-
- if (v) {
- v_align = string_to_valign (v.get ());
- }
-
- 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)));
- }
-}
+++ /dev/null
-/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-*/
-
-/** @file src/text.h
- * @brief Text class for parsing subtitle XML.
- */
-
-#include "types.h"
-#include <boost/shared_ptr.hpp>
-#include <boost/optional.hpp>
-#include <list>
-
-namespace cxml {
- class Node;
-}
-
-namespace dcp {
-
-class Font;
-
-/** @class Text
- * @brief Parser for Text nodes from subtitle XML.
- */
-class Text
-{
-public:
- /** Construct a default text node */
- Text ()
- : v_position (0)
- , v_align (TOP)
- {}
-
- Text (boost::shared_ptr<const cxml::Node> node, int tcr);
-
- float v_position;
- VAlign v_align;
- std::string text;
- std::list<boost::shared_ptr<Font> > font_nodes;
-};
-
-}
--- /dev/null
+/*
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+/** @file src/text.cc
+ * @brief TextNode class for parsing subtitle XML.
+ */
+
+#include "text_node.h"
+#include "xml.h"
+#include "font_node.h"
+#include <libcxml/cxml.h>
+#include <boost/foreach.hpp>
+
+using std::string;
+using std::list;
+using boost::shared_ptr;
+using boost::optional;
+using namespace dcp;
+
+/** Read a <Text> node from a subtitle XML file, noting its contents
+ * in this object's member variables.
+ * @param node Node to read.
+ */
+TextNode::TextNode (boost::shared_ptr<const cxml::Node> node, int tcr)
+ : v_align (CENTER)
+{
+ text = node->content ();
+ optional<float> x = node->optional_number_attribute<float> ("VPosition");
+ if (!x) {
+ x = node->number_attribute<float> ("Vposition");
+ }
+ v_position = x.get () / 100;
+
+ optional<string> v = node->optional_string_attribute ("VAlign");
+ if (!v) {
+ v = node->optional_string_attribute ("Valign");
+ }
+
+ if (v) {
+ v_align = string_to_valign (v.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)));
+ }
+}
--- /dev/null
+/*
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+/** @file src/text.h
+ * @brief TextNode class for parsing subtitle XML.
+ */
+
+#include "types.h"
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+#include <list>
+
+namespace cxml {
+ class Node;
+}
+
+namespace dcp {
+
+class FontNode;
+
+/** @class TextNode
+ * @brief Parser for Text nodes from subtitle XML.
+ */
+class TextNode
+{
+public:
+ /** Construct a default text node */
+ TextNode ()
+ : v_position (0)
+ , v_align (TOP)
+ {}
+
+ TextNode (boost::shared_ptr<const cxml::Node> node, int tcr);
+
+ float v_position;
+ VAlign v_align;
+ std::string text;
+ std::list<boost::shared_ptr<FontNode> > font_nodes;
+};
+
+}
encrypted_kdm.cc
exceptions.cc
file.cc
- font.cc
+ font_node.cc
gamma_transfer_function.cc
- interop_load_font.cc
+ interop_load_font_node.cc
interop_subtitle_content.cc
key.cc
local_time.cc
reel_subtitle_asset.cc
rgb_xyz.cc
signer.cc
- smpte_load_font.cc
+ smpte_load_font_node.cc
smpte_subtitle_content.cc
sound_mxf.cc
sound_mxf_writer.cc
stereo_picture_mxf.cc
stereo_picture_mxf_writer.cc
stereo_picture_frame.cc
- subtitle.cc
+ subtitle_node.cc
subtitle_content.cc
subtitle_string.cc
- text.cc
+ text_node.cc
transfer_function.cc
types.cc
util.cc
*/
-#include "interop_load_font.h"
+#include "interop_load_font_node.h"
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_CASE (interop_load_font_test1)
{
- dcp::InteropLoadFont lf ("my-great-id", "my-great-uri");
+ dcp::InteropLoadFontNode lf ("my-great-id", "my-great-uri");
BOOST_CHECK_EQUAL (lf.id, "my-great-id");
BOOST_CHECK_EQUAL (lf.uri, "my-great-uri");
}
text->set_attribute("Id", "my-great-id");
text->set_attribute("URI", "my-great-uri");
- dcp::InteropLoadFont lf (cxml::ConstNodePtr (new cxml::Node (text)));
+ dcp::InteropLoadFontNode lf (cxml::ConstNodePtr (new cxml::Node (text)));
BOOST_CHECK_EQUAL (lf.id, "my-great-id");
}
text->set_attribute("ID", "my-great-id");
text->set_attribute("URI", "my-great-uri");
- dcp::InteropLoadFont lf (cxml::ConstNodePtr (new cxml::Node (text)));
+ dcp::InteropLoadFontNode lf (cxml::ConstNodePtr (new cxml::Node (text)));
BOOST_CHECK_EQUAL (lf.id, "my-great-id");
}
/** Test operator== and operator!= */
BOOST_AUTO_TEST_CASE (interop_load_font_test4)
{
- dcp::InteropLoadFont A ("my-create-id", "my-great-uri");
- dcp::InteropLoadFont B ("my-create-id", "my-great-uri");
- dcp::InteropLoadFont C ("my-create-id", "another-great-uri");
+ dcp::InteropLoadFontNode A ("my-create-id", "my-great-uri");
+ dcp::InteropLoadFontNode B ("my-create-id", "my-great-uri");
+ dcp::InteropLoadFontNode C ("my-create-id", "another-great-uri");
BOOST_CHECK (A == B);
BOOST_CHECK (B != C);
*/
-#include "smpte_load_font.h"
+#include "smpte_load_font_node.h"
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <boost/test/unit_test.hpp>
xmlpp::Document doc;
xmlpp::Element* text = doc.create_root_node("Font");
- text->set_attribute("ID", "my-great-id");
- text->add_child_text("urn:uuid:my-great-urn");
- dcp::SMPTELoadFont lf (cxml::ConstNodePtr (new cxml::Node (text)));
+ text->set_attribute ("ID", "my-great-id");
+ text->add_child_text ("urn:uuid:my-great-urn");
+ dcp::SMPTELoadFontNode lf (cxml::ConstNodePtr (new cxml::Node (text)));
BOOST_CHECK_EQUAL (lf.id, "my-great-id");
BOOST_CHECK_EQUAL (lf.urn, "my-great-urn");
*/
-#include "text.h"
+#include "text_node.h"
#include <libcxml/cxml.h>
#include <libxml++/libxml++.h>
#include <boost/test/unit_test.hpp>
text->set_attribute("VAlign", "top");
text->add_child_text("Hello world");
- dcp::Text t (cxml::NodePtr (new cxml::Node (text)), 250);
+ dcp::TextNode t (cxml::NodePtr (new cxml::Node (text)), 250);
BOOST_CHECK_CLOSE (t.v_position, 0.042, 0.001);
BOOST_CHECK_EQUAL (t.v_align, dcp::TOP);
BOOST_CHECK_EQUAL (t.text, "Hello world");
text->set_attribute("Valign", "top");
text->add_child_text("Hello world");
- dcp::Text t (cxml::NodePtr (new cxml::Node (text)), 250);
+ dcp::TextNode t (cxml::NodePtr (new cxml::Node (text)), 250);
BOOST_CHECK_CLOSE (t.v_position, 0.042, 0.001);
BOOST_CHECK_EQUAL (t.v_align, dcp::TOP);
BOOST_CHECK_EQUAL (t.text, "Hello world");