summaryrefslogtreecommitdiff
path: root/src/subtitle_asset.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-09-09 18:12:32 +0100
committerCarl Hetherington <cth@carlh.net>2012-09-09 18:12:32 +0100
commit8411002d2c768dfaaa4b89cf6a2b12b3967f1f69 (patch)
tree35f43d5f12ca34868c7b64de1671ca72b38177b1 /src/subtitle_asset.h
parentc1798d06bb87eddfb08945893b0b9166fd097f93 (diff)
Clean up and fix subtitle parsing a bit.
Diffstat (limited to 'src/subtitle_asset.h')
-rw-r--r--src/subtitle_asset.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h
index efcab3a3..4d62bfb4 100644
--- a/src/subtitle_asset.h
+++ b/src/subtitle_asset.h
@@ -35,6 +35,7 @@ public:
float v_position;
VAlign v_align;
std::string text;
+ std::list<boost::shared_ptr<FontNode> > font_nodes;
};
class SubtitleNode : public XMLNode
@@ -61,6 +62,7 @@ public:
FontNode (xmlpp::Node const * node);
FontNode (std::list<boost::shared_ptr<FontNode> > const & font_nodes);
+ std::string text;
std::string id;
int size;
boost::optional<bool> italic;
@@ -198,16 +200,22 @@ public:
private:
std::string font_id_to_name (std::string id) 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;
+ };
+
+ void maybe_add_subtitle (std::string text, ParseState const & parse_state);
+
void examine_font_nodes (
std::list<boost::shared_ptr<FontNode> > const & font_nodes,
- std::list<boost::shared_ptr<FontNode> >& current_font_nodes,
- std::list<boost::shared_ptr<SubtitleNode> >& current_subtitle_nodes
+ ParseState& parse_state
);
void examine_text_nodes (
- boost::shared_ptr<SubtitleNode> subtitle_node,
std::list<boost::shared_ptr<TextNode> > const & text_nodes,
- std::list<boost::shared_ptr<FontNode> >& current_font_nodes
+ ParseState& parse_state
);
std::string _subtitle_id;