diff options
| author | Carl Hetherington <cth@carlh.net> | 2026-03-08 00:55:00 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2026-03-08 00:55:00 +0100 |
| commit | 5211b423bffb59c2001d1f8a97e256a01b447b34 (patch) | |
| tree | da0adfd056e015e261697cae1590c84b5cb95248 | |
| parent | e310b50c80eb218ea296483ddfac0859c9c5ab80 (diff) | |
Require "non-standard" config checkbox to use MPEG2.
Carsten reports that some users were choosing it because it sounded
familiar.
| -rw-r--r-- | src/lib/config.cc | 4 | ||||
| -rw-r--r-- | src/lib/config.h | 9 | ||||
| -rw-r--r-- | src/wx/dcp_panel.cc | 7 | ||||
| -rw-r--r-- | src/wx/full_config_dialog.cc | 17 |
4 files changed, 36 insertions, 1 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index a2469ed8a..b0239b4bb 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -217,6 +217,7 @@ Config::set_defaults() _auto_crop_threshold = 0.1; _last_release_notes_version = boost::none; _allow_smpte_bv20 = false; + _allow_mpeg2 = false; _isdcf_name_part_length = 14; _enable_player_http_server = false; _player_http_server_port = 8080; @@ -657,6 +658,7 @@ try } _allow_smpte_bv20 = f.optional_bool_child("AllowSMPTEBv20").get_value_or(false); + _allow_mpeg2 = f.optional_bool_child("AllowMPEG2").get_value_or(false); _isdcf_name_part_length = f.optional_number_child<int>("ISDCFNamePartLength").get_value_or(14); _enable_player_http_server = f.optional_bool_child("EnablePlayerHTTPServer").get_value_or(false); _player_http_server_port = f.optional_number_child<int>("PlayerHTTPServerPort").get_value_or(8080); @@ -1141,6 +1143,8 @@ Config::write_config() const /* [XML] AllowSMPTEBv20 1 to allow the user to choose SMPTE (Bv2.0 only) as a standard, otherwise 0 */ cxml::add_text_child(root, "AllowSMPTEBv20", _allow_smpte_bv20 ? "1" : "0"); + /* [XML] AllowMPEG2 1 to allow the user to choose MPEG2 Interop as a standard, otherwise 0 */ + cxml::add_text_child(root, "AllowMPEG2", _allow_mpeg2 ? "1" : "0"); /* [XML] ISDCFNamePartLength Maximum length of the "name" part of an ISDCF name, which should be 14 according to the standard */ cxml::add_text_child(root, "ISDCFNamePartLength", fmt::to_string(_isdcf_name_part_length)); /* [XML] EnablePlayerHTTPServer 1 to enable a HTTP server to control the player, otherwise 0 */ diff --git a/src/lib/config.h b/src/lib/config.h index abe97d2d4..e628c840c 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -644,6 +644,10 @@ public: return _allow_smpte_bv20; } + bool allow_mpeg2() const { + return _allow_mpeg2; + } + #ifdef DCPOMATIC_GROK class Grok { @@ -1237,6 +1241,10 @@ public: maybe_set(_allow_smpte_bv20, allow, ALLOW_SMPTE_BV20); } + void set_allow_mpeg2(bool allow) { + maybe_set(_allow_mpeg2, allow, ALLOW_SMPTE_BV20); + } + #ifdef DCPOMATIC_GROK void set_grok(Grok const& grok); #endif @@ -1502,6 +1510,7 @@ private: boost::optional<int> _main_content_divider_sash_position; DefaultAddFileLocation _default_add_file_location; bool _allow_smpte_bv20; + bool _allow_mpeg2; int _isdcf_name_part_length; bool _enable_player_http_server; int _player_http_server_port; diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index b0c4bd88d..8f5c8fe7f 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -172,7 +172,12 @@ DCPPanel::update_standards() _standard->add_entry(_("Interop"), string{"interop"}); } - if (!ref && !atmos) { + bool allow_mpeg2 = Config::instance()->allow_mpeg2(); +#ifdef DCPOMATIC_VARIANT_POST + allow_mpeg2 = true; +#endif + + if (allow_mpeg2 && !ref && !atmos) { _standard->add_entry(_("MPEG2 Interop"), string{"mpeg2-interop"}); } diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc index d3dc096e0..89d49e5ef 100644 --- a/src/wx/full_config_dialog.cc +++ b/src/wx/full_config_dialog.cc @@ -1075,6 +1075,9 @@ private: 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); +#if !defined(DCPOMATIC_VARIANT_POST) + checkbox(_("Allow use of MPEG2 Interop"), _allow_mpeg2); +#endif { add_label_to_sizer(table, _panel, _("ISDCF name part length"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); @@ -1093,6 +1096,9 @@ private: _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); +#if !defined(DCPOMATIC_VARIANT_POST) + _allow_mpeg2->bind(&NonStandardPage::allow_mpeg2_changed, this); +#endif _isdcf_name_part_length->SetRange(1, 256); _isdcf_name_part_length->Bind(wxEVT_SPINCTRL, boost::bind(&NonStandardPage::isdcf_name_part_length_changed, this)); } @@ -1108,6 +1114,9 @@ private: 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()); +#if !defined(DCPOMATIC_VARIANT_POST) + checked_set(_allow_mpeg2, config->allow_mpeg2()); +#endif checked_set(_isdcf_name_part_length, config->isdcf_name_part_length()); } @@ -1146,6 +1155,13 @@ private: Config::instance()->set_allow_smpte_bv20(_allow_smpte_bv20->GetValue()); } +#if !defined(DCPOMATIC_VARIANT_POST) + void allow_mpeg2_changed() + { + Config::instance()->set_allow_mpeg2(_allow_mpeg2->GetValue()); + } +#endif + void isdcf_name_part_length_changed() { Config::instance()->set_isdcf_name_part_length(_isdcf_name_part_length->GetValue()); @@ -1158,6 +1174,7 @@ private: CheckBox* _allow_96khz_audio = nullptr; CheckBox* _use_all_audio_channels = nullptr; CheckBox* _allow_smpte_bv20 = nullptr; + CheckBox* _allow_mpeg2 = nullptr; wxSpinCtrl* _isdcf_name_part_length = nullptr; }; |
