Store mtime in Content.
[dcpomatic.git] / src / lib / text_content.h
index cb3bb5ee4a8439c6dd6b2bd1cb6149eabbeaa4d6..e5981acafe90edda62f7aa389dbc1fd6f16efc13 100644 (file)
@@ -18,8 +18,8 @@
 
 */
 
-#ifndef DCPOMATIC_SUBTITLE_CONTENT_H
-#define DCPOMATIC_SUBTITLE_CONTENT_H
+#ifndef DCPOMATIC_CAPTION_CONTENT_H
+#define DCPOMATIC_CAPTION_CONTENT_H
 
 #include "content_part.h"
 #include <libcxml/cxml.h>
@@ -50,15 +50,15 @@ public:
 };
 
 /** @class TextContent
- *  @brief Description of how some subtitle content should be presented.
+ *  @brief Description of how some text content should be presented.
  *
- *  There are `image' subtitles (bitmaps) and `text' subtitles (plain text),
+ *  There are `bitmap' subtitles and `plain' subtitles (plain text),
  *  and not all of the settings in this class correspond to both types.
  */
 class TextContent : public ContentPart
 {
 public:
-       explicit TextContent (Content* parent);
+       TextContent (Content* parent, TextType type, TextType original_type);
        TextContent (Content* parent, std::vector<boost::shared_ptr<Content> >);
 
        void as_xml (xmlpp::Node *) const;
@@ -168,7 +168,12 @@ public:
                return _type;
        }
 
-       static boost::shared_ptr<TextContent> from_xml (Content* parent, cxml::ConstNodePtr, int version);
+       TextType original_type () const {
+               boost::mutex::scoped_lock lm (_mutex);
+               return _original_type;
+       }
+
+       static std::list<boost::shared_ptr<TextContent> > from_xml (Content* parent, cxml::ConstNodePtr, int version);
 
 protected:
        /** subtitle language (e.g. "German") or empty if it is not known */
@@ -206,7 +211,12 @@ private:
        boost::optional<ContentTime> _fade_in;
        boost::optional<ContentTime> _fade_out;
        int _outline_width;
+       /** what these captions will be used for in the output DCP (not necessarily what
+        *  they were originally).
+        */
        TextType _type;
+       /** the original type of these captions in their content */
+       TextType _original_type;
 };
 
 #endif