Small tidy-ups and comments.
authorCarl Hetherington <cth@carlh.net>
Fri, 5 Jun 2015 17:13:20 +0000 (18:13 +0100)
committerCarl Hetherington <cth@carlh.net>
Fri, 5 Jun 2015 17:13:20 +0000 (18:13 +0100)
src/interop_subtitle_asset.cc
src/smpte_subtitle_asset.cc
src/subtitle_asset.cc
src/subtitle_asset.h

index 528b7d90376ca3a74ee9d71e72ad5bf291399869..96ccb68a1d88b84238a704a640dacfa421d40508 100644 (file)
@@ -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)
index 40afc76db9c83daf7f100e2c4bbf14c1b13819ed..a81b84eb4032adc2a98c491e388875b19c9c441a 100644 (file)
@@ -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> >
index 1c341de49d309369d0ac89a85e6d2c27dfcccd12..45177b95aeabbe7d8400cfebd367a3a819ddfce4 100644 (file)
@@ -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;
index c8100d58b1503939aa841a3ab4313dfbf06536e3..5fdb5f7a2a23c2d6a66570ed4fa03943fc291180 100644 (file)
@@ -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;