Limit KDM types depending on DCP standard.
authorCarl Hetherington <cth@carlh.net>
Wed, 16 Jul 2014 09:30:57 +0000 (10:30 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 16 Jul 2014 09:30:57 +0000 (10:30 +0100)
ChangeLog
src/wx/kdm_dialog.cc

index b7daf3e0cca4484b8ed7b21e69591e1feee1872a..d9295894a5c01415cba2a23f4553a318eba62582 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-07-16  Carl Hetherington  <cth@carlh.net>
 
+       * Limit allowed KDM types based on Interop/SMPTE setting
+       of DCP (#385).
+
        * Updates to fr_FR from GrĂ©goire Ausina.
 
 2014-07-14  Carl Hetherington  <cth@carlh.net>
index 8df94de9c5f06a986213d479d56e5463d83df51d..a7af7978ca48b65aba8629651917d9cfcbb51892 100644 (file)
@@ -161,9 +161,11 @@ KDMDialog::KDMDialog (wxWindow* parent, boost::shared_ptr<const Film> film)
 
        add_label_to_sizer (table, this, _("KDM type"), true);
        _type = new wxChoice (this, wxID_ANY);
-       _type->Append ("Modified Transitional 1");
-       _type->Append ("DCI Any");
-       _type->Append ("DCI Specific");
+       _type->Append ("Modified Transitional 1", ((void *) libdcp::KDM::MODIFIED_TRANSITIONAL_1));
+       if (!film->interop ()) {
+               _type->Append ("DCI Any", ((void *) libdcp::KDM::DCI_ANY));
+               _type->Append ("DCI Specific", ((void *) libdcp::KDM::DCI_SPECIFIC));
+       }
        table->Add (_type, 1, wxEXPAND);
        _type->SetSelection (0);
 
@@ -491,16 +493,7 @@ KDMDialog::write_to () const
 libdcp::KDM::Formulation
 KDMDialog::formulation () const
 {
-       switch (_type->GetSelection()) {
-       case 0:
-               return libdcp::KDM::MODIFIED_TRANSITIONAL_1;
-       case 1:
-               return libdcp::KDM::DCI_ANY;
-       case 2:
-               return libdcp::KDM::DCI_SPECIFIC;
-       default:
-               assert (false);
-       }
+       return (libdcp::KDM::Formulation) reinterpret_cast<long int> (_type->GetClientData (_type->GetSelection()));
 }
 
 void