Check consistency of refer-to-DCP settings after adding content (#1456).
authorCarl Hetherington <cth@carlh.net>
Thu, 31 Jan 2019 17:04:18 +0000 (17:04 +0000)
committerCarl Hetherington <cth@carlh.net>
Thu, 31 Jan 2019 17:04:18 +0000 (17:04 +0000)
src/lib/film.cc
src/lib/film.h
src/tools/dcpomatic.cc

index f4745d0995597d2e17a91fee185a26d187d8f2bf..e7861a032c12ce1a3688454b0febe533e827b4cb 100644 (file)
@@ -1220,6 +1220,31 @@ Film::playlist_change (ChangeType type)
 {
        signal_change (type, CONTENT);
        signal_change (type, NAME);
+
+       if (type == CHANGE_TYPE_DONE) {
+               /* Check that this change hasn't made our settings inconsistent */
+               bool change_made = false;
+               BOOST_FOREACH (shared_ptr<Content> i, content()) {
+                       shared_ptr<DCPContent> d = dynamic_pointer_cast<DCPContent>(i);
+                       if (!d) {
+                               continue;
+                       }
+
+                       string why_not;
+                       if (d->reference_video() && !d->can_reference_video(shared_from_this(), why_not)) {
+                               d->set_reference_video(false);
+                               change_made = true;
+                       }
+                       if (d->reference_audio() && !d->can_reference_audio(shared_from_this(), why_not)) {
+                               d->set_reference_audio(false);
+                               change_made = true;
+                       }
+               }
+
+               if (change_made) {
+                       Message (_("DCP-o-matic had to change your settings for referring to DCPs as OV.  Please review those settings to make sure they are what you want."));
+               }
+       }
 }
 
 void
index 7fdd4d269eaa8c679002a13bdb3f81c4a8cc743b..b77ce7a7651099dfd4334381002613b824207af4 100644 (file)
@@ -334,6 +334,9 @@ public:
        /** Emitted when some property of our content has changed */
        mutable boost::signals2::signal<void (ChangeType, boost::weak_ptr<Content>, int, bool)> ContentChange;
 
+       /** Emitted when we have something important to tell the user */
+       boost::signals2::signal<void (std::string)> Message;
+
        /** Current version number of the state file */
        static int const current_state_version;
 
index 2e8a595ad206cf1fd778afab8123df15a5397f6b..db3d2205215bbe5cbaa344239ad5809a081d6221 100644 (file)
@@ -457,6 +457,7 @@ public:
                }
                if (_film) {
                        _film->Change.connect (boost::bind (&DOMFrame::film_change, this, _1));
+                       _film->Message.connect (boost::bind(&DOMFrame::film_message, this, _1));
                }
        }
 
@@ -466,6 +467,11 @@ public:
 
 private:
 
+       void film_message (string m)
+       {
+               message_dialog (this, std_to_wx(m));
+       }
+
        void film_change (ChangeType type)
        {
                if (type == CHANGE_TYPE_DONE) {