2 Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 class TextNode : public XMLNode
31 TextNode (xmlpp::Node const * node);
37 class SubtitleNode : public XMLNode
41 SubtitleNode (xmlpp::Node const * node);
45 std::list<boost::shared_ptr<TextNode> > text_nodes;
48 class FontNode : public XMLNode
52 FontNode (xmlpp::Node const * node);
56 boost::optional<bool> italic;
58 std::list<boost::shared_ptr<SubtitleNode> > subtitle_nodes;
59 std::list<boost::shared_ptr<FontNode> > font_nodes;
62 class LoadFontNode : public XMLNode
66 LoadFontNode (xmlpp::Node const * node);
85 std::string font () const {
89 bool italic () const {
101 std::string text () const {
105 float v_position () const {
109 int size_in_pixels (int screen_height) const;
121 class SubtitleAsset : public Asset, public XMLFile
124 SubtitleAsset (std::string directory, std::string xml);
126 void write_to_cpl (std::ostream&) const {}
127 virtual std::list<std::string> equals (boost::shared_ptr<const Asset>, EqualityOptions) const {
129 return std::list<std::string> ();
132 std::string language () const {
136 std::list<boost::shared_ptr<Subtitle> > subtitles_at (Time t) const;
139 std::string font_id_to_name (std::string id) const;
140 void examine_font_node (boost::shared_ptr<FontNode> font_node, std::list<boost::shared_ptr<FontNode> >& current_font_nodes);
141 std::string id_from_font_nodes (std::list<boost::shared_ptr<FontNode> > const & font_nodes) const;
142 int size_from_font_nodes (std::list<boost::shared_ptr<FontNode> > const & font_nodes) const;
143 bool italic_from_font_nodes (std::list<boost::shared_ptr<FontNode> > const & font_nodes) const;
145 std::string _subtitle_id;
146 std::string _movie_title;
147 int64_t _reel_number;
148 std::string _language;
149 std::list<boost::shared_ptr<LoadFontNode> > _load_font_nodes;
151 std::list<boost::shared_ptr<Subtitle> > _subtitles;