Hint when there may be a better DCP container option (#392).
authorCarl Hetherington <cth@carlh.net>
Sun, 31 Aug 2014 16:21:09 +0000 (17:21 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 31 Aug 2014 16:21:09 +0000 (17:21 +0100)
ChangeLog
src/wx/hints_dialog.cc

index ec754c77b1249ad6660ad85c09666a19e3afc46a..e668225977d9c86550dae51bfb917ad395ffa83f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-08-31  Carl Hetherington  <cth@carlh.net>
 
+       * Give a hint when content and container aspect ratios are not
+       the same (#392).
+
        * Add "copy" button to colour conversion presets editor (#399).
 
        * Allow drag-and-drop of files onto the content list (#395).
index 668d713216e8ad49b1a40a8a9acd41b0ab7e62fd..74ac055082461c7897b58a0248e35785f9451858 100644 (file)
 #include <boost/algorithm/string.hpp>
 #include <wx/richtext/richtextctrl.h>
 #include "lib/film.h"
+#include "lib/ratio.h"
 #include "hints_dialog.h"
 
+using boost::shared_ptr;
+using boost::dynamic_pointer_cast;
+
 HintsDialog::HintsDialog (wxWindow* parent, boost::weak_ptr<Film> f)
        : wxDialog (parent, wxID_ANY, _("Hints"))
        , _film (f)
@@ -44,6 +48,7 @@ HintsDialog::HintsDialog (wxWindow* parent, boost::weak_ptr<Film> f)
        boost::shared_ptr<Film> film = _film.lock ();
        if (film) {
                film->Changed.connect (boost::bind (&HintsDialog::film_changed, this));
+               film->ContentChanged.connect (boost::bind (&HintsDialog::film_changed, this));
        }
 
        film_changed ();
@@ -71,13 +76,39 @@ HintsDialog::film_changed ()
                _text->Newline ();
        }
 
+       ContentList content = film->content ();
+       int flat_or_narrower = 0;
+       int scope = 0;
+       for (ContentList::const_iterator i = content.begin(); i != content.end(); ++i) {
+               shared_ptr<VideoContent> vc = dynamic_pointer_cast<VideoContent> (*i);
+               if (vc) {
+                       Ratio const * r = vc->scale().ratio ();
+                       if (r && r->id() == "239") {
+                               ++scope;
+                       } else if (r && r->id() != "239" && r->id() != "full-frame") {
+                               ++flat_or_narrower;
+                       }
+               }
+       }
+
+       if (scope && !flat_or_narrower && film->container()->id() == "185") {
+               hint = true;
+               _text->WriteText (_("All of your content is in Scope (2.39:1) but your DCP's container is Flat (1.85:1).  This will letter-box your content inside a Flat (1.85:1) frame.  You may prefer to set your DCP's container to Scope (2.39:1) in the \"DCP\" tab."));
+               _text->Newline ();
+       }
+
+       if (!scope && flat_or_narrower && film->container()->id() == "239") {
+               hint = true;
+               _text->WriteText (_("All of your content is at 1.85:1 or narrower but your DCP's container is Scope (2.39:1).  This will pillar-box your content inside a Flat (1.85:1) frame.  You may prefer to set your DCP's container to Flat (1.85:1) in the \"DCP\" tab."));
+               _text->Newline ();
+       }
+       
        if (film->video_frame_rate() != 24 && film->video_frame_rate() != 48) {
                hint = true;
                _text->WriteText (wxString::Format (_("Your DCP frame rate (%d fps) may cause problems in a few (mostly older) projectors.  Use 24 or 48 frames per second to be on the safe side."), film->video_frame_rate()));
                _text->Newline ();
        }
 
-       ContentList content = film->content ();
        int vob = 0;
        for (ContentList::const_iterator i = content.begin(); i != content.end(); ++i) {
                if (boost::algorithm::starts_with ((*i)->path(0).filename().string(), "VTS_")) {