X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fdcp_subtitle_content.cc;h=779361f630c7b4a2d88a9075e8338d8ea1662cd3;hb=dea824f6ff41384a5e17e23de5434cf84eccff29;hp=8fee0b2ed29a7ee8ce836d548bc5b88676a613a6;hpb=1a693725f9a8cc6ba58f65b2f1ef03255d295f23;p=dcpomatic.git diff --git a/src/lib/dcp_subtitle_content.cc b/src/lib/dcp_subtitle_content.cc index 8fee0b2ed..779361f63 100644 --- a/src/lib/dcp_subtitle_content.cc +++ b/src/lib/dcp_subtitle_content.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2015 Carl Hetherington + Copyright (C) 2014-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -21,7 +21,7 @@ #include "font.h" #include "dcp_subtitle_content.h" #include "film.h" -#include "subtitle_content.h" +#include "caption_content.h" #include #include #include @@ -40,14 +40,14 @@ using dcp::raw_convert; DCPSubtitleContent::DCPSubtitleContent (shared_ptr film, boost::filesystem::path path) : Content (film, path) { - subtitle.reset (new SubtitleContent (this)); + caption.push_back (shared_ptr (new CaptionContent (this, CAPTION_OPEN))); } DCPSubtitleContent::DCPSubtitleContent (shared_ptr film, cxml::ConstNodePtr node, int version) : Content (film, node) , _length (node->number_child ("Length")) { - subtitle = SubtitleContent::from_xml (this, node, version); + caption = CaptionContent::from_xml (this, node, version); } void @@ -66,18 +66,18 @@ DCPSubtitleContent::examine (shared_ptr job) boost::mutex::scoped_lock lm (_mutex); /* Default to turning these subtitles on */ - subtitle->set_use (true); + only_caption()->set_use (true); if (iop) { - subtitle->set_language (iop->language ()); + only_caption()->set_language (iop->language ()); } else if (smpte) { - subtitle->set_language (smpte->language().get_value_or ("")); + only_caption()->set_language (smpte->language().get_value_or ("")); } _length = ContentTime::from_seconds (sc->latest_subtitle_out().as_seconds ()); BOOST_FOREACH (shared_ptr i, sc->load_font_nodes ()) { - subtitle->add_font (shared_ptr (new Font (i->id))); + only_caption()->add_font (shared_ptr (new Font (i->id))); } } @@ -106,8 +106,8 @@ DCPSubtitleContent::as_xml (xmlpp::Node* node, bool with_paths) const node->add_child("Type")->add_child_text ("DCPSubtitle"); 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 ()));