Add option to use (or not) ISDCF names by default.
[dcpomatic.git] / src / lib / film.cc
index 0d277b82a0a8e92c1825eedc86dc6b08c7b3085c..5e99e466c4375a04d90484708f11d294321b8c68 100644 (file)
@@ -155,7 +155,7 @@ int const Film::current_state_version = 38;
 
 Film::Film (optional<boost::filesystem::path> dir)
        : _playlist (new Playlist)
-       , _use_isdcf_name (true)
+       , _use_isdcf_name (Config::instance()->use_isdcf_name_by_default())
        , _dcp_content_type (Config::instance()->default_dcp_content_type ())
        , _container (Config::instance()->default_container ())
        , _resolution (Resolution::TWO_K)
@@ -377,12 +377,9 @@ Film::subtitle_analysis_path (shared_ptr<const Content> content) const
 }
 
 
-/** 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.
- */
+/** Add suitable Jobs to the JobManager to create a DCP for this Film */
 void
-Film::make_dcp (bool gui, bool check)
+Film::make_dcp (TranscodeJob::ChangedBehaviour behaviour)
 {
        if (dcp_name().find ("/") != string::npos) {
                throw BadSettingError (_("name"), _("Cannot contain slashes"));
@@ -438,14 +435,9 @@ Film::make_dcp (bool gui, bool check)
        }
        LOG_GENERAL ("J2K bandwidth %1", j2k_bandwidth());
 
-       auto tj = make_shared<TranscodeJob>(shared_from_this());
+       auto tj = make_shared<TranscodeJob>(shared_from_this(), behaviour);
        tj->set_encoder (make_shared<DCPEncoder>(shared_from_this(), tj));
-       if (check) {
-               auto cc = make_shared<CheckContentChangeJob>(shared_from_this(), tj, gui);
-               JobManager::instance()->add (cc);
-       } else {
-               JobManager::instance()->add (tj);
-       }
+       JobManager::instance()->add (tj);
 }
 
 /** Start a job to send our DCP to the configured TMS */
@@ -753,7 +745,9 @@ Film::read_metadata (optional<boost::filesystem::path> path)
                        _ratings.push_back (dcp::Rating("", *rating));
                }
                if (auto mastered_luminance = isdcf->optional_number_child<float>("MasteredLuminance")) {
-                       _luminance = dcp::Luminance(*mastered_luminance, dcp::Luminance::Unit::FOOT_LAMBERT);
+                       if (*mastered_luminance > 0) {
+                               _luminance = dcp::Luminance(*mastered_luminance, dcp::Luminance::Unit::FOOT_LAMBERT);
+                       }
                }
                _studio = isdcf->optional_string_child("Studio");
                _facility = isdcf->optional_string_child("Facility");