X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffilm.cc;h=dafe158b050f9618e5c935dd07126dee51643586;hb=ca981c8cfa23111e92be329f1c2dfbe3a07b4247;hp=2aaeafca668382d0ae0042a3190b98b19ab0d8de;hpb=8755ef75cb001cf7fba230ffa98fb40eb2547849;p=dcpomatic.git diff --git a/src/lib/film.cc b/src/lib/film.cc index 2aaeafca6..dafe158b0 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -23,6 +23,7 @@ * how they should be presented in a DCP. */ +#include "atmos_content.h" #include "film.h" #include "job.h" #include "util.h" @@ -160,7 +161,6 @@ Film::Film (optional dir) , _audio_processor (0) , _reel_type (REELTYPE_SINGLE) , _reel_length (2000000000) - , _upload_after_make_dcp (Config::instance()->default_upload_after_make_dcp()) , _reencode_j2k (false) , _user_explicit_video_frame_rate (false) , _user_explicit_container (false) @@ -454,7 +454,6 @@ Film::metadata (bool with_content_paths) const } root->add_child("ReelType")->add_child_text (raw_convert (static_cast (_reel_type))); root->add_child("ReelLength")->add_child_text (raw_convert (_reel_length)); - root->add_child("UploadAfterMakeDCP")->add_child_text (_upload_after_make_dcp ? "1" : "0"); root->add_child("ReencodeJ2K")->add_child_text (_reencode_j2k ? "1" : "0"); root->add_child("UserExplicitVideoFrameRate")->add_child_text(_user_explicit_video_frame_rate ? "1" : "0"); for (map::const_iterator i = _markers.begin(); i != _markers.end(); ++i) { @@ -602,7 +601,6 @@ Film::read_metadata (optional path) _reel_type = static_cast (f.optional_number_child("ReelType").get_value_or (static_cast(REELTYPE_SINGLE))); _reel_length = f.optional_number_child("ReelLength").get_value_or (2000000000); - _upload_after_make_dcp = f.optional_bool_child("UploadAfterMakeDCP").get_value_or (false); _reencode_j2k = f.optional_bool_child("ReencodeJ2K").get_value_or(false); _user_explicit_video_frame_rate = f.optional_bool_child("UserExplicitVideoFrameRate").get_value_or(false); @@ -1084,13 +1082,6 @@ Film::set_reel_length (int64_t r) _reel_length = r; } -void -Film::set_upload_after_make_dcp (bool u) -{ - ChangeSignaller ch (this, UPLOAD_AFTER_MAKE_DCP); - _upload_after_make_dcp = u; -} - void Film::set_reencode_j2k (bool r) { @@ -1208,13 +1199,6 @@ Film::set_encrypted (bool e) _encrypted = e; } -void -Film::set_key (dcp::Key key) -{ - ChangeSignaller ch (this, KEY); - _key = key; -} - ContentList Film::content () const { @@ -1414,6 +1398,21 @@ Film::playlist_change (ChangeType type) void Film::check_settings_consistency () { + optional atmos_rate; + BOOST_FOREACH (shared_ptr i, content()) { + + if (i->atmos) { + int rate = lrintf (i->atmos->edit_rate().as_float()); + if (atmos_rate && *atmos_rate != rate) { + Message (_("You have more than one piece of Atmos content, and they do not have the same frame rate. You must remove some Atmos content.")); + } else if (!atmos_rate && rate != video_frame_rate()) { + atmos_rate = rate; + set_video_frame_rate (rate, false); + Message (_("DCP-o-matic had to change your settings so that the film's frame rate is the same as that of your Atmos content.")); + } + } + } + bool change_made = false; BOOST_FOREACH (shared_ptr i, content()) { shared_ptr d = dynamic_pointer_cast(i); @@ -1755,7 +1754,6 @@ Film::use_template (string name) _audio_processor = _template_film->_audio_processor; _reel_type = _template_film->_reel_type; _reel_length = _template_film->_reel_length; - _upload_after_make_dcp = _template_film->_upload_after_make_dcp; _isdcf_metadata = _template_film->_isdcf_metadata; } @@ -1797,6 +1795,18 @@ Film::references_dcp_audio () const return false; } + +bool +Film::contains_atmos_content () const +{ + BOOST_FOREACH (shared_ptr i, _playlist->content()) { + if (i->atmos) { + return true; + } + } +} + + list Film::closed_caption_tracks () const {