diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-01-05 01:28:19 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-01-05 17:06:21 +0100 |
| commit | 43cca4d3a11e077b3e75c713b95942cc3afc9eb1 (patch) | |
| tree | bbbf9102ec0e6fbd0cab778d9ce834cb52b5a9fc /src/wx | |
| parent | cb330f076f72000d028b11e88702addb0a2ab480 (diff) | |
Add new "territory type" so that INT-T{D,L} can be chosen (#2704).
Diffstat (limited to 'src/wx')
| -rw-r--r-- | src/wx/dcp_panel.cc | 1 | ||||
| -rw-r--r-- | src/wx/metadata_dialog.cc | 27 | ||||
| -rw-r--r-- | src/wx/metadata_dialog.h | 2 |
3 files changed, 29 insertions, 1 deletions
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 1b1cc0e36..eba5b777c 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -530,6 +530,7 @@ DCPPanel::film_changed(FilmProperty p) case FilmProperty::TWO_D_VERSION_OF_THREE_D: case FilmProperty::CHAIN: case FilmProperty::LUMINANCE: + case FilmProperty::TERRITORY_TYPE: setup_dcp_name (); break; default: diff --git a/src/wx/metadata_dialog.cc b/src/wx/metadata_dialog.cc index 4cbe7b1a4..347f2fffd 100644 --- a/src/wx/metadata_dialog.cc +++ b/src/wx/metadata_dialog.cc @@ -106,6 +106,7 @@ MetadataDialog::setup () _enable_luminance->bind(&MetadataDialog::enable_luminance_changed, this); _luminance_value->Bind (wxEVT_SPINCTRLDOUBLE, boost::bind(&MetadataDialog::luminance_changed, this)); _luminance_unit->Bind (wxEVT_CHOICE, boost::bind(&MetadataDialog::luminance_changed, this)); + _territory_type->bind(&MetadataDialog::territory_type_changed, this); _film_changed_connection = film()->Change.connect(boost::bind(&MetadataDialog::film_changed, this, _1, _2)); @@ -119,12 +120,23 @@ MetadataDialog::setup () film_changed(ChangeType::DONE, FilmProperty::TWO_D_VERSION_OF_THREE_D); film_changed(ChangeType::DONE, FilmProperty::CHAIN); film_changed(ChangeType::DONE, FilmProperty::LUMINANCE); + film_changed(ChangeType::DONE, FilmProperty::TERRITORY_TYPE); setup_sensitivity (); } void +MetadataDialog::territory_type_changed() +{ + auto data = _territory_type->get_data(); + if (data) { + film()->set_territory_type(string_to_territory_type(wx_to_std(data->data()))); + } +} + + +void MetadataDialog::film_changed(ChangeType type, FilmProperty property) { if (type != ChangeType::DONE) { @@ -180,6 +192,9 @@ MetadataDialog::film_changed(ChangeType type, FilmProperty property) checked_set(_luminance_value, 14); checked_set (_luminance_unit, 1); } + } else if (property == FilmProperty::TERRITORY_TYPE) { + _territory_type->set_by_data(territory_type_to_string(film()->territory_type())); + setup_sensitivity(); } } @@ -187,6 +202,13 @@ MetadataDialog::film_changed(ChangeType type, FilmProperty property) void MetadataDialog::setup_standard (wxPanel* panel, wxSizer* sizer) { + add_label_to_sizer(sizer, panel, _("Territory type"), true, 0, wxALIGN_CENTER_VERTICAL); + _territory_type = new Choice(panel); + _territory_type->add(_("Specific"), wx_to_std(territory_type_to_string(TerritoryType::SPECIFIC))); + _territory_type->add(_("International texted"), wx_to_std(territory_type_to_string(TerritoryType::INTERNATIONAL_TEXTED))); + _territory_type->add(_("International textless"), wx_to_std(territory_type_to_string(TerritoryType::INTERNATIONAL_TEXTLESS))); + sizer->Add(_territory_type); + _enable_release_territory = new CheckBox(panel, _("Release territory")); sizer->Add (_enable_release_territory, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_GAP); _release_territory = new RegionSubtagWidget(panel, _("Release territory for this DCP"), film()->release_territory()); @@ -230,9 +252,12 @@ MetadataDialog::release_territory_changed(optional<dcp::LanguageTag::RegionSubta void MetadataDialog::setup_sensitivity () { + auto const territory_type = film()->territory_type(); + _enable_release_territory->Enable(territory_type == TerritoryType::SPECIFIC); _sign_language_video_language->enable (film()->has_sign_language_video_channel()); auto const enabled = _enable_release_territory->GetValue(); - _release_territory->enable(enabled); + _release_territory->enable(enabled && territory_type == TerritoryType::SPECIFIC); + _ratings->Enable(territory_type == TerritoryType::SPECIFIC); _facility->Enable (_enable_facility->GetValue()); _chain->Enable (_enable_chain->GetValue()); _studio->Enable (_enable_studio->GetValue()); diff --git a/src/wx/metadata_dialog.h b/src/wx/metadata_dialog.h index 43da2ba71..5b4efb8c9 100644 --- a/src/wx/metadata_dialog.h +++ b/src/wx/metadata_dialog.h @@ -78,6 +78,7 @@ private: void luminance_changed (); std::vector<dcp::Rating> ratings () const; void set_ratings (std::vector<dcp::Rating> r); + void territory_type_changed(); CheckBox* _enable_release_territory; /** The current release territory displayed in the UI; since we can't easily convert @@ -86,6 +87,7 @@ private: */ boost::optional<dcp::LanguageTag::RegionSubtag> _release_territory_copy; RegionSubtagWidget* _release_territory; + Choice* _territory_type; LanguageTagWidget* _sign_language_video_language = nullptr; CheckBox* _enable_facility; wxTextCtrl* _facility; |
