summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-04-30 19:22:31 +0100
committerCarl Hetherington <cth@carlh.net>2015-04-30 19:22:31 +0100
commit2246204c213d61b2cde7a85d6038156283670c9d (patch)
treec050e64cd4e1484059ddfef8b1960df5ec04828b /src
parent4c0cbcddc4b1015b902ce2100879071fdd887b02 (diff)
Rename some things to ...Node.
Diffstat (limited to 'src')
-rw-r--r--src/font_node.cc (renamed from src/font.cc)18
-rw-r--r--src/font_node.h (renamed from src/font.h)22
-rw-r--r--src/interop_load_font_node.cc (renamed from src/interop_load_font.cc)14
-rw-r--r--src/interop_load_font_node.h (renamed from src/interop_load_font.h)14
-rw-r--r--src/interop_subtitle_content.cc22
-rw-r--r--src/interop_subtitle_content.h8
-rw-r--r--src/load_font_node.h (renamed from src/load_font.h)6
-rw-r--r--src/smpte_load_font_node.cc (renamed from src/smpte_load_font.cc)6
-rw-r--r--src/smpte_load_font_node.h (renamed from src/smpte_load_font.h)10
-rw-r--r--src/smpte_subtitle_content.cc14
-rw-r--r--src/smpte_subtitle_content.h6
-rw-r--r--src/subtitle_content.cc22
-rw-r--r--src/subtitle_content.h24
-rw-r--r--src/subtitle_node.cc (renamed from src/subtitle.cc)14
-rw-r--r--src/subtitle_node.h (renamed from src/subtitle.h)20
-rw-r--r--src/text_node.cc (renamed from src/text.cc)12
-rw-r--r--src/text_node.h (renamed from src/text.h)14
-rw-r--r--src/wscript10
18 files changed, 128 insertions, 128 deletions
diff --git a/src/font.cc b/src/font_node.cc
index 8656e909..257a6b51 100644
--- a/src/font.cc
+++ b/src/font_node.cc
@@ -1,5 +1,5 @@
/*
- 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
@@ -19,9 +19,9 @@
#include "types.h"
#include "raw_convert.h"
-#include "font.h"
+#include "font_node.h"
#include "xml.h"
-#include "text.h"
+#include "text_node.h"
#include <libcxml/cxml.h>
#include <boost/foreach.hpp>
@@ -31,7 +31,7 @@ using boost::shared_ptr;
using boost::optional;
using namespace dcp;
-Font::Font (cxml::ConstNodePtr node, int tcr)
+FontNode::FontNode (cxml::ConstNodePtr node, int tcr)
{
text = node->content ();
@@ -53,27 +53,27 @@ Font::Font (cxml::ConstNodePtr node, int tcr)
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)));
+ 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<Font> (new Font (i, tcr)));
+ 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<Text> (new Text (i, tcr)));
+ text_nodes.push_back (shared_ptr<TextNode> (new TextNode (i, tcr)));
}
}
-Font::Font (std::list<boost::shared_ptr<Font> > const & font_nodes)
+FontNode::FontNode (std::list<boost::shared_ptr<FontNode> > 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) {
+ for (list<shared_ptr<FontNode> >::const_iterator i = font_nodes.begin(); i != font_nodes.end(); ++i) {
if ((*i)->id) {
id = (*i)->id;
}
diff --git a/src/font.h b/src/font_node.h
index a2589be4..97efde73 100644
--- a/src/font.h
+++ b/src/font_node.h
@@ -1,5 +1,5 @@
/*
- 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
@@ -17,12 +17,12 @@
*/
-/** @file src/font.h
- * @brief Font class
+/** @file src/font_node.h
+ * @brief FontNode class
*/
#include "types.h"
-#include "subtitle.h"
+#include "subtitle_node.h"
#include <libcxml/cxml.h>
#include <boost/shared_ptr.hpp>
#include <boost/optional.hpp>
@@ -33,15 +33,15 @@ namespace dcp {
/** @class Font
* @brief Helper class for parsing subtitle XML.
*/
-class Font
+class FontNode
{
public:
- Font ()
+ FontNode ()
: size (0)
{}
- Font (cxml::ConstNodePtr node, int tcr);
- Font (std::list<boost::shared_ptr<Font> > const & font_nodes);
+ FontNode (cxml::ConstNodePtr node, int tcr);
+ FontNode (std::list<boost::shared_ptr<FontNode> > const & font_nodes);
std::string text;
boost::optional<std::string> id;
@@ -51,9 +51,9 @@ public:
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;
+ std::list<boost::shared_ptr<SubtitleNode> > subtitle_nodes;
+ std::list<boost::shared_ptr<FontNode> > font_nodes;
+ std::list<boost::shared_ptr<TextNode> > text_nodes;
};
}
diff --git a/src/interop_load_font.cc b/src/interop_load_font_node.cc
index d29e49de..7c15f401 100644
--- a/src/interop_load_font.cc
+++ b/src/interop_load_font_node.cc
@@ -1,5 +1,5 @@
/*
- 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
@@ -17,7 +17,7 @@
*/
-#include "interop_load_font.h"
+#include "interop_load_font_node.h"
#include <libcxml/cxml.h>
using std::string;
@@ -25,14 +25,14 @@ using boost::shared_ptr;
using boost::optional;
using namespace dcp;
-InteropLoadFont::InteropLoadFont (string id_, string uri_)
- : LoadFont (id_)
+InteropLoadFontNode::InteropLoadFontNode (string id_, string uri_)
+ : LoadFontNode (id_)
, uri (uri_)
{
}
-InteropLoadFont::InteropLoadFont (cxml::ConstNodePtr node)
+InteropLoadFontNode::InteropLoadFontNode (cxml::ConstNodePtr node)
{
optional<string> x = node->optional_string_attribute ("Id");
if (!x) {
@@ -44,13 +44,13 @@ InteropLoadFont::InteropLoadFont (cxml::ConstNodePtr node)
}
bool
-dcp::operator== (InteropLoadFont const & a, InteropLoadFont const & b)
+dcp::operator== (InteropLoadFontNode const & a, InteropLoadFontNode const & b)
{
return a.id == b.id && a.uri == b.uri;
}
bool
-dcp::operator!= (InteropLoadFont const & a, InteropLoadFont const & b)
+dcp::operator!= (InteropLoadFontNode const & a, InteropLoadFontNode const & b)
{
return !(a == b);
}
diff --git a/src/interop_load_font.h b/src/interop_load_font_node.h
index 0ab39ad4..5afe8693 100644
--- a/src/interop_load_font.h
+++ b/src/interop_load_font_node.h
@@ -17,24 +17,24 @@
*/
-#include "load_font.h"
+#include "load_font_node.h"
#include <libcxml/cxml.h>
#include <boost/shared_ptr.hpp>
#include <boost/optional.hpp>
namespace dcp {
-class InteropLoadFont : public LoadFont
+class InteropLoadFontNode : public LoadFontNode
{
public:
- InteropLoadFont () {}
- InteropLoadFont (std::string id, std::string uri);
- InteropLoadFont (cxml::ConstNodePtr node);
+ InteropLoadFontNode () {}
+ InteropLoadFontNode (std::string id, std::string uri);
+ InteropLoadFontNode (cxml::ConstNodePtr node);
std::string uri;
};
-bool operator== (InteropLoadFont const & a, InteropLoadFont const & b);
-bool operator!= (InteropLoadFont const & a, InteropLoadFont const & b);
+bool operator== (InteropLoadFontNode const & a, InteropLoadFontNode const & b);
+bool operator!= (InteropLoadFontNode const & a, InteropLoadFontNode const & b);
}
diff --git a/src/interop_subtitle_content.cc b/src/interop_subtitle_content.cc
index 1018d85c..2ba698db 100644
--- a/src/interop_subtitle_content.cc
+++ b/src/interop_subtitle_content.cc
@@ -18,10 +18,10 @@
*/
#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;
@@ -40,12 +40,12 @@ InteropSubtitleContent::InteropSubtitleContent (boost::filesystem::path file)
_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);
@@ -78,7 +78,7 @@ InteropSubtitleContent::xml_as_string () const
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);
@@ -175,7 +175,7 @@ InteropSubtitleContent::xml_as_string () const
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
@@ -190,8 +190,8 @@ InteropSubtitleContent::equals (shared_ptr<const Asset> other_asset, EqualityOpt
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 ()) {
@@ -216,10 +216,10 @@ InteropSubtitleContent::equals (shared_ptr<const Asset> other_asset, EqualityOpt
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;
}
diff --git a/src/interop_subtitle_content.h b/src/interop_subtitle_content.h
index 98a4b599..cb7c52d5 100644
--- a/src/interop_subtitle_content.h
+++ b/src/interop_subtitle_content.h
@@ -1,5 +1,5 @@
/*
- 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
@@ -22,7 +22,7 @@
namespace dcp {
-class InteropLoadFont;
+class InteropLoadFontNode;
class InteropSubtitleContent : public SubtitleContent
{
@@ -36,7 +36,7 @@ public:
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);
@@ -44,7 +44,7 @@ public:
private:
std::string _movie_title;
- std::list<boost::shared_ptr<InteropLoadFont> > _load_font_nodes;
+ std::list<boost::shared_ptr<InteropLoadFontNode> > _load_font_nodes;
};
}
diff --git a/src/load_font.h b/src/load_font_node.h
index 15906ef6..24f193bd 100644
--- a/src/load_font.h
+++ b/src/load_font_node.h
@@ -21,11 +21,11 @@
namespace dcp {
-class LoadFont
+class LoadFontNode
{
public:
- LoadFont () {}
- LoadFont (std::string id_)
+ LoadFontNode () {}
+ LoadFontNode (std::string id_)
: id (id_)
{}
diff --git a/src/smpte_load_font.cc b/src/smpte_load_font_node.cc
index 0991f7db..11f7d5a4 100644
--- a/src/smpte_load_font.cc
+++ b/src/smpte_load_font_node.cc
@@ -17,15 +17,15 @@
*/
-#include "smpte_load_font.h"
+#include "smpte_load_font_node.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"))
+SMPTELoadFontNode::SMPTELoadFontNode (shared_ptr<const cxml::Node> node)
+ : LoadFontNode (node->string_attribute ("ID"))
{
urn = node->content().substr (9);
}
diff --git a/src/smpte_load_font.h b/src/smpte_load_font_node.h
index 7df9ea29..1ca7786a 100644
--- a/src/smpte_load_font.h
+++ b/src/smpte_load_font_node.h
@@ -1,5 +1,5 @@
/*
- 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
@@ -17,7 +17,7 @@
*/
-#include "load_font.h"
+#include "load_font_node.h"
#include <boost/shared_ptr.hpp>
#include <boost/optional.hpp>
@@ -27,11 +27,11 @@ namespace cxml {
namespace dcp {
-class SMPTELoadFont : public LoadFont
+class SMPTELoadFontNode : public LoadFontNode
{
public:
- SMPTELoadFont () {}
- SMPTELoadFont (boost::shared_ptr<const cxml::Node> node);
+ SMPTELoadFontNode () {}
+ SMPTELoadFontNode (boost::shared_ptr<const cxml::Node> node);
std::string urn;
};
diff --git a/src/smpte_subtitle_content.cc b/src/smpte_subtitle_content.cc
index 4435fe23..e95a64fc 100644
--- a/src/smpte_subtitle_content.cc
+++ b/src/smpte_subtitle_content.cc
@@ -18,8 +18,8 @@
*/
#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"
@@ -62,25 +62,25 @@ SMPTESubtitleContent::SMPTESubtitleContent (boost::filesystem::path file, bool m
_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;
}
diff --git a/src/smpte_subtitle_content.h b/src/smpte_subtitle_content.h
index a47cbb3c..8526e0ec 100644
--- a/src/smpte_subtitle_content.h
+++ b/src/smpte_subtitle_content.h
@@ -22,7 +22,7 @@
namespace dcp {
-class SMPTELoadFont;
+class SMPTELoadFontNode;
class SMPTESubtitleContent : public SubtitleContent
{
@@ -32,12 +32,12 @@ public:
*/
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;
};
}
diff --git a/src/subtitle_content.cc b/src/subtitle_content.cc
index 07fd90f0..f8321273 100644
--- a/src/subtitle_content.cc
+++ b/src/subtitle_content.cc
@@ -21,8 +21,8 @@
#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"
@@ -56,7 +56,7 @@ SubtitleContent::SubtitleContent (boost::filesystem::path file)
}
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");
@@ -72,16 +72,16 @@ SubtitleContent::parse_common (shared_ptr<cxml::Document> xml, list<shared_ptr<d
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);
@@ -98,11 +98,11 @@ SubtitleContent::examine_font_nodes (
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);
@@ -124,9 +124,9 @@ SubtitleContent::maybe_add_subtitle (string text, ParseState const & 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 (
diff --git a/src/subtitle_content.h b/src/subtitle_content.h
index 0ef7b19d..ee424916 100644
--- a/src/subtitle_content.h
+++ b/src/subtitle_content.h
@@ -1,5 +1,5 @@
/*
- 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
@@ -29,10 +29,10 @@ namespace dcp
{
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.
@@ -68,10 +68,10 @@ public:
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";
@@ -89,22 +89,22 @@ protected:
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
);
};
diff --git a/src/subtitle.cc b/src/subtitle_node.cc
index 6c2ccd7e..57476330 100644
--- a/src/subtitle.cc
+++ b/src/subtitle_node.cc
@@ -17,10 +17,10 @@
*/
-#include "subtitle.h"
+#include "subtitle_node.h"
#include "xml.h"
-#include "font.h"
-#include "text.h"
+#include "font_node.h"
+#include "text_node.h"
#include <libcxml/cxml.h>
#include <boost/lexical_cast.hpp>
@@ -31,19 +31,19 @@ using boost::shared_ptr;
using boost::lexical_cast;
using namespace dcp;
-Subtitle::Subtitle (boost::shared_ptr<const cxml::Node> node, int tcr)
+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<Font> (new Font (*i, tcr)));
+ 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<Text> (new Text (*i, tcr)));
+ text_nodes.push_back (shared_ptr<TextNode> (new TextNode (*i, tcr)));
}
fade_up_time = fade_time (node, "FadeUpTime", tcr);
@@ -51,7 +51,7 @@ Subtitle::Subtitle (boost::shared_ptr<const cxml::Node> node, int tcr)
}
Time
-Subtitle::fade_time (shared_ptr<const cxml::Node> node, string name, int tcr)
+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;
diff --git a/src/subtitle.h b/src/subtitle_node.h
index 0958a1d4..d615557a 100644
--- a/src/subtitle.h
+++ b/src/subtitle_node.h
@@ -1,5 +1,5 @@
/*
- 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
@@ -17,8 +17,8 @@
*/
-#ifndef LIBDCP_SUBTITLE_H
-#define LIBDCP_SUBTITLE_H
+#ifndef LIBDCP_SUBTITLE_NODE_H
+#define LIBDCP_SUBTITLE_NODE_H
#include "dcp_time.h"
#include <boost/shared_ptr.hpp>
@@ -31,21 +31,21 @@ namespace cxml {
namespace dcp {
-class Font;
-class Text;
+class FontNode;
+class TextNode;
-class Subtitle
+class SubtitleNode
{
public:
- Subtitle () {}
- Subtitle (boost::shared_ptr<const cxml::Node> node, int tcr);
+ 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<Font> > font_nodes;
- std::list<boost::shared_ptr<Text> > text_nodes;
+ 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);
diff --git a/src/text.cc b/src/text_node.cc
index d18066dd..834b78b2 100644
--- a/src/text.cc
+++ b/src/text_node.cc
@@ -1,5 +1,5 @@
/*
- 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
@@ -18,12 +18,12 @@
*/
/** @file src/text.cc
- * @brief Text class for parsing subtitle XML.
+ * @brief TextNode class for parsing subtitle XML.
*/
-#include "text.h"
+#include "text_node.h"
#include "xml.h"
-#include "font.h"
+#include "font_node.h"
#include <libcxml/cxml.h>
#include <boost/foreach.hpp>
@@ -37,7 +37,7 @@ using namespace dcp;
* in this object's member variables.
* @param node Node to read.
*/
-Text::Text (boost::shared_ptr<const cxml::Node> node, int tcr)
+TextNode::TextNode (boost::shared_ptr<const cxml::Node> node, int tcr)
: v_align (CENTER)
{
text = node->content ();
@@ -58,6 +58,6 @@ Text::Text (boost::shared_ptr<const cxml::Node> node, int 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)));
+ font_nodes.push_back (shared_ptr<FontNode> (new FontNode (i, tcr)));
}
}
diff --git a/src/text.h b/src/text_node.h
index fe314f76..2e1b9ac4 100644
--- a/src/text.h
+++ b/src/text_node.h
@@ -18,7 +18,7 @@
*/
/** @file src/text.h
- * @brief Text class for parsing subtitle XML.
+ * @brief TextNode class for parsing subtitle XML.
*/
#include "types.h"
@@ -32,26 +32,26 @@ namespace cxml {
namespace dcp {
-class Font;
+class FontNode;
-/** @class Text
+/** @class TextNode
* @brief Parser for Text nodes from subtitle XML.
*/
-class Text
+class TextNode
{
public:
/** Construct a default text node */
- Text ()
+ TextNode ()
: v_position (0)
, v_align (TOP)
{}
- Text (boost::shared_ptr<const cxml::Node> node, int tcr);
+ TextNode (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;
+ std::list<boost::shared_ptr<FontNode> > font_nodes;
};
}
diff --git a/src/wscript b/src/wscript
index 1107d8cd..ea062374 100644
--- a/src/wscript
+++ b/src/wscript
@@ -16,9 +16,9 @@ def build(bld):
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
@@ -42,7 +42,7 @@ def build(bld):
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
@@ -50,10 +50,10 @@ def build(bld):
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