Update to test/data.
[dcpomatic.git] / src / lib / text_caption_file_content.cc
index df5de93ef5f647c82e52b4f7f5fd92ab686316aa..aa64ca5724e227a9ea5aeba9779a52ffe4c9dca7 100644 (file)
 
 #include "text_caption_file_content.h"
 #include "util.h"
-#include "plain_text_file.h"
+#include "text_caption_file.h"
 #include "film.h"
 #include "font.h"
-#include "text_content.h"
+#include "caption_content.h"
 #include <dcp/raw_convert.h>
 #include <libxml++/libxml++.h>
 #include <iostream>
@@ -38,14 +38,14 @@ using dcp::raw_convert;
 TextCaptionFileContent::TextCaptionFileContent (shared_ptr<const Film> film, boost::filesystem::path path)
        : Content (film, path)
 {
-       subtitle.reset (new TextContent (this));
+       caption.push_back (shared_ptr<CaptionContent> (new CaptionContent (this, CAPTION_OPEN)));
 }
 
 TextCaptionFileContent::TextCaptionFileContent (shared_ptr<const Film> film, cxml::ConstNodePtr node, int version)
        : Content (film, node)
        , _length (node->number_child<ContentTime::Type> ("Length"))
 {
-       subtitle = TextContent::from_xml (this, node, version);
+       caption = CaptionContent::from_xml (this, node, version);
 }
 
 void
@@ -55,11 +55,11 @@ TextCaptionFileContent::examine (boost::shared_ptr<Job> job)
        TextCaptionFile s (shared_from_this ());
 
        /* Default to turning these subtitles on */
-       subtitle->set_use (true);
+       only_caption()->set_use (true);
 
        boost::mutex::scoped_lock lm (_mutex);
        _length = s.length ();
-       subtitle->add_font (shared_ptr<Font> (new Font (TEXT_FONT_ID)));
+       only_caption()->add_font (shared_ptr<Font> (new Font (TEXT_FONT_ID)));
 }
 
 string
@@ -80,8 +80,8 @@ TextCaptionFileContent::as_xml (xmlpp::Node* node, bool with_paths) const
        node->add_child("Type")->add_child_text ("TextSubtitle");
        Content::as_xml (node, with_paths);
 
-       if (subtitle) {
-               subtitle->as_xml (node);
+       if (only_caption()) {
+               only_caption()->as_xml (node);
        }
 
        node->add_child("Length")->add_child_text (raw_convert<string> (_length.get ()));