X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ftext_caption_file_content.cc;h=aa64ca5724e227a9ea5aeba9779a52ffe4c9dca7;hb=6f146336b73fe720c83cb75ebdf15e9cb9c02973;hp=df5de93ef5f647c82e52b4f7f5fd92ab686316aa;hpb=9cb73fbc0fa4643612f01665bc6d9fc430656f32;p=dcpomatic.git diff --git a/src/lib/text_caption_file_content.cc b/src/lib/text_caption_file_content.cc index df5de93ef..aa64ca572 100644 --- a/src/lib/text_caption_file_content.cc +++ b/src/lib/text_caption_file_content.cc @@ -20,10 +20,10 @@ #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 #include #include @@ -38,14 +38,14 @@ using dcp::raw_convert; TextCaptionFileContent::TextCaptionFileContent (shared_ptr film, boost::filesystem::path path) : Content (film, path) { - subtitle.reset (new TextContent (this)); + caption.push_back (shared_ptr (new CaptionContent (this, CAPTION_OPEN))); } TextCaptionFileContent::TextCaptionFileContent (shared_ptr film, cxml::ConstNodePtr node, int version) : Content (film, node) , _length (node->number_child ("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) 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 (new Font (TEXT_FONT_ID))); + only_caption()->add_font (shared_ptr (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 (_length.get ()));