diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-05-13 14:45:16 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-05-13 14:45:16 +0100 |
| commit | 7394f50d8b5334a17cac37c8956b1b7e8e5e49c8 (patch) | |
| tree | 26a0d79b5ea6a2932bcc1ffbe75c8110716ebf26 /src/subtitle_asset.h | |
| parent | 797916ae28d976f3c5be62d37b45864219af6098 (diff) | |
Try to move XML bits out into parse/ subdir.
Diffstat (limited to 'src/subtitle_asset.h')
| -rw-r--r-- | src/subtitle_asset.h | 74 |
1 files changed, 7 insertions, 67 deletions
diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h index 591985d1..0d662d6c 100644 --- a/src/subtitle_asset.h +++ b/src/subtitle_asset.h @@ -20,71 +20,11 @@ #include "asset.h" #include "xml.h" #include "dcp_time.h" +#include "parse/subtitle.h" namespace libdcp { -class FontNode; - -class TextNode -{ -public: - TextNode () {} - TextNode (boost::shared_ptr<const cxml::Node> node); - - float v_position; - VAlign v_align; - std::string text; - std::list<boost::shared_ptr<FontNode> > font_nodes; -}; - -class SubtitleNode -{ -public: - SubtitleNode () {} - SubtitleNode (boost::shared_ptr<const cxml::Node> node); - - 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); -}; - -class FontNode -{ -public: - FontNode () {} - FontNode (boost::shared_ptr<const cxml::Node> node); - FontNode (std::list<boost::shared_ptr<FontNode> > const & font_nodes); - - std::string text; - std::string id; - int size; - boost::optional<bool> italic; - boost::optional<Color> color; - boost::optional<Effect> effect; - boost::optional<Color> effect_color; - - std::list<boost::shared_ptr<SubtitleNode> > subtitle_nodes; - std::list<boost::shared_ptr<FontNode> > font_nodes; - std::list<boost::shared_ptr<TextNode> > text_nodes; -}; - -class LoadFontNode -{ -public: - LoadFontNode () {} - LoadFontNode (boost::shared_ptr<const cxml::Node> node); - - std::string id; - std::string uri; -}; - class Subtitle { public: @@ -210,22 +150,22 @@ private: std::string escape (std::string) const; struct ParseState { - std::list<boost::shared_ptr<FontNode> > font_nodes; - std::list<boost::shared_ptr<TextNode> > text_nodes; - std::list<boost::shared_ptr<SubtitleNode> > subtitle_nodes; + std::list<boost::shared_ptr<parse::Font> > font_nodes; + std::list<boost::shared_ptr<parse::Text> > text_nodes; + std::list<boost::shared_ptr<parse::Subtitle> > 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<FontNode> > const & font_nodes, + std::list<boost::shared_ptr<parse::Font> > const & font_nodes, ParseState& parse_state ); void examine_text_nodes ( boost::shared_ptr<const cxml::Node> xml, - std::list<boost::shared_ptr<TextNode> > const & text_nodes, + std::list<boost::shared_ptr<parse::Text> > const & text_nodes, ParseState& parse_state ); @@ -233,7 +173,7 @@ private: /* strangely, this is sometimes a string */ std::string _reel_number; std::string _language; - std::list<boost::shared_ptr<LoadFontNode> > _load_font_nodes; + std::list<boost::shared_ptr<parse::LoadFont> > _load_font_nodes; std::list<boost::shared_ptr<Subtitle> > _subtitles; bool _need_sort; |
