- DCPTime position;
- shared_ptr<DCPContent> first;
-
- 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<Content> i, _film->content()) {
+ shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent>(i);