From f0f4b2371ff5cd6fc39239a3c201bae0c033d21f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 21 Aug 2018 23:16:42 +0100 Subject: [PATCH] Check content before making DCP. --- src/lib/check_content_change_job.cc | 19 ++++++++++++++----- src/lib/check_content_change_job.h | 5 ++++- src/lib/film.cc | 4 +++- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/src/lib/check_content_change_job.cc b/src/lib/check_content_change_job.cc index bb3674f27..783a2ac01 100644 --- a/src/lib/check_content_change_job.cc +++ b/src/lib/check_content_change_job.cc @@ -33,8 +33,9 @@ using std::list; using std::cout; using boost::shared_ptr; -CheckContentChangeJob::CheckContentChangeJob (shared_ptr film) +CheckContentChangeJob::CheckContentChangeJob (shared_ptr film, shared_ptr following) : Job (film) + , _following (following) { } @@ -78,10 +79,18 @@ CheckContentChangeJob::run () JobManager::instance()->add(shared_ptr(new ExamineContentJob(_film, i))); } - if (!changed.empty()) { - set_message (_("Some files were changed since they were added to the project.\n\nThese files will now be re-examined, so you may need to check their settings.")); - } - set_progress (1); set_state (FINISHED_OK); + + if (!changed.empty()) { + string m = _("Some files have been changed since they were added to the project.\n\nThese files will now be re-examined, so you may need to check their settings."); + if (_following) { + /* I'm assuming that _following is a make DCP job */ + m += " "; + m += _("Choose 'Make DCP' again when you have done this."); + } + set_message (m); + } else if (_following) { + JobManager::instance()->add (_following); + } } diff --git a/src/lib/check_content_change_job.h b/src/lib/check_content_change_job.h index 4ae3ed1e9..da9c5cb20 100644 --- a/src/lib/check_content_change_job.h +++ b/src/lib/check_content_change_job.h @@ -27,9 +27,12 @@ class CheckContentChangeJob : public Job { public: - CheckContentChangeJob (boost::shared_ptr); + CheckContentChangeJob (boost::shared_ptr, boost::shared_ptr following = boost::shared_ptr()); std::string name () const; std::string json_name () const; void run (); + +private: + boost::shared_ptr _following; }; diff --git a/src/lib/film.cc b/src/lib/film.cc index 8576c5a67..274cb8d2d 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -52,6 +52,7 @@ #include "screen_kdm.h" #include "cinema.h" #include "change_signaller.h" +#include "check_content_change_job.h" #include #include #include @@ -348,7 +349,8 @@ Film::make_dcp () shared_ptr tj (new TranscodeJob (shared_from_this())); tj->set_encoder (shared_ptr (new DCPEncoder (shared_from_this(), tj))); - JobManager::instance()->add (tj); + shared_ptr cc (new CheckContentChangeJob (shared_from_this(), tj)); + JobManager::instance()->add (cc); } /** Start a job to send our DCP to the configured TMS */ -- 2.30.2