+ shared_ptr<DCPDecoder> decoder;
+ try {
+ decoder.reset (new DCPDecoder (film, shared_from_this(), false, film->tolerant(), shared_ptr<DCPDecoder>()));
+ } catch (dcp::ReadError &) {
+ /* We couldn't read the DCP, so it's probably missing */
+ return false;
+ } catch (dcp::KDMDecryptionError &) {
+ /* We have an incorrect KDM */
+ return false;
+ }
+
+ BOOST_FOREACH (shared_ptr<dcp::Reel> i, decoder->reels()) {
+ if (type == TEXT_OPEN_SUBTITLE && !i->main_subtitle()) {
+ /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
+ why_not = _("it does not have open subtitles in all its reels.");
+ return false;
+ }
+ if (type == TEXT_CLOSED_CAPTION && i->closed_captions().empty()) {
+ /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
+ why_not = _("it does not have closed captions in all its reels.");
+ return false;
+ }
+ }
+
+ /// TRANSLATORS: this string will follow "Cannot reference this DCP: "
+ return can_reference (film, bind (&check_text, _1), _("it overlaps other text content; remove the other content."), why_not);
+}
+
+void
+DCPContent::take_settings_from (shared_ptr<const Content> c)
+{
+ shared_ptr<const DCPContent> dc = dynamic_pointer_cast<const DCPContent> (c);
+ if (!dc) {
+ return;
+ }
+
+ _reference_video = dc->_reference_video;
+ _reference_audio = dc->_reference_audio;
+ for (int i = 0; i < TEXT_COUNT; ++i) {
+ _reference_text[i] = dc->_reference_text[i];
+ }