summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-03-01 01:26:49 +0100
committerCarl Hetherington <cth@carlh.net>2023-03-03 01:49:55 +0100
commit34b2b0fe412332505e3d543358c9741bd068602d (patch)
treef83f2dad55f17a9b03c6fb105995dd045e8a5d4c /src/wx
parent03d6d6a8e7bcb7b2bfa920841ac7421f08dcc9b6 (diff)
Add option to limit DCP output to the "Bv2.0 profile" (#2470).v2.16.45
I'm far from convinced about the point/sense of all these "profiles" (rather than just implementing or at least tolerating the standard) but lots of people are having problems with "QC" processes failing their DCPs with complaints related to MCASubDescriptors. It seems to make sense to have an option to turn them off - at least for now, until either the "QC" situation settles down or any bugs in DCP-o-matic are found and fixed.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/dcp_panel.cc81
-rw-r--r--src/wx/dcp_panel.h2
-rw-r--r--src/wx/full_config_dialog.cc9
3 files changed, 78 insertions, 14 deletions
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc
index 19f26d9d0..3e1210543 100644
--- a/src/wx/dcp_panel.cc
+++ b/src/wx/dcp_panel.cc
@@ -154,8 +154,7 @@ DCPPanel::DCPPanel(wxNotebook* n, shared_ptr<Film> film, FilmViewer& viewer)
_reel_length->SetRange (1, 64);
- _standard->add(_("SMPTE"));
- _standard->add(_("Interop"));
+ add_standards();
_standard->SetToolTip(_("Which standard the DCP should use. Interop is older and SMPTE is the modern standard. If in doubt, choose 'SMPTE'"));
Config::instance()->Changed.connect (boost::bind(&DCPPanel::config_changed, this, _1));
@@ -163,6 +162,57 @@ DCPPanel::DCPPanel(wxNotebook* n, shared_ptr<Film> film, FilmViewer& viewer)
add_to_grid ();
}
+
+void
+DCPPanel::add_standards()
+{
+ _standard->add(_("SMPTE"), N_("smpte"));
+ if (Config::instance()->allow_smpte_bv20() || (_film && _film->limit_to_smpte_bv20())) {
+ _standard->add(_("SMPTE (Bv2.0 only)"), N_("smpte-bv20"));
+ }
+ _standard->add(_("Interop"), N_("interop"));
+}
+
+
+void
+DCPPanel::set_standard()
+{
+ DCPOMATIC_ASSERT(_film);
+ DCPOMATIC_ASSERT(!_film->limit_to_smpte_bv20() || _standard->GetCount() == 3);
+
+ if (_film->interop()) {
+ checked_set(_standard, "interop");
+ } else {
+ checked_set(_standard, _film->limit_to_smpte_bv20() ? "smpte-bv20" : "smpte");
+ }
+}
+
+
+void
+DCPPanel::standard_changed ()
+{
+ if (!_film || !_standard->get()) {
+ return;
+ }
+
+ auto const data = _standard->get_data();
+ if (!data) {
+ return;
+ }
+
+ if (*data == N_("interop")) {
+ _film->set_interop(true);
+ _film->set_limit_to_smpte_bv20(false);
+ } else if (*data == N_("smpte")) {
+ _film->set_interop(false);
+ _film->set_limit_to_smpte_bv20(false);
+ } else if (*data == N_("smpte-bv20")) {
+ _film->set_interop(false);
+ _film->set_limit_to_smpte_bv20(true);
+ }
+}
+
+
void
DCPPanel::add_to_grid ()
{
@@ -316,17 +366,6 @@ DCPPanel::resolution_changed ()
void
-DCPPanel::standard_changed ()
-{
- if (!_film || !_standard->get()) {
- return;
- }
-
- _film->set_interop(*_standard->get() == 1);
-
-}
-
-void
DCPPanel::markers_clicked ()
{
_markers_dialog.reset(_panel, _film, _viewer);
@@ -434,10 +473,13 @@ DCPPanel::film_changed (Film::Property p)
checked_set (_reencode_j2k, _film->reencode_j2k());
break;
case Film::Property::INTEROP:
- checked_set (_standard, _film->interop() ? 1 : 0);
+ set_standard();
setup_dcp_name ();
_markers->Enable (!_film->interop());
break;
+ case Film::Property::LIMIT_TO_SMPTE_BV20:
+ set_standard();
+ break;
case Film::Property::AUDIO_PROCESSOR:
if (_film->audio_processor()) {
checked_set (_audio_processor, _film->audio_processor()->id());
@@ -587,6 +629,9 @@ DCPPanel::set_film (shared_ptr<Film> film)
return;
}
+ _standard->Clear();
+ add_standards();
+
film_changed (Film::Property::NAME);
film_changed (Film::Property::USE_ISDCF_NAME);
film_changed (Film::Property::CONTENT);
@@ -606,6 +651,7 @@ DCPPanel::set_film (shared_ptr<Film> film)
film_changed (Film::Property::REENCODE_J2K);
film_changed (Film::Property::AUDIO_LANGUAGE);
film_changed (Film::Property::AUDIO_FRAME_RATE);
+ film_changed (Film::Property::LIMIT_TO_SMPTE_BV20);
set_general_sensitivity(static_cast<bool>(_film));
}
@@ -726,6 +772,13 @@ DCPPanel::config_changed (Config::Property p)
if (_film) {
film_changed (Film::Property::AUDIO_PROCESSOR);
}
+ } else if (p == Config::ALLOW_SMPTE_BV20) {
+ _standard->Clear();
+ add_standards();
+ if (_film) {
+ film_changed(Film::Property::INTEROP);
+ film_changed(Film::Property::LIMIT_TO_SMPTE_BV20);
+ }
}
}
diff --git a/src/wx/dcp_panel.h b/src/wx/dcp_panel.h
index cd39f2d1e..6635d4a29 100644
--- a/src/wx/dcp_panel.h
+++ b/src/wx/dcp_panel.h
@@ -98,6 +98,8 @@ private:
void add_video_panel_to_grid ();
void add_audio_panel_to_grid ();
void add_audio_processors ();
+ void add_standards();
+ void set_standard();
int minimum_allowed_audio_channels () const;
diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc
index 59c1d4c9f..ec098ad32 100644
--- a/src/wx/full_config_dialog.cc
+++ b/src/wx/full_config_dialog.cc
@@ -1544,6 +1544,7 @@ 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);
_maximum_j2k_bandwidth->SetRange(1, 1000);
_maximum_j2k_bandwidth->Bind(wxEVT_SPINCTRL, boost::bind(&NonStandardPage::maximum_j2k_bandwidth_changed, this));
@@ -1551,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
@@ -1562,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()
@@ -1589,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;
};