X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffilm.cc;h=d0f0106c49b6fb0e2906b53468d76e3e71190e25;hb=a2e41d9a95b6e0000f3a54f513214130f8b6ca9f;hp=296066f58756d5d48e903cea458bc1202802cebc;hpb=185756ffbbba5d2b356860e75232fec9582c5800;p=dcpomatic.git diff --git a/src/lib/film.cc b/src/lib/film.cc index 296066f58..d0f0106c4 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -377,12 +377,9 @@ Film::subtitle_analysis_path (shared_ptr 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(shared_from_this()); + auto tj = make_shared(shared_from_this(), behaviour); tj->set_encoder (make_shared(shared_from_this(), tj)); - if (check) { - auto cc = make_shared(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 */ @@ -729,6 +721,43 @@ Film::read_metadata (optional path) _audio_language = dcp::LanguageTag(*audio_language); } + /* Read the old ISDCFMetadata tag from 2.14.x metadata */ + auto isdcf = f.optional_node_child("ISDCFMetadata"); + if (isdcf) { + if (auto territory = isdcf->optional_string_child("Territory")) { + try { + _release_territory = dcp::LanguageTag::RegionSubtag(*territory); + } catch (...) { + /* Invalid region subtag; just ignore it */ + } + } + if (auto audio_language = isdcf->optional_string_child("AudioLanguage")) { + try { + _audio_language = dcp::LanguageTag(*audio_language); + } catch (...) { + /* Invalid language tag; just ignore it */ + } + } + if (auto content_version = isdcf->optional_string_child("ContentVersion")) { + _content_versions.push_back (*content_version); + } + if (auto rating = isdcf->optional_string_child("Rating")) { + _ratings.push_back (dcp::Rating("", *rating)); + } + if (auto mastered_luminance = isdcf->optional_number_child("MasteredLuminance")) { + 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"); + _temp_version = isdcf->optional_bool_child("TempVersion").get_value_or("false"); + _pre_release = isdcf->optional_bool_child("PreRelease").get_value_or("false"); + _red_band = isdcf->optional_bool_child("RedBand").get_value_or("false"); + _two_d_version_of_three_d = isdcf->optional_bool_child("TwoDVersionOfThreeD").get_value_or("false"); + _chain = isdcf->optional_string_child("Chain"); + } + list notes; _playlist->set_from_xml (shared_from_this(), f.node_child ("Playlist"), _state_version, notes); @@ -1886,7 +1915,7 @@ void Film::use_template (string name) { _template_film.reset (new Film (optional())); - _template_film->read_metadata (Config::instance()->template_path (name)); + _template_film->read_metadata (Config::instance()->template_read_path(name)); _use_isdcf_name = _template_film->_use_isdcf_name; _dcp_content_type = _template_film->_dcp_content_type; _container = _template_film->_container;