-/** 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, bool check)
-{
- if (dcp_name().find ("/") != string::npos) {
- throw BadSettingError (_("name"), _("Cannot contain slashes"));
- }
-
- if (container() == 0) {
- throw MissingSettingError (_("container"));
- }
-
- if (content().empty()) {
- throw runtime_error (_("You must add some content to the DCP before creating it"));
- }
-
- if (length() == DCPTime()) {
- throw runtime_error (_("The DCP is empty, perhaps because all the content has zero length."));
- }
-
- if (dcp_content_type() == 0) {
- throw MissingSettingError (_("content type"));
- }
-
- if (name().empty()) {
- set_name ("DCP");
- }
-
- BOOST_FOREACH (shared_ptr<const Content> i, content ()) {
- if (!i->paths_valid()) {
- throw runtime_error (_("some of your content is missing"));
- }
- shared_ptr<const DCPContent> dcp = dynamic_pointer_cast<const DCPContent> (i);
- if (dcp && dcp->needs_kdm()) {
- throw runtime_error (_("Some of your content needs a KDM"));
- }
- if (dcp && dcp->needs_assets()) {
- throw runtime_error (_("Some of your content needs an OV"));
- }
- }
-
- set_isdcf_date_today ();
-
- BOOST_FOREACH (string i, environment_info ()) {
- LOG_GENERAL_NC (i);
- }
-
- BOOST_FOREACH (shared_ptr<const Content> i, content ()) {
- LOG_GENERAL ("Content: %1", i->technical_summary());
- }
- LOG_GENERAL ("DCP video rate %1 fps", video_frame_rate());
- if (Config::instance()->only_servers_encode ()) {
- LOG_GENERAL_NC ("0 threads: ONLY SERVERS SET TO ENCODE");
- } else {
- LOG_GENERAL ("%1 threads", Config::instance()->master_encoding_threads());
- }
- LOG_GENERAL ("J2K bandwidth %1", j2k_bandwidth());
-
- shared_ptr<TranscodeJob> tj (new TranscodeJob (shared_from_this()));
- tj->set_encoder (shared_ptr<Encoder> (new DCPEncoder (shared_from_this(), tj)));
- if (check) {
- shared_ptr<CheckContentChangeJob> cc (new CheckContentChangeJob(shared_from_this(), tj, gui));
- JobManager::instance()->add (cc);
- } else {
- JobManager::instance()->add (tj);
- }
-}
-