Add --no-check to dcpomatic_cli.
authorCarl Hetherington <cth@carlh.net>
Tue, 23 Jul 2019 20:32:04 +0000 (21:32 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 23 Jul 2019 20:32:04 +0000 (21:32 +0100)
src/lib/film.cc
src/lib/film.h
src/tools/dcpomatic_cli.cc

index 687033908db186257f93b2d84cf958796b10edf4..4eed5e3f0d0bd412dd554850bbbec8788eff49f1 100644 (file)
@@ -297,9 +297,12 @@ Film::audio_analysis_path (shared_ptr<const Playlist> playlist) const
        return p;
 }
 
-/** Add suitable Jobs to the JobManager to create a DCP for this Film */
+/** Add suitable Jobs to the JobManager to create a DCP for this Film.
+ *  @param gui true if this is being called from a GUI tool.
+ *  @param check true to check the content in the project for changes before making the DCP.
+ */
 void
-Film::make_dcp (bool gui)
+Film::make_dcp (bool gui, bool check)
 {
        if (dcp_name().find ("/") != string::npos) {
                throw BadSettingError (_("name"), _("Cannot contain slashes"));
@@ -353,8 +356,12 @@ Film::make_dcp (bool gui)
 
        shared_ptr<TranscodeJob> tj (new TranscodeJob (shared_from_this()));
        tj->set_encoder (shared_ptr<Encoder> (new DCPEncoder (shared_from_this(), tj)));
-       shared_ptr<CheckContentChangeJob> cc (new CheckContentChangeJob(shared_from_this(), tj, gui));
-       JobManager::instance()->add (cc);
+       if (check) {
+               shared_ptr<CheckContentChangeJob> cc (new CheckContentChangeJob(shared_from_this(), tj, gui));
+               JobManager::instance()->add (cc);
+       } else {
+               JobManager::instance()->add (tj);
+       }
 }
 
 /** Start a job to send our DCP to the configured TMS */
index 1c5022428a332563ee586ca1441cfc64756ae69c..a28d81b6fafc411a418577cedfafa787003a4ba9 100644 (file)
@@ -82,7 +82,7 @@ public:
        boost::filesystem::path audio_analysis_path (boost::shared_ptr<const Playlist>) const;
 
        void send_dcp_to_tms ();
-       void make_dcp (bool gui = false);
+       void make_dcp (bool gui = false, bool check = true);
 
        /** @return Logger.
         *  It is safe to call this from any thread.
index 13efb6b1958dd537060b7dafcee37d9a49955525..ca6c79cb8b9b4f96b63d6e93122714df653e5ad8 100644 (file)
@@ -68,6 +68,7 @@ help (string n)
             << "  -d, --dcp-path       echo DCP's path to stdout on successful completion (implies -n)\n"
             << "  -c, --config <dir>   directory containing config.xml and cinemas.xml\n"
             << "      --dump           just dump a summary of the film's settings; don't encode\n"
+            << "      --no-check       don't check project's content files for changes before making the DCP\n"
             << "\n"
             << "<FILM> is the film directory.\n";
 }
@@ -198,6 +199,7 @@ main (int argc, char* argv[])
        bool list_servers_ = false;
        bool dcp_path = false;
        optional<boost::filesystem::path> config;
+       bool check = true;
 
        int option_index = 0;
        while (true) {
@@ -216,10 +218,11 @@ main (int argc, char* argv[])
                        { "config", required_argument, 0, 'c' },
                        /* Just using A, B, C ... from here on */
                        { "dump", no_argument, 0, 'A' },
+                       { "no-check", no_argument, 0, 'B' },
                        { 0, 0, 0, 0 }
                };
 
-               int c = getopt_long (argc, argv, "vhfnrt:j:kAs:ldc:", long_options, &option_index);
+               int c = getopt_long (argc, argv, "vhfnrt:j:kAs:ldc:B", long_options, &option_index);
 
                if (c == -1) {
                        break;
@@ -266,6 +269,9 @@ main (int argc, char* argv[])
                case 'c':
                        config = optarg;
                        break;
+               case 'B':
+                       check = false;
+                       break;
                }
        }
 
@@ -349,7 +355,7 @@ main (int argc, char* argv[])
                cout << "\nMaking DCP for " << film->name() << "\n";
        }
 
-       film->make_dcp (false);
+       film->make_dcp (false, check);
        bool const error = show_jobs_on_console (progress);
 
        if (keep_going) {