Check content before making DCP.
authorCarl Hetherington <cth@carlh.net>
Tue, 21 Aug 2018 22:16:42 +0000 (23:16 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 21 Aug 2018 22:16:42 +0000 (23:16 +0100)
src/lib/check_content_change_job.cc
src/lib/check_content_change_job.h
src/lib/film.cc

index bb3674f27b42471fa1518f04abd8508ae7a1db9d..783a2ac010521e989c636af307964955b256029c 100644 (file)
@@ -33,8 +33,9 @@ using std::list;
 using std::cout;
 using boost::shared_ptr;
 
-CheckContentChangeJob::CheckContentChangeJob (shared_ptr<const Film> film)
+CheckContentChangeJob::CheckContentChangeJob (shared_ptr<const Film> film, shared_ptr<Job> following)
        : Job (film)
+       , _following (following)
 {
 
 }
@@ -78,10 +79,18 @@ CheckContentChangeJob::run ()
                JobManager::instance()->add(shared_ptr<Job>(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);
+       }
 }
index 4ae3ed1e9b53f3f286f352c566aab4e726c9b18a..da9c5cb20be0d0aa71186956621fb8fd7fbeba82 100644 (file)
 class CheckContentChangeJob : public Job
 {
 public:
-       CheckContentChangeJob (boost::shared_ptr<const Film>);
+       CheckContentChangeJob (boost::shared_ptr<const Film>, boost::shared_ptr<Job> following = boost::shared_ptr<Job>());
 
        std::string name () const;
        std::string json_name () const;
        void run ();
+
+private:
+       boost::shared_ptr<Job> _following;
 };
index 8576c5a670a18eb11d90d143d286b7120f485f76..274cb8d2dbd958575d64f41d198760db33341eef 100644 (file)
@@ -52,6 +52,7 @@
 #include "screen_kdm.h"
 #include "cinema.h"
 #include "change_signaller.h"
+#include "check_content_change_job.h"
 #include <libcxml/cxml.h>
 #include <dcp/cpl.h>
 #include <dcp/certificate_chain.h>
@@ -348,7 +349,8 @@ Film::make_dcp ()
 
        shared_ptr<TranscodeJob> tj (new TranscodeJob (shared_from_this()));
        tj->set_encoder (shared_ptr<Encoder> (new DCPEncoder (shared_from_this(), tj)));
-       JobManager::instance()->add (tj);
+       shared_ptr<CheckContentChangeJob> cc (new CheckContentChangeJob (shared_from_this(), tj));
+       JobManager::instance()->add (cc);
 }
 
 /** Start a job to send our DCP to the configured TMS */