+ void film_changed (ChangeType type, Film::Property property)
+ {
+ if (type != CHANGE_TYPE_DONE || property != Film::CONTENT) {
+ return;
+ }
+
+ _film->write_metadata (Config::path("spl.xml"));
+
+ if (_viewer->playing ()) {
+ _viewer->stop ();
+ }
+
+ /* Start off as Flat */
+ _film->set_container (Ratio::from_id("185"));
+
+ BOOST_FOREACH (shared_ptr<Content> i, _film->content()) {
+ shared_ptr<DCPContent> dcp = dynamic_pointer_cast<DCPContent>(i);
+ if (dcp && dcp->needs_kdm()) {
+ optional<dcp::EncryptedKDM> kdm;
+#ifdef DCPOMATIC_VARIANT_SWAROOP
+ kdm = get_kdm_from_url (dcp);
+#endif
+ if (!kdm) {
+ kdm = get_kdm_from_directory (dcp);
+ }
+
+ if (kdm) {
+ dcp->add_kdm (*kdm);
+ dcp->examine (_film, shared_ptr<Job>());
+ }
+ }
+
+ BOOST_FOREACH (shared_ptr<TextContent> j, i->text) {
+ j->set_use (true);
+ }
+
+ if (i->video) {
+ Ratio const * r = Ratio::nearest_from_ratio(i->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 (i->video && i->video->frame_type() != VIDEO_FRAME_TYPE_2D) {
+ _film->set_three_d (true);
+ }
+ }
+
+ _viewer->seek (DCPTime(), true);
+ _info->triggered_update ();