+ BOOST_FOREACH (SPLEntry i, spl) {
+ shared_ptr<DCPContent> dcp;
+ try {
+ dcp.reset (new DCPContent (_film, i.dcp));
+ } catch (boost::filesystem::filesystem_error& e) {
+ error_dialog (this, _("Could not load DCP"), std_to_wx (e.what()));
+ return;
+ }
+
+ if (!first) {
+ first = dcp;
+ }
+
+ _film->examine_and_add_content (dcp, true);
+ bool const ok = progress (_("Loading DCP"));
+ if (!ok || !report_errors_from_last_job()) {
+ return;
+ }
+
+ dcp->set_position (position + i.black_before);
+ position += dcp->length_after_trim() + i.black_before;
+
+ /* This DCP has been examined and loaded */
+
+ if (dcp->needs_kdm()) {
+ optional<dcp::EncryptedKDM> kdm;
+#ifdef DCPOMATIC_VARIANT_SWAROOP
+ kdm = get_kdm_from_url (dcp);
+#endif
+ if (!kdm) {
+ get_kdm_from_directory (dcp);
+ }
+
+ if (kdm) {
+ dcp->add_kdm (*kdm);
+ dcp->examine (shared_ptr<Job>());
+ }
+ }
+
+ BOOST_FOREACH (shared_ptr<TextContent> j, dcp->text) {
+ j->set_use (true);
+ }
+
+ if (dcp->video) {
+ Ratio const * r = Ratio::nearest_from_ratio(dcp->video->size().ratio());
+ if (r->id() == "239") {
+ /* Any scope content means we use scope */
+ _film->set_container(r);
+ }
+ }
+
+ /* Any 3D content means we use 3D mode */
+ if (dcp->three_d()) {
+ _film->set_three_d (true);
+ }
+
+ _viewer->set_film (_film);
+ _viewer->seek (DCPTime(), true);
+ _info->triggered_update ();
+
+ set_menu_sensitivity ();
+ _controls->log (wxString::Format(_("Load DCP %s"), i.dcp.filename().string().c_str()));
+ }