diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-06-05 18:13:20 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-06-05 18:13:20 +0100 |
| commit | d73bea50fba97958c2ddba99d150d4540d2264ba (patch) | |
| tree | 73fe54850e1f2add941c31a6c2edda553ec7b255 | |
| parent | 42a65cba0d8da23c12af52015e66cd9dc0b5a5fa (diff) | |
Small tidy-ups and comments.
| -rw-r--r-- | src/interop_subtitle_asset.cc | 2 | ||||
| -rw-r--r-- | src/smpte_subtitle_asset.cc | 2 | ||||
| -rw-r--r-- | src/subtitle_asset.cc | 2 | ||||
| -rw-r--r-- | src/subtitle_asset.h | 19 |
4 files changed, 14 insertions, 11 deletions
diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc index 528b7d90..96ccb68a 100644 --- a/src/interop_subtitle_asset.cc +++ b/src/interop_subtitle_asset.cc @@ -53,7 +53,7 @@ InteropSubtitleAsset::InteropSubtitleAsset (boost::filesystem::path file) 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) diff --git a/src/smpte_subtitle_asset.cc b/src/smpte_subtitle_asset.cc index 40afc76d..a81b84eb 100644 --- a/src/smpte_subtitle_asset.cc +++ b/src/smpte_subtitle_asset.cc @@ -101,7 +101,7 @@ SMPTESubtitleAsset::SMPTESubtitleAsset (boost::filesystem::path file, bool mxf) 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> > diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc index 1c341de4..45177b95 100644 --- a/src/subtitle_asset.cc +++ b/src/subtitle_asset.cc @@ -54,7 +54,7 @@ SubtitleAsset::SubtitleAsset (boost::filesystem::path file) } 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; diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h index c8100d58..5fdb5f7a 100644 --- a/src/subtitle_asset.h +++ b/src/subtitle_asset.h @@ -40,6 +40,11 @@ class LoadFontNode; /** @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 { @@ -68,19 +73,17 @@ public: 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; |
