font_nodes.push_back (shared_ptr<FontNode> (new FontNode (i, 250)));
}
- parse_common (xml, font_nodes);
+ parse_subtitles (xml, font_nodes);
}
InteropSubtitleAsset::InteropSubtitleAsset (string movie_title, string language)
font_nodes.push_back (shared_ptr<FontNode> (new FontNode (i, _time_code_rate)));
}
- parse_common (xml, font_nodes);
+ parse_subtitles (xml, font_nodes);
}
list<shared_ptr<LoadFontNode> >
}
void
-SubtitleAsset::parse_common (shared_ptr<cxml::Document> xml, list<shared_ptr<dcp::FontNode> > font_nodes)
+SubtitleAsset::parse_subtitles (shared_ptr<cxml::Document> xml, list<shared_ptr<dcp::FontNode> > font_nodes)
{
/* Make Subtitle objects to represent the raw XML nodes in a sane way */
ParseState parse_state;
/** @class SubtitleAsset
* @brief A parent for classes representing a file containing subtitles.
+ *
+ * This class holds a list of SubtitleString objects which it can extract
+ * from the appropriate part of either an Interop or SMPTE XML file.
+ * Its subclasses InteropSubtitleAsset and SMPTESubtitleAsset handle the
+ * differences between the two types.
*/
class SubtitleAsset : public Asset
{
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<FontNode> > font_nodes);
-
- virtual std::string pkl_type (Standard) const = 0;
-
- std::string asdcp_kind () const {
- return "Subtitle";
- }
+ void parse_subtitles (boost::shared_ptr<cxml::Document> xml, std::list<boost::shared_ptr<FontNode> > font_nodes);
void subtitles_as_xml (xmlpp::Element* root, int time_code_rate, std::string xmlns) const;
-
+
+ /** All our subtitles, in no particular order */
std::list<SubtitleString> _subtitles;
private:
+ /** @struct ParseState
+ * @brief A struct to hold state when parsing a subtitle XML file.
+ */
struct ParseState {
std::list<boost::shared_ptr<FontNode> > font_nodes;
std::list<boost::shared_ptr<TextNode> > text_nodes;