Add option to limit DCP output to the "Bv2.0 profile" (#2470).
[dcpomatic.git] / src / wx / full_config_dialog.cc
index 4dff7b5bf780cb9916f78e55dcc614e65307335d..ec098ad3226d4cc0e687e2bdc181c5ba95f99654 100644 (file)
@@ -1524,9 +1524,13 @@ private:
                        table->Add(s, 1);
                }
 
-               _allow_any_dcp_frame_rate = new CheckBox(_panel, _("Allow any DCP frame rate"));
-               table->Add(_allow_any_dcp_frame_rate, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP);
-               table->AddSpacer(0);
+               auto checkbox = [this, table](wxString name, CheckBox*& variable) {
+                       variable = new CheckBox(_panel, name);
+                       table->Add(variable, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP);
+                       table->AddSpacer(0);
+               };
+
+               checkbox(_("Allow any DCP frame rate"),  _allow_any_dcp_frame_rate);
 
                _allow_any_container = new CheckBox(_panel, _("Allow full-frame and non-standard container ratios"));
                table->Add(_allow_any_container, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP);
@@ -1538,13 +1542,9 @@ private:
                table->Add(restart, 1, wxALIGN_CENTRE_VERTICAL | wxBOTTOM, DCPOMATIC_CHECKBOX_BOTTOM_PAD);
                restart->SetFont(font);
 
-               _allow_96khz_audio = new CheckBox(_panel, _("Allow creation of DCPs with 96kHz audio"));
-               table->Add(_allow_96khz_audio, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP);
-               table->AddSpacer (0);
-
-               _use_all_audio_channels = new CheckBox(_panel, _("Allow mapping to all audio channels"));
-               table->Add(_use_all_audio_channels, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP);
-               table->AddSpacer(0);
+               checkbox(_("Allow creation of DCPs with 96kHz audio"), _allow_96khz_audio);
+               checkbox(_("Allow mapping to all audio channels"), _use_all_audio_channels);
+               checkbox(_("Allow use of SMPTE Bv2.0"), _allow_smpte_bv20);
 
                _maximum_j2k_bandwidth->SetRange(1, 1000);
                _maximum_j2k_bandwidth->Bind(wxEVT_SPINCTRL, boost::bind(&NonStandardPage::maximum_j2k_bandwidth_changed, this));
@@ -1552,6 +1552,7 @@ private:
                _allow_any_container->bind(&NonStandardPage::allow_any_container_changed, this);
                _allow_96khz_audio->bind(&NonStandardPage::allow_96khz_audio_changed, this);
                _use_all_audio_channels->bind(&NonStandardPage::use_all_channels_changed, this);
+               _allow_smpte_bv20->bind(&NonStandardPage::allow_smpte_bv20_changed, this);
        }
 
        void config_changed() override
@@ -1563,6 +1564,7 @@ private:
                checked_set(_allow_any_container, config->allow_any_container());
                checked_set(_allow_96khz_audio, config->allow_96khz_audio());
                checked_set(_use_all_audio_channels, config->use_all_audio_channels());
+               checked_set(_allow_smpte_bv20, config->allow_smpte_bv20());
        }
 
        void maximum_j2k_bandwidth_changed()
@@ -1590,11 +1592,17 @@ private:
                Config::instance()->set_use_all_audio_channels(_use_all_audio_channels->GetValue());
        }
 
+       void allow_smpte_bv20_changed()
+       {
+               Config::instance()->set_allow_smpte_bv20(_allow_smpte_bv20->GetValue());
+       }
+
        wxSpinCtrl* _maximum_j2k_bandwidth = nullptr;
        CheckBox* _allow_any_dcp_frame_rate = nullptr;
        CheckBox* _allow_any_container = nullptr;
        CheckBox* _allow_96khz_audio = nullptr;
        CheckBox* _use_all_audio_channels = nullptr;
+       CheckBox* _allow_smpte_bv20 = nullptr;
 };