X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffilm.cc;h=f57b6299dfd551cb99756ee4251fccf96747654c;hb=848d897596f00828cf1aa6c064d06e69bd40922c;hp=3b8199f301ce75d56ec5bde0c730229b4a1b913d;hpb=320999237a1347f984fcf4d5b4c2b0314d59ac14;p=dcpomatic.git diff --git a/src/lib/film.cc b/src/lib/film.cc index 3b8199f30..f57b6299d 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -309,7 +309,7 @@ Film::make_dcp () } if (name().empty()) { - _name = "DCP"; + set_name ("DCP"); } BOOST_FOREACH (shared_ptr i, content ()) { @@ -514,7 +514,7 @@ Film::read_metadata (optional path) } /** Given a directory name, return its full path within the Film's directory. - * @param d directory name within the Filn's directory. + * @param d directory name within the Film's directory. * @param create true to create the directory (and its parents) if they do not exist. */ boost::filesystem::path @@ -669,7 +669,7 @@ Film::isdcf_name (bool if_created_now) const /* XXX: this uses the first bit of content only */ - /* The standard says we don't do this for trailers, for some strange reason */ + /* Interior aspect ratio. The standard says we don't do this for trailers, for some strange reason */ if (dcp_content_type() && dcp_content_type()->libdcp_kind() != dcp::TRAILER) { Ratio const * content_ratio = 0; BOOST_FOREACH (shared_ptr i, content ()) { @@ -685,7 +685,8 @@ Film::isdcf_name (bool if_created_now) const } if (content_ratio && content_ratio != container()) { - d += "-" + content_ratio->isdcf_name(); + /* This needs to be the numeric version of the ratio, and ::id() is close enough */ + d += "-" + content_ratio->id(); } } @@ -1027,24 +1028,27 @@ Film::content () const return _playlist->content (); } +/** @param content Content to add. + * @param disable_audio_analysis true to never do automatic audio analysis, even if it is enabled in configuration. + */ void -Film::examine_and_add_content (shared_ptr c) +Film::examine_and_add_content (shared_ptr content, bool disable_audio_analysis) { - if (dynamic_pointer_cast (c) && _directory) { - run_ffprobe (c->path(0), file ("ffprobe.log"), _log); + if (dynamic_pointer_cast (content) && _directory) { + run_ffprobe (content->path(0), file ("ffprobe.log"), _log); } - shared_ptr j (new ExamineContentJob (shared_from_this(), c)); + shared_ptr j (new ExamineContentJob (shared_from_this(), content)); _job_connections.push_back ( - j->Finished.connect (bind (&Film::maybe_add_content, this, weak_ptr (j), weak_ptr (c))) + j->Finished.connect (bind (&Film::maybe_add_content, this, weak_ptr(j), weak_ptr(content), disable_audio_analysis)) ); JobManager::instance()->add (j); } void -Film::maybe_add_content (weak_ptr j, weak_ptr c) +Film::maybe_add_content (weak_ptr j, weak_ptr c, bool disable_audio_analysis) { shared_ptr job = j.lock (); if (!job || !job->finished_ok ()) { @@ -1058,7 +1062,7 @@ Film::maybe_add_content (weak_ptr j, weak_ptr c) add_content (content); - if (Config::instance()->automatic_audio_analysis() && content->audio) { + if (Config::instance()->automatic_audio_analysis() && content->audio && !disable_audio_analysis) { shared_ptr playlist (new Playlist); playlist->add (content); boost::signals2::connection c; @@ -1083,7 +1087,7 @@ Film::add_content (shared_ptr c) /* Take settings from the first piece of content of c's type in _template */ BOOST_FOREACH (shared_ptr i, _template_film->content()) { if (typeid(i.get()) == typeid(c.get())) { - c->use_template (i); + c->take_settings_from (i); } } }