From: Carl Hetherington Date: Wed, 17 Aug 2016 14:36:00 +0000 (+0100) Subject: Check for conflicing refer-to-DCP settings. X-Git-Tag: v2.9.13~4 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=96858c88f15ad9deb260da295b2af3847b9b8e15 Check for conflicing refer-to-DCP settings. This adds a general fix_conflicting_settings() to Film which should fix the problem and give a message to tell the user why the "fix" is being carried out. Should help with #929. --- diff --git a/ChangeLog b/ChangeLog index 78d198ffa..cbb2d00bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2016-08-17 c.hetherington + * Spot and "fix" impossible refer-to-DCP settings (#929). + * Label tweak to clarify how JPEG2000 bandwidth control works (#904). * Scroll audio mapping view labels correctly (#919). diff --git a/src/lib/film.cc b/src/lib/film.cc index 7d183d032..edb911217 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -1451,3 +1451,39 @@ Film::content_summary (DCPTimePeriod period) const { return _playlist->content_summary (period); } + +list +Film::fix_conflicting_settings () +{ + list notes; + + list was_referencing; + BOOST_FOREACH (shared_ptr i, content()) { + shared_ptr d = dynamic_pointer_cast (i); + if (d) { + list reasons; + bool was = false; + if (!d->can_reference_video(reasons) && d->reference_video()) { + d->set_reference_video (false); + was = true; + } + if (!d->can_reference_audio(reasons) && d->reference_audio()) { + d->set_reference_audio (false); + was = true; + } + if (!d->can_reference_subtitle(reasons) && d->reference_subtitle()) { + d->set_reference_subtitle (false); + was = true; + } + if (was) { + was_referencing.push_back (d->path(0).parent_path().filename()); + } + } + } + + BOOST_FOREACH (boost::filesystem::path d, was_referencing) { + notes.push_back (String::compose (_("The DCP %1 was being referred to by this film. This not now possible because the reel sizes in the film no longer agree with those in the imported DCP.\n\nSetting the 'Reel type' to 'split by video content' will probably help.\n\nAfter doing that you would need to re-tick the appropriate 'refer to existing DCP' checkboxes."), d.string())); + } + + return notes; +} diff --git a/src/lib/film.h b/src/lib/film.h index d63065f8d..82d1f78c0 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -164,6 +164,8 @@ public: */ std::string content_summary (DCPTimePeriod period) const; + std::list fix_conflicting_settings (); + /** Identifiers for the parts of our state; used for signalling changes. */ diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 822ae286a..a5e1e82e9 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2015 Carl Hetherington + Copyright (C) 2012-2016 Carl Hetherington This file is part of DCP-o-matic. @@ -32,10 +32,12 @@ #include "content_panel.h" #include #include +#include #include using std::cout; using std::string; +using std::list; using boost::shared_ptr; using boost::optional; @@ -75,6 +77,11 @@ FilmEditor::film_changed (Film::Property p) return; } + list notes = _film->fix_conflicting_settings (); + BOOST_FOREACH (string i, notes) { + message_dialog (this, std_to_wx (i)); + } + _content_panel->film_changed (p); _dcp_panel->film_changed (p);