summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-01-04 01:13:33 +0000
committerCarl Hetherington <cth@carlh.net>2015-01-04 01:13:33 +0000
commit695506b51231548d76d9c8b5848671faab4a27b4 (patch)
treeacf157c18ab8a4dac3b3ef1dca0c3f2a15fb8c77 /src
parent1b258903ae2ac1e99a60982d8f67720afa8f9b53 (diff)
Make a parent for SMPTELoadFont and InteropLoadFont.
Diffstat (limited to 'src')
-rw-r--r--src/interop_load_font.cc2
-rw-r--r--src/interop_load_font.h4
-rw-r--r--src/interop_subtitle_content.cc8
-rw-r--r--src/interop_subtitle_content.h4
-rw-r--r--src/smpte_load_font.cc2
-rw-r--r--src/smpte_load_font.h4
-rw-r--r--src/smpte_subtitle_content.cc8
-rw-r--r--src/smpte_subtitle_content.h2
-rw-r--r--src/subtitle_content.h5
-rw-r--r--src/wscript1
10 files changed, 30 insertions, 10 deletions
diff --git a/src/interop_load_font.cc b/src/interop_load_font.cc
index dede5696..d29e49de 100644
--- a/src/interop_load_font.cc
+++ b/src/interop_load_font.cc
@@ -26,7 +26,7 @@ using boost::optional;
using namespace dcp;
InteropLoadFont::InteropLoadFont (string id_, string uri_)
- : id (id_)
+ : LoadFont (id_)
, uri (uri_)
{
diff --git a/src/interop_load_font.h b/src/interop_load_font.h
index c553b557..0ab39ad4 100644
--- a/src/interop_load_font.h
+++ b/src/interop_load_font.h
@@ -17,20 +17,20 @@
*/
+#include "load_font.h"
#include <libcxml/cxml.h>
#include <boost/shared_ptr.hpp>
#include <boost/optional.hpp>
namespace dcp {
-class InteropLoadFont
+class InteropLoadFont : public LoadFont
{
public:
InteropLoadFont () {}
InteropLoadFont (std::string id, std::string uri);
InteropLoadFont (cxml::ConstNodePtr node);
- std::string id;
std::string uri;
};
diff --git a/src/interop_subtitle_content.cc b/src/interop_subtitle_content.cc
index 09b30e99..45977d67 100644
--- a/src/interop_subtitle_content.cc
+++ b/src/interop_subtitle_content.cc
@@ -210,3 +210,11 @@ InteropSubtitleContent::equals (shared_ptr<const Asset> other_asset, EqualityOpt
return true;
}
+
+list<shared_ptr<LoadFont> >
+InteropSubtitleContent::load_font_nodes () const
+{
+ list<shared_ptr<LoadFont> > 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 9dfde104..adb45c6b 100644
--- a/src/interop_subtitle_content.h
+++ b/src/interop_subtitle_content.h
@@ -36,9 +36,7 @@ public:
boost::function<void (NoteType, std::string)> note
) const;
- std::list<boost::shared_ptr<InteropLoadFont> > load_font_nodes () const {
- return _load_font_nodes;
- }
+ std::list<boost::shared_ptr<LoadFont> > load_font_nodes () const;
void add_font (std::string id, std::string uri);
diff --git a/src/smpte_load_font.cc b/src/smpte_load_font.cc
index 90e9c993..0991f7db 100644
--- a/src/smpte_load_font.cc
+++ b/src/smpte_load_font.cc
@@ -25,7 +25,7 @@ using boost::shared_ptr;
using namespace dcp;
SMPTELoadFont::SMPTELoadFont (shared_ptr<const cxml::Node> node)
+ : LoadFont (node->string_attribute ("ID"))
{
- id = node->string_attribute ("ID");
urn = node->content().substr (9);
}
diff --git a/src/smpte_load_font.h b/src/smpte_load_font.h
index d8d1fa66..7df9ea29 100644
--- a/src/smpte_load_font.h
+++ b/src/smpte_load_font.h
@@ -17,6 +17,7 @@
*/
+#include "load_font.h"
#include <boost/shared_ptr.hpp>
#include <boost/optional.hpp>
@@ -26,13 +27,12 @@ namespace cxml {
namespace dcp {
-class SMPTELoadFont
+class SMPTELoadFont : public LoadFont
{
public:
SMPTELoadFont () {}
SMPTELoadFont (boost::shared_ptr<const cxml::Node> node);
- std::string id;
std::string urn;
};
diff --git a/src/smpte_subtitle_content.cc b/src/smpte_subtitle_content.cc
index d34c1dbe..e54b33c3 100644
--- a/src/smpte_subtitle_content.cc
+++ b/src/smpte_subtitle_content.cc
@@ -67,3 +67,11 @@ SMPTESubtitleContent::SMPTESubtitleContent (boost::filesystem::path file, bool m
parse_common (xml, font_nodes);
}
+
+list<shared_ptr<LoadFont> >
+SMPTESubtitleContent::load_font_nodes () const
+{
+ list<shared_ptr<LoadFont> > 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 70f6f260..8faea817 100644
--- a/src/smpte_subtitle_content.h
+++ b/src/smpte_subtitle_content.h
@@ -31,6 +31,8 @@ public:
*/
SMPTESubtitleContent (boost::filesystem::path file, bool mxf = true);
+ std::list<boost::shared_ptr<LoadFont> > load_font_nodes () const;
+
private:
std::list<boost::shared_ptr<SMPTELoadFont> > _load_font_nodes;
};
diff --git a/src/subtitle_content.h b/src/subtitle_content.h
index 94b46868..7121387a 100644
--- a/src/subtitle_content.h
+++ b/src/subtitle_content.h
@@ -32,6 +32,7 @@ class SubtitleString;
class Font;
class Text;
class Subtitle;
+class LoadFont;
/** @class SubtitleContent
* @brief A parent for classes representing a file containing subtitles.
@@ -67,8 +68,10 @@ public:
Time latest_subtitle_out () const;
+ virtual std::list<boost::shared_ptr<LoadFont> > load_font_nodes () const = 0;
+
protected:
- void parse_common (boost::shared_ptr<cxml::Document> xml, std::list<boost::shared_ptr<dcp::Font> > font_nodes);
+ void parse_common (boost::shared_ptr<cxml::Document> xml, std::list<boost::shared_ptr<Font> > font_nodes);
std::string pkl_type (Standard) const {
return "text/xml";
diff --git a/src/wscript b/src/wscript
index ae2983a9..d6444aee 100644
--- a/src/wscript
+++ b/src/wscript
@@ -82,6 +82,7 @@ def build(bld):
interop_load_font.h
interop_subtitle_content.h
key.h
+ load_font.h
local_time.h
metadata.h
mono_picture_mxf.h