diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-04-02 23:45:19 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-04-04 20:48:35 +0200 |
| commit | ea51ac3483161343b7aefabe54420c6cb431c0fe (patch) | |
| tree | d795c52c13989af628a28abad11d91c2d14f2405 /src/wx/metadata_dialog.cc | |
| parent | 48bfa4b2040d2bacd6befdab6c12b2ee3e9be5a1 (diff) | |
Use studio and facility from Interop/SMPTE metadata rather than ISDCF.
Diffstat (limited to 'src/wx/metadata_dialog.cc')
| -rw-r--r-- | src/wx/metadata_dialog.cc | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/wx/metadata_dialog.cc b/src/wx/metadata_dialog.cc index 376591ca2..17151161c 100644 --- a/src/wx/metadata_dialog.cc +++ b/src/wx/metadata_dialog.cc @@ -72,9 +72,18 @@ MetadataDialog::setup () overall_sizer->Layout (); overall_sizer->SetSizeHints (this); + _enable_facility->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::enable_facility_changed, this)); + _facility->Bind (wxEVT_TEXT, boost::bind(&MetadataDialog::facility_changed, this)); + _enable_studio->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::enable_studio_changed, this)); + _studio->Bind (wxEVT_TEXT, boost::bind(&MetadataDialog::studio_changed, this)); + _film_changed_connection = film()->Change.connect(boost::bind(&MetadataDialog::film_changed, this, _1, _2)); film_changed (ChangeType::DONE, Film::Property::RELEASE_TERRITORY); + film_changed (ChangeType::DONE, Film::Property::FACILITY); + film_changed (ChangeType::DONE, Film::Property::STUDIO); + + setup_sensitivity (); } @@ -92,6 +101,16 @@ MetadataDialog::film_changed (ChangeType type, Film::Property property) _release_territory = *rt; checked_set (_release_territory_text, std_to_wx(*dcp::LanguageTag::get_subtag_description(*_release_territory))); } + } else if (property == Film::Property::FACILITY) { + checked_set (_enable_facility, static_cast<bool>(film()->facility())); + if (film()->facility()) { + checked_set (_facility, *film()->facility()); + } + } else if (property == Film::Property::STUDIO) { + checked_set (_enable_studio, static_cast<bool>(film()->studio())); + if (film()->studio()) { + checked_set (_studio, *film()->studio()); + } } } @@ -136,6 +155,8 @@ MetadataDialog::setup_sensitivity () auto const enabled = _enable_release_territory->GetValue(); _release_territory_text->Enable (enabled); _edit_release_territory->Enable (enabled); + _facility->Enable (_enable_facility->GetValue()); + _studio->Enable (_enable_studio->GetValue()); } @@ -150,3 +171,57 @@ MetadataDialog::enable_release_territory_changed () } } + +void +MetadataDialog::setup_advanced (wxPanel* panel, wxSizer* sizer) +{ + _enable_facility = new wxCheckBox (panel, wxID_ANY, _("Facility")); + sizer->Add (_enable_facility, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL); + _facility = new wxTextCtrl (panel, wxID_ANY); + sizer->Add (_facility, 1, wxEXPAND); + + _enable_studio = new wxCheckBox (panel, wxID_ANY, _("Studio")); + sizer->Add (_enable_studio, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL); + _studio = new wxTextCtrl (panel, wxID_ANY); + sizer->Add (_studio, 1, wxEXPAND); +} + + +void +MetadataDialog::facility_changed () +{ + film()->set_facility (wx_to_std(_facility->GetValue())); +} + + +void +MetadataDialog::enable_facility_changed () +{ + setup_sensitivity (); + if (_enable_facility->GetValue()) { + film()->set_facility (wx_to_std(_facility->GetValue())); + } else { + film()->set_facility (); + } +} + + +void +MetadataDialog::studio_changed () +{ + film()->set_studio (wx_to_std(_studio->GetValue())); +} + + +void +MetadataDialog::enable_studio_changed () +{ + setup_sensitivity (); + if (_enable_studio->GetValue()) { + film()->set_studio (wx_to_std(_studio->GetValue())); + } else { + film()->set_studio (); + } +} + + |
