From 0d9831021c7dc508bc69f7bd759dacd50ccb2766 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 2 Apr 2021 20:55:40 +0200 Subject: Use content version from Interop (or version number from SMPTE metadata) rather than the content version in the ISDCF metadata dialogue. --- src/lib/film.cc | 13 ++++++++++++- src/lib/isdcf_metadata.cc | 7 ++----- src/lib/isdcf_metadata.h | 4 +--- 3 files changed, 15 insertions(+), 9 deletions(-) (limited to 'src/lib') diff --git a/src/lib/film.cc b/src/lib/film.cc index 7dd0ff6f1..5ccc5437a 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -846,7 +846,18 @@ Film::isdcf_name (bool if_created_now) const if (dcp_content_type()) { d += "_" + dcp_content_type()->isdcf_name(); - d += "-" + raw_convert(isdcf_metadata().content_version); + string version = "1"; + if (_interop) { + if (!_content_versions.empty()) { + auto cv = _content_versions[0]; + if (!cv.empty() && std::all_of(cv.begin(), cv.end(), isdigit)) { + version = cv; + } + } + } else { + version = dcp::raw_convert(_version_number); + } + d += "-" + version; } auto const dm = isdcf_metadata (); diff --git a/src/lib/isdcf_metadata.cc b/src/lib/isdcf_metadata.cc index 6adbd0f3c..4f157ce70 100644 --- a/src/lib/isdcf_metadata.cc +++ b/src/lib/isdcf_metadata.cc @@ -34,8 +34,7 @@ using std::shared_ptr; using dcp::raw_convert; ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node) - : content_version (node->number_child ("ContentVersion")) - , territory (node->string_child ("Territory")) + : territory (node->string_child ("Territory")) , rating (node->string_child ("Rating")) , studio (node->string_child ("Studio")) , facility (node->string_child ("Facility")) @@ -53,7 +52,6 @@ ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node) void ISDCFMetadata::as_xml (xmlpp::Node* root) const { - root->add_child("ContentVersion")->add_child_text (raw_convert (content_version)); root->add_child("Territory")->add_child_text (territory); root->add_child("Rating")->add_child_text (rating); root->add_child("Studio")->add_child_text (studio); @@ -69,8 +67,7 @@ ISDCFMetadata::as_xml (xmlpp::Node* root) const bool operator== (ISDCFMetadata const & a, ISDCFMetadata const & b) { - return a.content_version == b.content_version && - a.territory == b.territory && + return a.territory == b.territory && a.rating == b.rating && a.studio == b.studio && a.facility == b.facility && diff --git a/src/lib/isdcf_metadata.h b/src/lib/isdcf_metadata.h index fd021b8dc..22c418c6e 100644 --- a/src/lib/isdcf_metadata.h +++ b/src/lib/isdcf_metadata.h @@ -32,8 +32,7 @@ class ISDCFMetadata { public: ISDCFMetadata () - : content_version (1) - , temp_version (false) + : temp_version (false) , pre_release (false) , red_band (false) , two_d_version_of_three_d (false) @@ -44,7 +43,6 @@ public: void as_xml (xmlpp::Node *) const; void read_old_metadata (std::string, std::string); - int content_version; std::string territory; std::string rating; std::string studio; -- cgit v1.2.3 From f188fc8d92eaba89aaa63cfd7f5a2fc9836e94b6 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 2 Apr 2021 22:38:16 +0200 Subject: Use release territory from Interop/SMPTE metadata instead of ISDCF metadata dialogue. --- src/lib/film.cc | 6 ++- src/lib/isdcf_metadata.cc | 7 +--- src/lib/isdcf_metadata.h | 1 - src/wx/dcp_panel.cc | 2 + src/wx/interop_metadata_dialog.cc | 50 ++++++++----------------- src/wx/interop_metadata_dialog.h | 9 +++-- src/wx/isdcf_metadata_dialog.cc | 5 --- src/wx/isdcf_metadata_dialog.h | 1 - src/wx/metadata_dialog.cc | 79 +++++++++++++++++++++++++++++++++++++++ src/wx/metadata_dialog.h | 32 +++++++++++++++- src/wx/smpte_metadata_dialog.cc | 58 ++-------------------------- src/wx/smpte_metadata_dialog.h | 16 +------- test/isdcf_name_test.cc | 8 ++-- 13 files changed, 149 insertions(+), 125 deletions(-) (limited to 'src/lib') diff --git a/src/lib/film.cc b/src/lib/film.cc index 5ccc5437a..9051c5a15 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -957,8 +957,10 @@ Film::isdcf_name (bool if_created_now) const d += "-XX"; } - if (!dm.territory.empty ()) { - d += "_" + dm.territory; + if (_release_territory) { + auto territory = _release_territory->subtag(); + transform (territory.begin(), territory.end(), territory.begin(), ::toupper); + d += "_" + territory; if (dm.rating.empty ()) { d += "-NR"; } else { diff --git a/src/lib/isdcf_metadata.cc b/src/lib/isdcf_metadata.cc index 4f157ce70..daf3a4c4f 100644 --- a/src/lib/isdcf_metadata.cc +++ b/src/lib/isdcf_metadata.cc @@ -34,8 +34,7 @@ using std::shared_ptr; using dcp::raw_convert; ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node) - : territory (node->string_child ("Territory")) - , rating (node->string_child ("Rating")) + : rating (node->string_child ("Rating")) , studio (node->string_child ("Studio")) , facility (node->string_child ("Facility")) /* This stuff was added later */ @@ -52,7 +51,6 @@ ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node) void ISDCFMetadata::as_xml (xmlpp::Node* root) const { - root->add_child("Territory")->add_child_text (territory); root->add_child("Rating")->add_child_text (rating); root->add_child("Studio")->add_child_text (studio); root->add_child("Facility")->add_child_text (facility); @@ -67,8 +65,7 @@ ISDCFMetadata::as_xml (xmlpp::Node* root) const bool operator== (ISDCFMetadata const & a, ISDCFMetadata const & b) { - return a.territory == b.territory && - a.rating == b.rating && + return a.rating == b.rating && a.studio == b.studio && a.facility == b.facility && a.temp_version == b.temp_version && diff --git a/src/lib/isdcf_metadata.h b/src/lib/isdcf_metadata.h index 22c418c6e..3dc2c2d35 100644 --- a/src/lib/isdcf_metadata.h +++ b/src/lib/isdcf_metadata.h @@ -43,7 +43,6 @@ public: void as_xml (xmlpp::Node *) const; void read_old_metadata (std::string, std::string); - std::string territory; std::string rating; std::string studio; std::string facility; diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index dcb78dc93..ecedec66f 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -323,6 +323,7 @@ DCPPanel::metadata_clicked () } _interop_metadata_dialog = new InteropMetadataDialog (_panel, _film); + _interop_metadata_dialog->setup (); _interop_metadata_dialog->Show (); } else { if (_smpte_metadata_dialog) { @@ -447,6 +448,7 @@ DCPPanel::film_changed (Film::Property p) break; case Film::Property::CONTENT_VERSIONS: case Film::Property::VERSION_NUMBER: + case Film::Property::RELEASE_TERRITORY: setup_dcp_name (); break; default: diff --git a/src/wx/interop_metadata_dialog.cc b/src/wx/interop_metadata_dialog.cc index aa61984b3..61aa23498 100644 --- a/src/wx/interop_metadata_dialog.cc +++ b/src/wx/interop_metadata_dialog.cc @@ -38,24 +38,22 @@ using namespace boost::placeholders; InteropMetadataDialog::InteropMetadataDialog (wxWindow* parent, weak_ptr film) - : wxDialog (parent, wxID_ANY, _("Metadata")) - , _film (film) + : MetadataDialog (parent, film) { - auto overall_sizer = new wxBoxSizer (wxVERTICAL); - SetSizer (overall_sizer); - auto sizer = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); - sizer->AddGrowableCol (1, 1); +} - auto f = _film.lock(); - DCPOMATIC_ASSERT (f); +void +InteropMetadataDialog::setup_standard (wxPanel* panel, wxSizer* sizer) +{ + MetadataDialog::setup_standard (panel, sizer); { int flags = wxALIGN_TOP | wxLEFT | wxRIGHT | wxTOP; #ifdef __WXOSX__ flags |= wxALIGN_RIGHT; #endif - auto m = create_label (this, _("Ratings"), true); + auto m = create_label (panel, _("Ratings"), true); sizer->Add (m, 0, flags, DCPOMATIC_SIZER_GAP); } @@ -63,7 +61,7 @@ InteropMetadataDialog::InteropMetadataDialog (wxWindow* parent, weak_ptr f columns.push_back (EditableListColumn(_("Agency"), 200, true)); columns.push_back (EditableListColumn(_("Label"), 50, true)); _ratings = new EditableList ( - this, + panel, columns, boost::bind(&InteropMetadataDialog::ratings, this), boost::bind(&InteropMetadataDialog::set_ratings, this, _1), @@ -78,23 +76,13 @@ InteropMetadataDialog::InteropMetadataDialog (wxWindow* parent, weak_ptr f ); sizer->Add (_ratings, 1, wxEXPAND); - add_label_to_sizer (sizer, this, _("Content version"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL); - _content_version = new wxTextCtrl (this, wxID_ANY); + add_label_to_sizer (sizer, panel, _("Content version"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL); + _content_version = new wxTextCtrl (panel, wxID_ANY); sizer->Add (_content_version, 1, wxEXPAND); - auto cv = f->content_versions(); + auto cv = film()->content_versions(); _content_version->SetValue (std_to_wx(cv.empty() ? "" : cv[0])); - overall_sizer->Add (sizer, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); - - auto buttons = CreateSeparatedButtonSizer (wxCLOSE); - if (buttons) { - overall_sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); - } - - overall_sizer->Layout (); - overall_sizer->SetSizeHints (this); - _content_version->Bind (wxEVT_TEXT, boost::bind(&InteropMetadataDialog::content_version_changed, this)); _content_version->SetFocus (); } @@ -103,25 +91,19 @@ InteropMetadataDialog::InteropMetadataDialog (wxWindow* parent, weak_ptr f vector InteropMetadataDialog::ratings () const { - auto film = _film.lock (); - DCPOMATIC_ASSERT (film); - return film->ratings (); + return film()->ratings (); } + void InteropMetadataDialog::set_ratings (vector r) { - auto film = _film.lock (); - DCPOMATIC_ASSERT (film); - film->set_ratings (r); + film()->set_ratings (r); } + void InteropMetadataDialog::content_version_changed () { - auto film = _film.lock (); - DCPOMATIC_ASSERT (film); - vector cv; - cv.push_back (wx_to_std(_content_version->GetValue())); - film->set_content_versions (cv); + film()->set_content_versions ({ wx_to_std(_content_version->GetValue()) }); } diff --git a/src/wx/interop_metadata_dialog.h b/src/wx/interop_metadata_dialog.h index b8a1a36e6..b730c1238 100644 --- a/src/wx/interop_metadata_dialog.h +++ b/src/wx/interop_metadata_dialog.h @@ -20,6 +20,7 @@ #include "editable_list.h" +#include "metadata_dialog.h" #include #include #include @@ -31,17 +32,19 @@ class LanguageTagWidget; class RatingDialog; -class InteropMetadataDialog : public wxDialog +class InteropMetadataDialog : public MetadataDialog { public: InteropMetadataDialog (wxWindow* parent, std::weak_ptr film); private: - std::vector ratings () const; + void setup_standard (wxPanel* panel, wxSizer* sizer) override; + void set_ratings (std::vector r); void content_version_changed (); - std::weak_ptr _film; + std::vector ratings () const; + EditableList* _ratings; wxTextCtrl* _content_version; }; diff --git a/src/wx/isdcf_metadata_dialog.cc b/src/wx/isdcf_metadata_dialog.cc index d204258dd..cb12d6a29 100644 --- a/src/wx/isdcf_metadata_dialog.cc +++ b/src/wx/isdcf_metadata_dialog.cc @@ -35,9 +35,6 @@ using std::shared_ptr; ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm, bool threed) : TableDialog (parent, _("ISDCF name"), 2, 1, true) { - add (_("Territory (e.g. UK)"), true); - _territory = add (new wxTextCtrl (this, wxID_ANY)); - add (_("Rating (e.g. 15)"), true); _rating = add (new wxTextCtrl (this, wxID_ANY)); @@ -69,7 +66,6 @@ ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm, bo add (_("Mastered luminance (e.g. 14fl)"), true); _mastered_luminance = add (new wxTextCtrl (this, wxID_ANY)); - _territory->SetValue (std_to_wx (dm.territory)); _rating->SetValue (std_to_wx (dm.rating)); _studio->SetValue (std_to_wx (dm.studio)); _facility->SetValue (std_to_wx (dm.facility)); @@ -89,7 +85,6 @@ ISDCFMetadataDialog::isdcf_metadata () const { ISDCFMetadata dm; - dm.territory = wx_to_std (_territory->GetValue ()); dm.rating = wx_to_std (_rating->GetValue ()); dm.studio = wx_to_std (_studio->GetValue ()); dm.facility = wx_to_std (_facility->GetValue ()); diff --git a/src/wx/isdcf_metadata_dialog.h b/src/wx/isdcf_metadata_dialog.h index 0df00017a..8980bd11a 100644 --- a/src/wx/isdcf_metadata_dialog.h +++ b/src/wx/isdcf_metadata_dialog.h @@ -33,7 +33,6 @@ public: ISDCFMetadata isdcf_metadata () const; private: - wxTextCtrl* _territory; wxTextCtrl* _rating; wxTextCtrl* _studio; wxTextCtrl* _facility; diff --git a/src/wx/metadata_dialog.cc b/src/wx/metadata_dialog.cc index abc95c3c1..376591ca2 100644 --- a/src/wx/metadata_dialog.cc +++ b/src/wx/metadata_dialog.cc @@ -19,6 +19,8 @@ */ +#include "dcpomatic_button.h" +#include "full_language_tag_dialog.h" #include "metadata_dialog.h" #include "wx_util.h" #include "lib/film.h" @@ -69,5 +71,82 @@ MetadataDialog::setup () SetSizer (overall_sizer); overall_sizer->Layout (); overall_sizer->SetSizeHints (this); + + _film_changed_connection = film()->Change.connect(boost::bind(&MetadataDialog::film_changed, this, _1, _2)); + + film_changed (ChangeType::DONE, Film::Property::RELEASE_TERRITORY); +} + + +void +MetadataDialog::film_changed (ChangeType type, Film::Property property) +{ + if (type != ChangeType::DONE) { + return; + } + + if (property == Film::Property::RELEASE_TERRITORY) { + auto rt = film()->release_territory(); + checked_set (_enable_release_territory, static_cast(rt)); + if (rt) { + _release_territory = *rt; + checked_set (_release_territory_text, std_to_wx(*dcp::LanguageTag::get_subtag_description(*_release_territory))); + } + } +} + + +void +MetadataDialog::setup_standard (wxPanel* panel, wxSizer* sizer) +{ + _enable_release_territory = new wxCheckBox (panel, wxID_ANY, _("Release territory")); + sizer->Add (_enable_release_territory, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_GAP); + { + auto s = new wxBoxSizer (wxHORIZONTAL); + _release_territory_text = new wxStaticText (panel, wxID_ANY, wxT("")); + s->Add (_release_territory_text, 1, wxLEFT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_X_GAP); + _edit_release_territory = new Button (panel, _("Edit...")); + s->Add (_edit_release_territory, 0, wxLEFT, DCPOMATIC_SIZER_GAP); + sizer->Add (s, 0, wxEXPAND); + } + + _edit_release_territory->Bind (wxEVT_BUTTON, boost::bind(&MetadataDialog::edit_release_territory, this)); + _enable_release_territory->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::enable_release_territory_changed, this)); +} + + +void +MetadataDialog::edit_release_territory () +{ + DCPOMATIC_ASSERT (film()->release_territory()); + auto d = new RegionSubtagDialog(this, *film()->release_territory()); + d->ShowModal (); + auto tag = d->get(); + if (tag) { + _release_territory = *tag; + film()->set_release_territory(*tag); + } + d->Destroy (); +} + + +void +MetadataDialog::setup_sensitivity () +{ + auto const enabled = _enable_release_territory->GetValue(); + _release_territory_text->Enable (enabled); + _edit_release_territory->Enable (enabled); +} + + +void +MetadataDialog::enable_release_territory_changed () +{ + setup_sensitivity (); + if (_enable_release_territory->GetValue()) { + film()->set_release_territory (_release_territory.get_value_or(dcp::LanguageTag::RegionSubtag("US"))); + } else { + film()->set_release_territory (); + } } diff --git a/src/wx/metadata_dialog.h b/src/wx/metadata_dialog.h index ef5dd0687..8483d8615 100644 --- a/src/wx/metadata_dialog.h +++ b/src/wx/metadata_dialog.h @@ -19,6 +19,12 @@ */ +#ifndef DCPOMATIC_METADATA_DIALOG_H +#define DCPOMATIC_METADATA_DIALOG_H + + +#include "lib/change_signaller.h" +#include "lib/film.h" #include "lib/warnings.h" #include "lib/weak_film.h" DCPOMATIC_DISABLE_WARNINGS @@ -26,6 +32,9 @@ DCPOMATIC_DISABLE_WARNINGS DCPOMATIC_ENABLE_WARNINGS +class Button; + + class MetadataDialog : public wxDialog, public WeakFilm { public: @@ -34,6 +43,27 @@ public: virtual void setup (); protected: - virtual void setup_standard (wxPanel*, wxSizer*) {} + virtual void setup_standard (wxPanel*, wxSizer*); virtual void setup_advanced (wxPanel*, wxSizer*) {} + virtual void film_changed (ChangeType type, Film::Property property); + virtual void setup_sensitivity (); + +private: + void edit_release_territory (); + void enable_release_territory_changed (); + + wxCheckBox* _enable_release_territory; + /** The current release territory displayed in the UI; since we can't easily convert + * the string in _release_territory_text to a RegionSubtag we just store the RegionSubtag + * alongside. + */ + boost::optional _release_territory; + wxStaticText* _release_territory_text; + Button* _edit_release_territory; + + boost::signals2::scoped_connection _film_changed_connection; }; + + +#endif + diff --git a/src/wx/smpte_metadata_dialog.cc b/src/wx/smpte_metadata_dialog.cc index a2e9d355a..857be282c 100644 --- a/src/wx/smpte_metadata_dialog.cc +++ b/src/wx/smpte_metadata_dialog.cc @@ -102,17 +102,6 @@ SMPTEMetadataDialog::setup_advanced (wxPanel* panel, wxSizer* sizer) { MetadataDialog::setup_advanced (panel, sizer); - _enable_release_territory = new wxCheckBox (panel, wxID_ANY, _("Release territory")); - sizer->Add (_enable_release_territory, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_GAP); - { - auto s = new wxBoxSizer (wxHORIZONTAL); - _release_territory_text = new wxStaticText (panel, wxID_ANY, wxT("")); - s->Add (_release_territory_text, 1, wxLEFT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_X_GAP); - _edit_release_territory = new Button (panel, _("Edit...")); - s->Add (_edit_release_territory, 0, wxLEFT, DCPOMATIC_SIZER_GAP); - sizer->Add (s, 0, wxEXPAND); - } - add_label_to_sizer (sizer, panel, _("Version number"), true, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL); _version_number = new wxSpinCtrl (panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 1000); sizer->Add (_version_number, 0); @@ -192,7 +181,6 @@ SMPTEMetadataDialog::setup () _luminance_unit->Append (_("foot lambert")); _name_language->Changed.connect (boost::bind(&SMPTEMetadataDialog::name_language_changed, this, _1)); - _edit_release_territory->Bind (wxEVT_BUTTON, boost::bind(&SMPTEMetadataDialog::edit_release_territory, this)); _version_number->Bind (wxEVT_SPINCTRL, boost::bind(&SMPTEMetadataDialog::version_number_changed, this)); _status->Bind (wxEVT_CHOICE, boost::bind(&SMPTEMetadataDialog::status_changed, this)); _enable_chain->Bind (wxEVT_CHECKBOX, boost::bind(&SMPTEMetadataDialog::enable_chain_changed, this)); @@ -203,12 +191,8 @@ SMPTEMetadataDialog::setup () _facility->Bind (wxEVT_TEXT, boost::bind(&SMPTEMetadataDialog::facility_changed, this)); _luminance_value->Bind (wxEVT_SPINCTRLDOUBLE, boost::bind(&SMPTEMetadataDialog::luminance_changed, this)); _luminance_unit->Bind (wxEVT_CHOICE, boost::bind(&SMPTEMetadataDialog::luminance_changed, this)); - _enable_release_territory->Bind (wxEVT_CHECKBOX, boost::bind(&SMPTEMetadataDialog::enable_release_territory_changed, this)); - - _film_changed_connection = film()->Change.connect(boost::bind(&SMPTEMetadataDialog::film_changed, this, _1, _2)); film_changed (ChangeType::DONE, Film::Property::NAME_LANGUAGE); - film_changed (ChangeType::DONE, Film::Property::RELEASE_TERRITORY); film_changed (ChangeType::DONE, Film::Property::VERSION_NUMBER); film_changed (ChangeType::DONE, Film::Property::STATUS); film_changed (ChangeType::DONE, Film::Property::CHAIN); @@ -224,19 +208,14 @@ SMPTEMetadataDialog::setup () void SMPTEMetadataDialog::film_changed (ChangeType type, Film::Property property) { + MetadataDialog::film_changed (type, property); + if (type != ChangeType::DONE || film()->interop()) { return; } if (property == Film::Property::NAME_LANGUAGE) { _name_language->set (film()->name_language()); - } else if (property == Film::Property::RELEASE_TERRITORY) { - auto rt = film()->release_territory(); - checked_set (_enable_release_territory, static_cast(rt)); - if (rt) { - _release_territory = *rt; - checked_set (_release_territory_text, std_to_wx(*dcp::LanguageTag::get_subtag_description(*_release_territory))); - } } else if (property == Film::Property::VERSION_NUMBER) { checked_set (_version_number, film()->version_number()); } else if (property == Film::Property::STATUS) { @@ -321,21 +300,6 @@ SMPTEMetadataDialog::name_language_changed (dcp::LanguageTag tag) } -void -SMPTEMetadataDialog::edit_release_territory () -{ - DCPOMATIC_ASSERT (film()->release_territory()); - auto d = new RegionSubtagDialog(this, *film()->release_territory()); - d->ShowModal (); - auto tag = d->get(); - if (tag) { - _release_territory = *tag; - film()->set_release_territory(*tag); - } - d->Destroy (); -} - - void SMPTEMetadataDialog::version_number_changed () { @@ -403,11 +367,7 @@ SMPTEMetadataDialog::luminance_changed () void SMPTEMetadataDialog::setup_sensitivity () { - { - auto const enabled = _enable_release_territory->GetValue(); - _release_territory_text->Enable (enabled); - _edit_release_territory->Enable (enabled); - } + MetadataDialog::setup_sensitivity (); _chain->Enable (_enable_chain->GetValue()); _distributor->Enable (_enable_distributor->GetValue()); @@ -415,18 +375,6 @@ SMPTEMetadataDialog::setup_sensitivity () } -void -SMPTEMetadataDialog::enable_release_territory_changed () -{ - setup_sensitivity (); - if (_enable_release_territory->GetValue()) { - film()->set_release_territory (_release_territory.get_value_or(dcp::LanguageTag::RegionSubtag("US"))); - } else { - film()->set_release_territory (); - } -} - - void SMPTEMetadataDialog::enable_chain_changed () { diff --git a/src/wx/smpte_metadata_dialog.h b/src/wx/smpte_metadata_dialog.h index e27401e87..28cc38143 100644 --- a/src/wx/smpte_metadata_dialog.h +++ b/src/wx/smpte_metadata_dialog.h @@ -47,35 +47,25 @@ public: private: void setup_standard (wxPanel* parent, wxSizer* sizer) override; void setup_advanced (wxPanel* parent, wxSizer* sizer) override; + void film_changed (ChangeType type, Film::Property property) override; + void setup_sensitivity () override; std::vector ratings () const; void set_ratings (std::vector r); std::vector content_versions () const; void set_content_versions (std::vector v); void name_language_changed (dcp::LanguageTag tag); - void edit_release_territory (); void version_number_changed (); void status_changed (); void chain_changed (); void distributor_changed (); void facility_changed (); void luminance_changed (); - void film_changed (ChangeType type, Film::Property property); - void setup_sensitivity (); - void enable_release_territory_changed (); void enable_chain_changed (); void enable_distributor_changed (); void enable_facility_changed (); LanguageTagWidget* _name_language; - wxCheckBox* _enable_release_territory; - /** The current release territory displayed in the UI; since we can't easily convert - * the string in _release_territory_text to a RegionSubtag we just store the RegionSubtag - * alongside. - */ - boost::optional _release_territory; - wxStaticText* _release_territory_text; - Button* _edit_release_territory; wxSpinCtrl* _version_number; wxChoice* _status; wxCheckBox* _enable_chain; @@ -88,6 +78,4 @@ private: wxChoice* _luminance_unit; EditableList* _ratings; EditableList* _content_versions; - - boost::signals2::scoped_connection _film_changed_connection; }; diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc index 3d7b69665..51a8c5009 100644 --- a/test/isdcf_name_test.cc +++ b/test/isdcf_name_test.cc @@ -61,19 +61,19 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) BOOST_REQUIRE (audio->audio); audio->audio->set_language(dcp::LanguageTag("en-US")); film->set_content_versions({"1"}); + film->set_release_territory(dcp::LanguageTag::RegionSubtag("GB")); ISDCFMetadata m; - m.territory = "UK"; m.rating = "PG"; m.studio = "ST"; m.facility = "FA"; film->set_isdcf_metadata (m); film->set_interop (true); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilm_FTR-1_F_EN-XX_UK-PG_10_2K_ST_20140704_FA_IOP_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilm_FTR-1_F_EN-XX_GB-PG_10_2K_ST_20140704_FA_IOP_OV"); /* Check that specifying no audio language writes XX */ audio->audio->set_language (boost::none); film->set_isdcf_metadata (m); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilm_FTR-1_F_XX-XX_UK-PG_10_2K_ST_20140704_FA_IOP_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilm_FTR-1_F_XX-XX_GB-PG_10_2K_ST_20140704_FA_IOP_OV"); /* Test a long name and some different data */ @@ -89,13 +89,13 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) text->text.front()->set_language (dcp::LanguageTag("fr-FR")); film->examine_and_add_content (text); film->set_version_number(2); + film->set_release_territory(dcp::LanguageTag::RegionSubtag("US")); BOOST_REQUIRE (!wait_for_jobs()); audio = content_factory("test/data/sine_440.wav").front(); film->examine_and_add_content (audio); BOOST_REQUIRE (!wait_for_jobs()); BOOST_REQUIRE (audio->audio); audio->audio->set_language (dcp::LanguageTag("de-DE")); - m.territory = "US"; m.rating = "R"; m.studio = "DI"; m.facility = "PP"; -- cgit v1.2.3 From b0c9c0470708d0822631b82915f4ed67e5fc7c1b Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 2 Apr 2021 23:05:05 +0200 Subject: Use ratings from Interop/SMPTE metadata instead of ISDCF metadata dialogue. --- src/lib/film.cc | 4 ++-- src/lib/isdcf_metadata.cc | 7 ++----- src/lib/isdcf_metadata.h | 1 - src/wx/dcp_panel.cc | 1 + src/wx/isdcf_metadata_dialog.cc | 5 ----- src/wx/isdcf_metadata_dialog.h | 1 - test/isdcf_name_test.cc | 10 ++++------ 7 files changed, 9 insertions(+), 20 deletions(-) (limited to 'src/lib') diff --git a/src/lib/film.cc b/src/lib/film.cc index 9051c5a15..b34c85295 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -961,10 +961,10 @@ Film::isdcf_name (bool if_created_now) const auto territory = _release_territory->subtag(); transform (territory.begin(), territory.end(), territory.begin(), ::toupper); d += "_" + territory; - if (dm.rating.empty ()) { + if (_ratings.empty ()) { d += "-NR"; } else { - d += "-" + dm.rating; + d += "-" + _ratings[0].label; } } diff --git a/src/lib/isdcf_metadata.cc b/src/lib/isdcf_metadata.cc index daf3a4c4f..c190ba3dc 100644 --- a/src/lib/isdcf_metadata.cc +++ b/src/lib/isdcf_metadata.cc @@ -34,8 +34,7 @@ using std::shared_ptr; using dcp::raw_convert; ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node) - : rating (node->string_child ("Rating")) - , studio (node->string_child ("Studio")) + : studio (node->string_child ("Studio")) , facility (node->string_child ("Facility")) /* This stuff was added later */ , temp_version (node->optional_bool_child ("TempVersion").get_value_or (false)) @@ -51,7 +50,6 @@ ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node) void ISDCFMetadata::as_xml (xmlpp::Node* root) const { - root->add_child("Rating")->add_child_text (rating); root->add_child("Studio")->add_child_text (studio); root->add_child("Facility")->add_child_text (facility); root->add_child("TempVersion")->add_child_text (temp_version ? "1" : "0"); @@ -65,8 +63,7 @@ ISDCFMetadata::as_xml (xmlpp::Node* root) const bool operator== (ISDCFMetadata const & a, ISDCFMetadata const & b) { - return a.rating == b.rating && - a.studio == b.studio && + return a.studio == b.studio && a.facility == b.facility && a.temp_version == b.temp_version && a.pre_release == b.pre_release && diff --git a/src/lib/isdcf_metadata.h b/src/lib/isdcf_metadata.h index 3dc2c2d35..1c80e7b5d 100644 --- a/src/lib/isdcf_metadata.h +++ b/src/lib/isdcf_metadata.h @@ -43,7 +43,6 @@ public: void as_xml (xmlpp::Node *) const; void read_old_metadata (std::string, std::string); - std::string rating; std::string studio; std::string facility; /** true if this is a temporary version (without final picture or sound) */ diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index ecedec66f..6d0e64965 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -449,6 +449,7 @@ DCPPanel::film_changed (Film::Property p) case Film::Property::CONTENT_VERSIONS: case Film::Property::VERSION_NUMBER: case Film::Property::RELEASE_TERRITORY: + case Film::Property::RATINGS: setup_dcp_name (); break; default: diff --git a/src/wx/isdcf_metadata_dialog.cc b/src/wx/isdcf_metadata_dialog.cc index cb12d6a29..f7cb8df8c 100644 --- a/src/wx/isdcf_metadata_dialog.cc +++ b/src/wx/isdcf_metadata_dialog.cc @@ -35,9 +35,6 @@ using std::shared_ptr; ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm, bool threed) : TableDialog (parent, _("ISDCF name"), 2, 1, true) { - add (_("Rating (e.g. 15)"), true); - _rating = add (new wxTextCtrl (this, wxID_ANY)); - add (_("Studio (e.g. TCF)"), true); _studio = add (new wxTextCtrl (this, wxID_ANY)); @@ -66,7 +63,6 @@ ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm, bo add (_("Mastered luminance (e.g. 14fl)"), true); _mastered_luminance = add (new wxTextCtrl (this, wxID_ANY)); - _rating->SetValue (std_to_wx (dm.rating)); _studio->SetValue (std_to_wx (dm.studio)); _facility->SetValue (std_to_wx (dm.facility)); _temp_version->SetValue (dm.temp_version); @@ -85,7 +81,6 @@ ISDCFMetadataDialog::isdcf_metadata () const { ISDCFMetadata dm; - dm.rating = wx_to_std (_rating->GetValue ()); dm.studio = wx_to_std (_studio->GetValue ()); dm.facility = wx_to_std (_facility->GetValue ()); dm.temp_version = _temp_version->GetValue (); diff --git a/src/wx/isdcf_metadata_dialog.h b/src/wx/isdcf_metadata_dialog.h index 8980bd11a..2fc8ca8c3 100644 --- a/src/wx/isdcf_metadata_dialog.h +++ b/src/wx/isdcf_metadata_dialog.h @@ -33,7 +33,6 @@ public: ISDCFMetadata isdcf_metadata () const; private: - wxTextCtrl* _rating; wxTextCtrl* _studio; wxTextCtrl* _facility; wxCheckBox* _temp_version; diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc index 51a8c5009..4ddf57e70 100644 --- a/test/isdcf_name_test.cc +++ b/test/isdcf_name_test.cc @@ -62,8 +62,8 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) audio->audio->set_language(dcp::LanguageTag("en-US")); film->set_content_versions({"1"}); film->set_release_territory(dcp::LanguageTag::RegionSubtag("GB")); + film->set_ratings({dcp::Rating("BBFC", "PG")}); ISDCFMetadata m; - m.rating = "PG"; m.studio = "ST"; m.facility = "FA"; film->set_isdcf_metadata (m); @@ -90,13 +90,13 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) film->examine_and_add_content (text); film->set_version_number(2); film->set_release_territory(dcp::LanguageTag::RegionSubtag("US")); + film->set_ratings({dcp::Rating("MPA", "R")}); BOOST_REQUIRE (!wait_for_jobs()); audio = content_factory("test/data/sine_440.wav").front(); film->examine_and_add_content (audio); BOOST_REQUIRE (!wait_for_jobs()); BOOST_REQUIRE (audio->audio); audio->audio->set_language (dcp::LanguageTag("de-DE")); - m.rating = "R"; m.studio = "DI"; m.facility = "PP"; film->set_isdcf_metadata (m); @@ -104,11 +104,9 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_TLR-2_S_DE-fr_US-R_MOS_4K_DI_20140704_PP_SMPTE_OV"); /* Test to see that RU ratings like 6+ survive */ - m.rating = "6+"; - film->set_isdcf_metadata (m); + film->set_ratings({dcp::Rating("RARS", "6+")}); BOOST_CHECK_EQUAL (film->dcp_name(false), "MyNiceFilmWith_TLR-2_S_DE-fr_US-6+_MOS_4K_DI_20140704_PP_SMPTE_OV"); - m.rating = "R"; - film->set_isdcf_metadata (m); + film->set_ratings({dcp::Rating("MPA", "R")}); /* Test interior aspect ratio: shouldn't be shown with trailers */ -- cgit v1.2.3 From 48bfa4b2040d2bacd6befdab6c12b2ee3e9be5a1 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 2 Apr 2021 23:44:58 +0200 Subject: Add to_upper() method to util.{cc,h} --- src/lib/film.cc | 8 +++----- src/lib/util.cc | 9 +++++++++ src/lib/util.h | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'src/lib') diff --git a/src/lib/film.cc b/src/lib/film.cc index b34c85295..1f188021b 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -919,9 +919,8 @@ Film::isdcf_name (bool if_created_now) const auto audio_langs = audio_languages(); auto audio_language = (audio_langs.empty() || !audio_langs.front().language()) ? "XX" : audio_langs.front().language()->subtag(); - transform (audio_language.begin(), audio_language.end(), audio_language.begin(), ::toupper); - d += "_" + audio_language; + d += "_" + to_upper (audio_language); /* I'm not clear on the precise details of the convention for CCAP labelling; for now I'm just appending -CCAP if we have any closed captions. @@ -945,7 +944,7 @@ Film::isdcf_name (bool if_created_now) const if (burnt_in) { transform (lang.begin(), lang.end(), lang.begin(), ::tolower); } else { - transform (lang.begin(), lang.end(), lang.begin(), ::toupper); + lang = to_upper (lang); } d += "-" + lang; @@ -959,8 +958,7 @@ Film::isdcf_name (bool if_created_now) const if (_release_territory) { auto territory = _release_territory->subtag(); - transform (territory.begin(), territory.end(), territory.begin(), ::toupper); - d += "_" + territory; + d += "_" + to_upper (territory); if (_ratings.empty ()) { d += "-NR"; } else { diff --git a/src/lib/util.cc b/src/lib/util.cc index 24ea42b8f..d3511e8c7 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -1167,3 +1167,12 @@ default_font_file () return liberation_normal; } + + +string +to_upper (string s) +{ + transform (s.begin(), s.end(), s.begin(), ::toupper); + return s; +} + diff --git a/src/lib/util.h b/src/lib/util.h index ceb30701c..7f8106f3c 100644 --- a/src/lib/util.h +++ b/src/lib/util.h @@ -122,6 +122,7 @@ extern void copy_in_bits (boost::filesystem::path from, boost::filesystem::path extern dcp::Size scale_for_display (dcp::Size s, dcp::Size display_container, dcp::Size film_container); extern dcp::DecryptedKDM decrypt_kdm_with_helpful_error (dcp::EncryptedKDM kdm); extern boost::filesystem::path default_font_file (); +extern std::string to_upper (std::string s); template std::list -- cgit v1.2.3 From ea51ac3483161343b7aefabe54420c6cb431c0fe Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 2 Apr 2021 23:45:19 +0200 Subject: Use studio and facility from Interop/SMPTE metadata rather than ISDCF. --- src/lib/film.cc | 20 ++++++++--- src/lib/film.h | 7 ++++ src/lib/isdcf_metadata.cc | 11 ++---- src/lib/isdcf_metadata.h | 2 -- src/wx/dcp_panel.cc | 2 ++ src/wx/isdcf_metadata_dialog.cc | 10 ------ src/wx/isdcf_metadata_dialog.h | 2 -- src/wx/metadata_dialog.cc | 75 +++++++++++++++++++++++++++++++++++++++++ src/wx/metadata_dialog.h | 10 +++++- src/wx/smpte_metadata_dialog.cc | 33 ------------------ src/wx/smpte_metadata_dialog.h | 4 --- test/isdcf_name_test.cc | 66 ++++++++++++++++++------------------ 12 files changed, 144 insertions(+), 98 deletions(-) (limited to 'src/lib') diff --git a/src/lib/film.cc b/src/lib/film.cc index 1f188021b..1275c571b 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -490,6 +490,9 @@ Film::metadata (bool with_content_paths) const if (_facility) { root->add_child("Facility")->add_child_text(*_facility); } + if (_studio) { + root->add_child("Studio")->add_child_text(*_studio); + } if (_luminance) { root->add_child("LuminanceValue")->add_child_text(raw_convert(_luminance->value())); root->add_child("LuminanceUnit")->add_child_text(dcp::Luminance::unit_to_string(_luminance->unit())); @@ -666,6 +669,7 @@ Film::read_metadata (optional path) _chain = f.optional_string_child("Chain"); _distributor = f.optional_string_child("Distributor"); _facility = f.optional_string_child("Facility"); + _studio = f.optional_string_child("Studio"); auto value = f.optional_number_child("LuminanceValue"); auto unit = f.optional_string_child("LuminanceUnit"); @@ -986,8 +990,8 @@ Film::isdcf_name (bool if_created_now) const d += "_" + resolution_to_string (_resolution); - if (!dm.studio.empty ()) { - d += "_" + dm.studio; + if (_studio && _studio->length() >= 2) { + d += "_" + to_upper (_studio->substr(0, 4)); } if (if_created_now) { @@ -996,8 +1000,8 @@ Film::isdcf_name (bool if_created_now) const d += "_" + boost::gregorian::to_iso_string (_isdcf_date); } - if (!dm.facility.empty ()) { - d += "_" + dm.facility; + if (_facility && _facility->length() >= 3) { + d += "_" + to_upper(_facility->substr(0, 3)); } if (_interop) { @@ -2061,6 +2065,14 @@ Film::set_facility (optional f) } +void +Film::set_studio (optional s) +{ + FilmChangeSignaller ch (this, Property::STUDIO); + _studio = s; +} + + optional Film::marker (dcp::Marker type) const { diff --git a/src/lib/film.h b/src/lib/film.h index 6b50bba5e..fa87c6c35 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -239,6 +239,7 @@ public: CHAIN, DISTRIBUTOR, FACILITY, + STUDIO, LUMINANCE, }; @@ -373,6 +374,10 @@ public: return _facility; } + boost::optional studio () const { + return _studio; + } + boost::optional luminance () const { return _luminance; } @@ -416,6 +421,7 @@ public: void set_status (dcp::Status s); void set_chain (boost::optional c = boost::none); void set_facility (boost::optional f = boost::none); + void set_studio (boost::optional s = boost::none); void set_distributor (boost::optional d = boost::none); void set_luminance (boost::optional l = boost::none); @@ -522,6 +528,7 @@ private: boost::optional _chain; boost::optional _distributor; boost::optional _facility; + boost::optional _studio; boost::optional _luminance; int _state_version; diff --git a/src/lib/isdcf_metadata.cc b/src/lib/isdcf_metadata.cc index c190ba3dc..eb8bcb1a5 100644 --- a/src/lib/isdcf_metadata.cc +++ b/src/lib/isdcf_metadata.cc @@ -34,10 +34,7 @@ using std::shared_ptr; using dcp::raw_convert; ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node) - : studio (node->string_child ("Studio")) - , facility (node->string_child ("Facility")) - /* This stuff was added later */ - , temp_version (node->optional_bool_child ("TempVersion").get_value_or (false)) + : temp_version (node->optional_bool_child ("TempVersion").get_value_or (false)) , pre_release (node->optional_bool_child ("PreRelease").get_value_or (false)) , red_band (node->optional_bool_child ("RedBand").get_value_or (false)) , chain (node->optional_string_child ("Chain").get_value_or ("")) @@ -50,8 +47,6 @@ ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node) void ISDCFMetadata::as_xml (xmlpp::Node* root) const { - root->add_child("Studio")->add_child_text (studio); - root->add_child("Facility")->add_child_text (facility); root->add_child("TempVersion")->add_child_text (temp_version ? "1" : "0"); root->add_child("PreRelease")->add_child_text (pre_release ? "1" : "0"); root->add_child("RedBand")->add_child_text (red_band ? "1" : "0"); @@ -63,9 +58,7 @@ ISDCFMetadata::as_xml (xmlpp::Node* root) const bool operator== (ISDCFMetadata const & a, ISDCFMetadata const & b) { - return a.studio == b.studio && - a.facility == b.facility && - a.temp_version == b.temp_version && + return a.temp_version == b.temp_version && a.pre_release == b.pre_release && a.red_band == b.red_band && a.chain == b.chain && diff --git a/src/lib/isdcf_metadata.h b/src/lib/isdcf_metadata.h index 1c80e7b5d..b578dc997 100644 --- a/src/lib/isdcf_metadata.h +++ b/src/lib/isdcf_metadata.h @@ -43,8 +43,6 @@ public: void as_xml (xmlpp::Node *) const; void read_old_metadata (std::string, std::string); - std::string studio; - std::string facility; /** true if this is a temporary version (without final picture or sound) */ bool temp_version; /** true if this is a pre-release version (final picture and sound, but without accessibility features) */ diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 6d0e64965..a46ae0226 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -450,6 +450,8 @@ DCPPanel::film_changed (Film::Property p) case Film::Property::VERSION_NUMBER: case Film::Property::RELEASE_TERRITORY: case Film::Property::RATINGS: + case Film::Property::FACILITY: + case Film::Property::STUDIO: setup_dcp_name (); break; default: diff --git a/src/wx/isdcf_metadata_dialog.cc b/src/wx/isdcf_metadata_dialog.cc index f7cb8df8c..559047742 100644 --- a/src/wx/isdcf_metadata_dialog.cc +++ b/src/wx/isdcf_metadata_dialog.cc @@ -35,12 +35,6 @@ using std::shared_ptr; ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm, bool threed) : TableDialog (parent, _("ISDCF name"), 2, 1, true) { - add (_("Studio (e.g. TCF)"), true); - _studio = add (new wxTextCtrl (this, wxID_ANY)); - - add (_("Facility (e.g. DLA)"), true); - _facility = add (new wxTextCtrl (this, wxID_ANY)); - _temp_version = add (new CheckBox(this, _("Temp version"))); add_spacer (); @@ -63,8 +57,6 @@ ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm, bo add (_("Mastered luminance (e.g. 14fl)"), true); _mastered_luminance = add (new wxTextCtrl (this, wxID_ANY)); - _studio->SetValue (std_to_wx (dm.studio)); - _facility->SetValue (std_to_wx (dm.facility)); _temp_version->SetValue (dm.temp_version); _pre_release->SetValue (dm.pre_release); _red_band->SetValue (dm.red_band); @@ -81,8 +73,6 @@ ISDCFMetadataDialog::isdcf_metadata () const { ISDCFMetadata dm; - dm.studio = wx_to_std (_studio->GetValue ()); - dm.facility = wx_to_std (_facility->GetValue ()); dm.temp_version = _temp_version->GetValue (); dm.pre_release = _pre_release->GetValue (); dm.red_band = _red_band->GetValue (); diff --git a/src/wx/isdcf_metadata_dialog.h b/src/wx/isdcf_metadata_dialog.h index 2fc8ca8c3..47cfd54a7 100644 --- a/src/wx/isdcf_metadata_dialog.h +++ b/src/wx/isdcf_metadata_dialog.h @@ -33,8 +33,6 @@ public: ISDCFMetadata isdcf_metadata () const; private: - wxTextCtrl* _studio; - wxTextCtrl* _facility; wxCheckBox* _temp_version; wxCheckBox* _pre_release; wxCheckBox* _red_band; 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(film()->facility())); + if (film()->facility()) { + checked_set (_facility, *film()->facility()); + } + } else if (property == Film::Property::STUDIO) { + checked_set (_enable_studio, static_cast(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 (); + } +} + + diff --git a/src/wx/metadata_dialog.h b/src/wx/metadata_dialog.h index 8483d8615..50533fc0f 100644 --- a/src/wx/metadata_dialog.h +++ b/src/wx/metadata_dialog.h @@ -44,13 +44,17 @@ public: protected: virtual void setup_standard (wxPanel*, wxSizer*); - virtual void setup_advanced (wxPanel*, wxSizer*) {} + virtual void setup_advanced (wxPanel*, wxSizer*); virtual void film_changed (ChangeType type, Film::Property property); virtual void setup_sensitivity (); private: void edit_release_territory (); void enable_release_territory_changed (); + void facility_changed (); + void enable_facility_changed (); + void studio_changed (); + void enable_studio_changed (); wxCheckBox* _enable_release_territory; /** The current release territory displayed in the UI; since we can't easily convert @@ -60,6 +64,10 @@ private: boost::optional _release_territory; wxStaticText* _release_territory_text; Button* _edit_release_territory; + wxCheckBox* _enable_facility; + wxTextCtrl* _facility; + wxCheckBox* _enable_studio; + wxTextCtrl* _studio; boost::signals2::scoped_connection _film_changed_connection; }; diff --git a/src/wx/smpte_metadata_dialog.cc b/src/wx/smpte_metadata_dialog.cc index 857be282c..37a957921 100644 --- a/src/wx/smpte_metadata_dialog.cc +++ b/src/wx/smpte_metadata_dialog.cc @@ -120,11 +120,6 @@ SMPTEMetadataDialog::setup_advanced (wxPanel* panel, wxSizer* sizer) _distributor = new wxTextCtrl (panel, wxID_ANY); sizer->Add (_distributor, 1, wxEXPAND); - _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); - add_label_to_sizer (sizer, panel, _("Luminance"), true, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL); { auto s = new wxBoxSizer (wxHORIZONTAL); @@ -187,8 +182,6 @@ SMPTEMetadataDialog::setup () _chain->Bind (wxEVT_TEXT, boost::bind(&SMPTEMetadataDialog::chain_changed, this)); _enable_distributor->Bind (wxEVT_CHECKBOX, boost::bind(&SMPTEMetadataDialog::enable_distributor_changed, this)); _distributor->Bind (wxEVT_TEXT, boost::bind(&SMPTEMetadataDialog::distributor_changed, this)); - _enable_facility->Bind (wxEVT_CHECKBOX, boost::bind(&SMPTEMetadataDialog::enable_facility_changed, this)); - _facility->Bind (wxEVT_TEXT, boost::bind(&SMPTEMetadataDialog::facility_changed, this)); _luminance_value->Bind (wxEVT_SPINCTRLDOUBLE, boost::bind(&SMPTEMetadataDialog::luminance_changed, this)); _luminance_unit->Bind (wxEVT_CHOICE, boost::bind(&SMPTEMetadataDialog::luminance_changed, this)); @@ -197,7 +190,6 @@ SMPTEMetadataDialog::setup () film_changed (ChangeType::DONE, Film::Property::STATUS); film_changed (ChangeType::DONE, Film::Property::CHAIN); film_changed (ChangeType::DONE, Film::Property::DISTRIBUTOR); - film_changed (ChangeType::DONE, Film::Property::FACILITY); film_changed (ChangeType::DONE, Film::Property::CONTENT_VERSIONS); film_changed (ChangeType::DONE, Film::Property::LUMINANCE); @@ -240,11 +232,6 @@ SMPTEMetadataDialog::film_changed (ChangeType type, Film::Property property) if (film()->distributor()) { checked_set (_distributor, *film()->distributor()); } - } else if (property == Film::Property::FACILITY) { - checked_set (_enable_facility, static_cast(film()->facility())); - if (film()->facility()) { - checked_set (_facility, *film()->facility()); - } } else if (property == Film::Property::LUMINANCE) { auto lum = film()->luminance(); if (lum) { @@ -338,13 +325,6 @@ SMPTEMetadataDialog::distributor_changed () } -void -SMPTEMetadataDialog::facility_changed () -{ - film()->set_facility (wx_to_std(_facility->GetValue())); -} - - void SMPTEMetadataDialog::luminance_changed () { @@ -371,7 +351,6 @@ SMPTEMetadataDialog::setup_sensitivity () _chain->Enable (_enable_chain->GetValue()); _distributor->Enable (_enable_distributor->GetValue()); - _facility->Enable (_enable_facility->GetValue()); } @@ -399,15 +378,3 @@ SMPTEMetadataDialog::enable_distributor_changed () } -void -SMPTEMetadataDialog::enable_facility_changed () -{ - setup_sensitivity (); - if (_enable_facility->GetValue()) { - film()->set_facility (wx_to_std(_facility->GetValue())); - } else { - film()->set_facility (); - } -} - - diff --git a/src/wx/smpte_metadata_dialog.h b/src/wx/smpte_metadata_dialog.h index 28cc38143..f1cbee977 100644 --- a/src/wx/smpte_metadata_dialog.h +++ b/src/wx/smpte_metadata_dialog.h @@ -59,11 +59,9 @@ private: void status_changed (); void chain_changed (); void distributor_changed (); - void facility_changed (); void luminance_changed (); void enable_chain_changed (); void enable_distributor_changed (); - void enable_facility_changed (); LanguageTagWidget* _name_language; wxSpinCtrl* _version_number; @@ -72,8 +70,6 @@ private: wxTextCtrl* _chain; wxCheckBox* _enable_distributor; wxTextCtrl* _distributor; - wxCheckBox* _enable_facility; - wxTextCtrl* _facility; wxSpinCtrlDouble* _luminance_value; wxChoice* _luminance_unit; EditableList* _ratings; diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc index 4ddf57e70..b55cea1ad 100644 --- a/test/isdcf_name_test.cc +++ b/test/isdcf_name_test.cc @@ -41,8 +41,9 @@ using std::cout; -using std::shared_ptr; using std::make_shared; +using std::shared_ptr; +using std::string; BOOST_AUTO_TEST_CASE (isdcf_name_test) @@ -63,17 +64,16 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) film->set_content_versions({"1"}); film->set_release_territory(dcp::LanguageTag::RegionSubtag("GB")); film->set_ratings({dcp::Rating("BBFC", "PG")}); + film->set_studio (string("ST")); + film->set_facility (string("FAC")); ISDCFMetadata m; - m.studio = "ST"; - m.facility = "FA"; film->set_isdcf_metadata (m); film->set_interop (true); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilm_FTR-1_F_EN-XX_GB-PG_10_2K_ST_20140704_FA_IOP_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilm_FTR-1_F_EN-XX_GB-PG_10_2K_ST_20140704_FAC_IOP_OV"); /* Check that specifying no audio language writes XX */ audio->audio->set_language (boost::none); - film->set_isdcf_metadata (m); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilm_FTR-1_F_XX-XX_GB-PG_10_2K_ST_20140704_FA_IOP_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilm_FTR-1_F_XX-XX_GB-PG_10_2K_ST_20140704_FAC_IOP_OV"); /* Test a long name and some different data */ @@ -91,21 +91,21 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) film->set_version_number(2); film->set_release_territory(dcp::LanguageTag::RegionSubtag("US")); film->set_ratings({dcp::Rating("MPA", "R")}); + film->set_studio (string("di")); + film->set_facility (string("ppfacility")); BOOST_REQUIRE (!wait_for_jobs()); audio = content_factory("test/data/sine_440.wav").front(); film->examine_and_add_content (audio); BOOST_REQUIRE (!wait_for_jobs()); BOOST_REQUIRE (audio->audio); audio->audio->set_language (dcp::LanguageTag("de-DE")); - m.studio = "DI"; - m.facility = "PP"; film->set_isdcf_metadata (m); film->set_interop (false); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_TLR-2_S_DE-fr_US-R_MOS_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_TLR-2_S_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV"); /* Test to see that RU ratings like 6+ survive */ film->set_ratings({dcp::Rating("RARS", "6+")}); - BOOST_CHECK_EQUAL (film->dcp_name(false), "MyNiceFilmWith_TLR-2_S_DE-fr_US-6+_MOS_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->dcp_name(false), "MyNiceFilmWith_TLR-2_S_DE-fr_US-6+_MOS_4K_DI_20140704_PPF_SMPTE_OV"); film->set_ratings({dcp::Rating("MPA", "R")}); /* Test interior aspect ratio: shouldn't be shown with trailers */ @@ -115,26 +115,26 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) BOOST_REQUIRE (!wait_for_jobs()); content->video->set_custom_ratio (1.33); film->set_container (Ratio::from_id ("185")); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_TLR-2_F_DE-fr_US-R_MOS_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_TLR-2_F_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV"); /* But should be shown for anything else */ film->set_dcp_content_type (DCPContentType::from_isdcf_name ("XSN")); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2_F-133_DE-fr_US-R_MOS_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2_F-133_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV"); /* And it should always be numeric */ content->video->set_custom_ratio (2.39); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2_F-239_DE-fr_US-R_MOS_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2_F-239_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV"); content->video->set_custom_ratio (1.9); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2_F-190_DE-fr_US-R_MOS_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2_F-190_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV"); content->video->set_custom_ratio (1.33); /* Test 3D */ film->set_three_d (true); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2-3D_F-133_DE-fr_US-R_MOS_4K_DI_20140704_PP_SMPTE-3D_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2-3D_F-133_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE-3D_OV"); /* Test content type modifiers */ @@ -147,7 +147,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) m.mastered_luminance = "4fl"; film->set_isdcf_metadata (m); film->set_video_frame_rate (48); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2-Temp-Pre-RedBand-MyChain-2D-4fl-48_F-133_DE-fr_US-R_MOS_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2-Temp-Pre-RedBand-MyChain-2D-4fl-48_F-133_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV"); /* Test a name which is already in camelCase */ @@ -161,12 +161,12 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) film->set_isdcf_metadata (m); film->set_video_frame_rate (24); film->set_name ("IKnowCamels"); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "IKnowCamels_XSN-2_F-133_DE-fr_US-R_MOS_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "IKnowCamels_XSN-2_F-133_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV"); /* And one in capitals */ film->set_name ("LIKE SHOUTING"); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_MOS_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV"); /* Test audio channel markup */ @@ -174,48 +174,48 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) auto sound = make_shared("test/data/sine_440.wav"); film->examine_and_add_content (sound); BOOST_REQUIRE (!wait_for_jobs()); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_10_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_10_4K_DI_20140704_PPF_SMPTE_OV"); AudioMapping mapping = sound->audio->mapping (); mapping.set (0, dcp::Channel::LEFT, 1.0); sound->audio->set_mapping (mapping); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_20_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_20_4K_DI_20140704_PPF_SMPTE_OV"); mapping.set (0, dcp::Channel::RIGHT, 1.0); sound->audio->set_mapping (mapping); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_30_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_30_4K_DI_20140704_PPF_SMPTE_OV"); mapping.set (0, dcp::Channel::LFE, 1.0); sound->audio->set_mapping (mapping); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_31_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_31_4K_DI_20140704_PPF_SMPTE_OV"); mapping.set (0, dcp::Channel::LS, 1.0); sound->audio->set_mapping (mapping); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_41_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_41_4K_DI_20140704_PPF_SMPTE_OV"); mapping.set (0, dcp::Channel::RS, 1.0); sound->audio->set_mapping (mapping); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51_4K_DI_20140704_PPF_SMPTE_OV"); mapping.set (0, dcp::Channel::HI, 1.0); sound->audio->set_mapping (mapping); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51_4K_DI_20140704_PPF_SMPTE_OV"); film->set_audio_channels (8); mapping.set (0, dcp::Channel::HI, 1.0); sound->audio->set_mapping (mapping); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI_4K_DI_20140704_PPF_SMPTE_OV"); mapping.set (0, dcp::Channel::VI, 1.0); sound->audio->set_mapping (mapping); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI-VI_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI-VI_4K_DI_20140704_PPF_SMPTE_OV"); film->set_audio_channels(10); mapping.set (0, dcp::Channel::HI, 0.0); mapping.set (0, dcp::Channel::VI, 0.0); sound->audio->set_mapping (mapping); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51_4K_DI_20140704_PPF_SMPTE_OV"); mapping.set (0, dcp::Channel::HI, 1.0); sound->audio->set_mapping (mapping); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI_4K_DI_20140704_PPF_SMPTE_OV"); mapping.set (0, dcp::Channel::VI, 1.0); sound->audio->set_mapping (mapping); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI-VI_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_51-HI-VI_4K_DI_20140704_PPF_SMPTE_OV"); film->set_audio_channels(12); mapping.set (0, dcp::Channel::BSL, 1.0); @@ -223,12 +223,12 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) mapping.set (0, dcp::Channel::HI, 0.0); mapping.set (0, dcp::Channel::VI, 0.0); sound->audio->set_mapping (mapping); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_71_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_71_4K_DI_20140704_PPF_SMPTE_OV"); mapping.set (0, dcp::Channel::HI, 1.0); sound->audio->set_mapping (mapping); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_71-HI_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_71-HI_4K_DI_20140704_PPF_SMPTE_OV"); mapping.set (0, dcp::Channel::VI, 1.0); sound->audio->set_mapping (mapping); - BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_71-HI-VI_4K_DI_20140704_PP_SMPTE_OV"); + BOOST_CHECK_EQUAL (film->isdcf_name(false), "LikeShouting_XSN-2_F-133_DE-fr_US-R_71-HI-VI_4K_DI_20140704_PPF_SMPTE_OV"); } -- cgit v1.2.3 From 8d9e73b753ed51067d93aa377bb24400ff22936e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 3 Apr 2021 01:10:20 +0200 Subject: Move some ISDCF flags to the Interop/SMPTE metadata. --- src/lib/film.cc | 54 +++++++++++++++++++++++++++++----- src/lib/film.h | 28 ++++++++++++++++++ src/lib/isdcf_metadata.cc | 16 ++--------- src/lib/isdcf_metadata.h | 16 +---------- src/wx/dcp_panel.cc | 6 +++- src/wx/full_config_dialog.cc | 2 +- src/wx/isdcf_metadata_dialog.cc | 26 +---------------- src/wx/isdcf_metadata_dialog.h | 6 +--- src/wx/metadata_dialog.cc | 64 +++++++++++++++++++++++++++++++++++++++-- src/wx/metadata_dialog.h | 8 ++++++ test/isdcf_name_test.cc | 16 +++++------ 11 files changed, 163 insertions(+), 79 deletions(-) (limited to 'src/lib') diff --git a/src/lib/film.cc b/src/lib/film.cc index 1275c571b..9857dc1f1 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -493,6 +493,10 @@ Film::metadata (bool with_content_paths) const if (_studio) { root->add_child("Studio")->add_child_text(*_studio); } + root->add_child("TempVersion")->add_child_text(_temp_version ? "1" : "0"); + root->add_child("PreRelease")->add_child_text(_pre_release ? "1" : "0"); + root->add_child("RedBand")->add_child_text(_red_band ? "1" : "0"); + root->add_child("TwoDVersionOfThreeD")->add_child_text(_two_d_version_of_three_d ? "1" : "0"); if (_luminance) { root->add_child("LuminanceValue")->add_child_text(raw_convert(_luminance->value())); root->add_child("LuminanceUnit")->add_child_text(dcp::Luminance::unit_to_string(_luminance->unit())); @@ -670,6 +674,10 @@ Film::read_metadata (optional path) _distributor = f.optional_string_child("Distributor"); _facility = f.optional_string_child("Facility"); _studio = f.optional_string_child("Studio"); + _temp_version = f.optional_bool_child("TempVersion").get_value_or(false); + _pre_release = f.optional_bool_child("PreRelease").get_value_or(false); + _red_band = f.optional_bool_child("RedBand").get_value_or(false); + _two_d_version_of_three_d = f.optional_bool_child("TwoDVersionOfThreeD").get_value_or(false); auto value = f.optional_number_child("LuminanceValue"); auto unit = f.optional_string_child("LuminanceUnit"); @@ -866,15 +874,15 @@ Film::isdcf_name (bool if_created_now) const auto const dm = isdcf_metadata (); - if (dm.temp_version) { + if (_temp_version) { d += "-Temp"; } - if (dm.pre_release) { + if (_pre_release) { d += "-Pre"; } - if (dm.red_band) { + if (_red_band) { d += "-RedBand"; } @@ -886,7 +894,7 @@ Film::isdcf_name (bool if_created_now) const d += "-3D"; } - if (dm.two_d_version_of_three_d) { + if (_two_d_version_of_three_d) { d += "-2D"; } @@ -1155,9 +1163,8 @@ Film::set_three_d (bool t) FilmChangeSignaller ch (this, Property::THREE_D); _three_d = t; - if (_three_d && _isdcf_metadata.two_d_version_of_three_d) { - FilmChangeSignaller ch (this, Property::ISDCF_METADATA); - _isdcf_metadata.two_d_version_of_three_d = false; + if (_three_d && _two_d_version_of_three_d) { + set_two_d_version_of_three_d (false); } } @@ -2130,3 +2137,36 @@ Film::add_ffoc_lfoc (Markers& markers) const markers[dcp::Marker::LFOC] = length() - DCPTime::from_frames(1, video_frame_rate()); } } + + +void +Film::set_temp_version (bool t) +{ + FilmChangeSignaller ch (this, Property::TEMP_VERSION); + _temp_version = t; +} + + +void +Film::set_pre_release (bool p) +{ + FilmChangeSignaller ch (this, Property::PRE_RELEASE); + _pre_release = p; +} + + +void +Film::set_red_band (bool r) +{ + FilmChangeSignaller ch (this, Property::RED_BAND); + _red_band = r; +} + + +void +Film::set_two_d_version_of_three_d (bool t) +{ + FilmChangeSignaller ch (this, Property::TWO_D_VERSION_OF_THREE_D); + _two_d_version_of_three_d = t; +} + diff --git a/src/lib/film.h b/src/lib/film.h index fa87c6c35..e0c5cb2f7 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -240,6 +240,10 @@ public: DISTRIBUTOR, FACILITY, STUDIO, + TEMP_VERSION, + PRE_RELEASE, + RED_BAND, + TWO_D_VERSION_OF_THREE_D, LUMINANCE, }; @@ -378,6 +382,22 @@ public: return _studio; } + bool temp_version () const { + return _temp_version; + } + + bool pre_release () const { + return _pre_release; + } + + bool red_band () const { + return _red_band; + } + + bool two_d_version_of_three_d () const { + return _two_d_version_of_three_d; + } + boost::optional luminance () const { return _luminance; } @@ -422,6 +442,10 @@ public: void set_chain (boost::optional c = boost::none); void set_facility (boost::optional f = boost::none); void set_studio (boost::optional s = boost::none); + void set_temp_version (bool t); + void set_pre_release (bool p); + void set_red_band (bool r); + void set_two_d_version_of_three_d (bool t); void set_distributor (boost::optional d = boost::none); void set_luminance (boost::optional l = boost::none); @@ -529,6 +553,10 @@ private: boost::optional _distributor; boost::optional _facility; boost::optional _studio; + bool _temp_version = false; + bool _pre_release = false; + bool _red_band = false; + bool _two_d_version_of_three_d = false; boost::optional _luminance; int _state_version; diff --git a/src/lib/isdcf_metadata.cc b/src/lib/isdcf_metadata.cc index eb8bcb1a5..71f1fc6d0 100644 --- a/src/lib/isdcf_metadata.cc +++ b/src/lib/isdcf_metadata.cc @@ -34,11 +34,7 @@ using std::shared_ptr; using dcp::raw_convert; ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node) - : temp_version (node->optional_bool_child ("TempVersion").get_value_or (false)) - , pre_release (node->optional_bool_child ("PreRelease").get_value_or (false)) - , red_band (node->optional_bool_child ("RedBand").get_value_or (false)) - , chain (node->optional_string_child ("Chain").get_value_or ("")) - , two_d_version_of_three_d (node->optional_bool_child ("TwoDVersionOfThreeD").get_value_or (false)) + : chain (node->optional_string_child ("Chain").get_value_or ("")) , mastered_luminance (node->optional_string_child ("MasteredLuminance").get_value_or ("")) { @@ -47,21 +43,13 @@ ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node) void ISDCFMetadata::as_xml (xmlpp::Node* root) const { - root->add_child("TempVersion")->add_child_text (temp_version ? "1" : "0"); - root->add_child("PreRelease")->add_child_text (pre_release ? "1" : "0"); - root->add_child("RedBand")->add_child_text (red_band ? "1" : "0"); root->add_child("Chain")->add_child_text (chain); - root->add_child("TwoDVersionOfThreeD")->add_child_text (two_d_version_of_three_d ? "1" : "0"); root->add_child("MasteredLuminance")->add_child_text (mastered_luminance); } bool operator== (ISDCFMetadata const & a, ISDCFMetadata const & b) { - return a.temp_version == b.temp_version && - a.pre_release == b.pre_release && - a.red_band == b.red_band && - a.chain == b.chain && - a.two_d_version_of_three_d == b.two_d_version_of_three_d && + return a.chain == b.chain && a.mastered_luminance == b.mastered_luminance; } diff --git a/src/lib/isdcf_metadata.h b/src/lib/isdcf_metadata.h index b578dc997..722bb154f 100644 --- a/src/lib/isdcf_metadata.h +++ b/src/lib/isdcf_metadata.h @@ -31,28 +31,14 @@ namespace xmlpp { class ISDCFMetadata { public: - ISDCFMetadata () - : temp_version (false) - , pre_release (false) - , red_band (false) - , two_d_version_of_three_d (false) - {} - + ISDCFMetadata () {} explicit ISDCFMetadata (cxml::ConstNodePtr); void as_xml (xmlpp::Node *) const; void read_old_metadata (std::string, std::string); - /** true if this is a temporary version (without final picture or sound) */ - bool temp_version; - /** true if this is a pre-release version (final picture and sound, but without accessibility features) */ - bool pre_release; - /** true if this has adult content */ - bool red_band; /** specific theatre chain or event */ std::string chain; - /** true if this is a 2D version of content that also exists in 3D */ - bool two_d_version_of_three_d; /** mastered luminance if there are multiple versions distributed (e.g. 35, 4fl, 6fl etc.) */ std::string mastered_luminance; }; diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index a46ae0226..1213fe1fa 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -452,6 +452,10 @@ DCPPanel::film_changed (Film::Property p) case Film::Property::RATINGS: case Film::Property::FACILITY: case Film::Property::STUDIO: + case Film::Property::TEMP_VERSION: + case Film::Property::PRE_RELEASE: + case Film::Property::RED_BAND: + case Film::Property::TWO_D_VERSION_OF_THREE_D: setup_dcp_name (); break; default: @@ -649,7 +653,7 @@ DCPPanel::edit_isdcf_button_clicked () return; } - auto d = new ISDCFMetadataDialog (_panel, _film->isdcf_metadata (), _film->three_d ()); + auto d = new ISDCFMetadataDialog (_panel, _film->isdcf_metadata ()); d->ShowModal (); _film->set_isdcf_metadata (d->isdcf_metadata ()); d->Destroy (); diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc index 3b07c7765..27159e7f2 100644 --- a/src/wx/full_config_dialog.cc +++ b/src/wx/full_config_dialog.cc @@ -416,7 +416,7 @@ private: void edit_isdcf_metadata_clicked () { - ISDCFMetadataDialog* d = new ISDCFMetadataDialog (_panel, Config::instance()->default_isdcf_metadata (), false); + auto d = new ISDCFMetadataDialog (_panel, Config::instance()->default_isdcf_metadata ()); d->ShowModal (); Config::instance()->set_default_isdcf_metadata (d->isdcf_metadata ()); d->Destroy (); diff --git a/src/wx/isdcf_metadata_dialog.cc b/src/wx/isdcf_metadata_dialog.cc index 559047742..4faf88ee6 100644 --- a/src/wx/isdcf_metadata_dialog.cc +++ b/src/wx/isdcf_metadata_dialog.cc @@ -32,36 +32,16 @@ using std::shared_ptr; * @param dm Initial ISDCF metadata. * @param threed true if the film is in 3D. */ -ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm, bool threed) +ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm) : TableDialog (parent, _("ISDCF name"), 2, 1, true) { - _temp_version = add (new CheckBox(this, _("Temp version"))); - add_spacer (); - - _pre_release = add (new CheckBox(this, _("Pre-release"))); - add_spacer (); - - _red_band = add (new CheckBox(this, _("Red band"))); - add_spacer (); - add (_("Chain"), true); _chain = add (new wxTextCtrl (this, wxID_ANY)); - _two_d_version_of_three_d = add (new CheckBox(this, _("2D version of content available in 3D"))); - add_spacer (); - - if (threed) { - _two_d_version_of_three_d->Enable (false); - } - add (_("Mastered luminance (e.g. 14fl)"), true); _mastered_luminance = add (new wxTextCtrl (this, wxID_ANY)); - _temp_version->SetValue (dm.temp_version); - _pre_release->SetValue (dm.pre_release); - _red_band->SetValue (dm.red_band); _chain->SetValue (std_to_wx (dm.chain)); - _two_d_version_of_three_d->SetValue (dm.two_d_version_of_three_d); _mastered_luminance->SetValue (std_to_wx (dm.mastered_luminance)); layout (); @@ -73,11 +53,7 @@ ISDCFMetadataDialog::isdcf_metadata () const { ISDCFMetadata dm; - dm.temp_version = _temp_version->GetValue (); - dm.pre_release = _pre_release->GetValue (); - dm.red_band = _red_band->GetValue (); dm.chain = wx_to_std (_chain->GetValue ()); - dm.two_d_version_of_three_d = _two_d_version_of_three_d->GetValue (); dm.mastered_luminance = wx_to_std (_mastered_luminance->GetValue ()); return dm; diff --git a/src/wx/isdcf_metadata_dialog.h b/src/wx/isdcf_metadata_dialog.h index 47cfd54a7..4f5e8889b 100644 --- a/src/wx/isdcf_metadata_dialog.h +++ b/src/wx/isdcf_metadata_dialog.h @@ -28,15 +28,11 @@ class Film; class ISDCFMetadataDialog : public TableDialog { public: - ISDCFMetadataDialog (wxWindow *, ISDCFMetadata, bool threed); + ISDCFMetadataDialog (wxWindow *, ISDCFMetadata); ISDCFMetadata isdcf_metadata () const; private: - wxCheckBox* _temp_version; - wxCheckBox* _pre_release; - wxCheckBox* _red_band; wxTextCtrl* _chain; - wxCheckBox* _two_d_version_of_three_d; wxTextCtrl* _mastered_luminance; }; diff --git a/src/wx/metadata_dialog.cc b/src/wx/metadata_dialog.cc index 17151161c..75b2eff69 100644 --- a/src/wx/metadata_dialog.cc +++ b/src/wx/metadata_dialog.cc @@ -72,16 +72,26 @@ MetadataDialog::setup () overall_sizer->Layout (); overall_sizer->SetSizeHints (this); + _edit_release_territory->Bind (wxEVT_BUTTON, boost::bind(&MetadataDialog::edit_release_territory, this)); + _enable_release_territory->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::enable_release_territory_changed, 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)); + _temp_version->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::temp_version_changed, this)); + _pre_release->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::pre_release_changed, this)); + _red_band->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::red_band_changed, this)); + _two_d_version_of_three_d->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::two_d_version_of_three_d_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); + film_changed (ChangeType::DONE, Film::Property::TEMP_VERSION); + film_changed (ChangeType::DONE, Film::Property::PRE_RELEASE); + film_changed (ChangeType::DONE, Film::Property::RED_BAND); + film_changed (ChangeType::DONE, Film::Property::TWO_D_VERSION_OF_THREE_D); setup_sensitivity (); } @@ -111,6 +121,14 @@ MetadataDialog::film_changed (ChangeType type, Film::Property property) if (film()->studio()) { checked_set (_studio, *film()->studio()); } + } else if (property == Film::Property::TEMP_VERSION) { + checked_set (_temp_version, film()->temp_version()); + } else if (property == Film::Property::PRE_RELEASE) { + checked_set (_pre_release, film()->pre_release()); + } else if (property == Film::Property::RED_BAND) { + checked_set (_red_band, film()->red_band()); + } else if (property == Film::Property::TWO_D_VERSION_OF_THREE_D) { + checked_set (_two_d_version_of_three_d, film()->two_d_version_of_three_d()); } } @@ -128,9 +146,6 @@ MetadataDialog::setup_standard (wxPanel* panel, wxSizer* sizer) s->Add (_edit_release_territory, 0, wxLEFT, DCPOMATIC_SIZER_GAP); sizer->Add (s, 0, wxEXPAND); } - - _edit_release_territory->Bind (wxEVT_BUTTON, boost::bind(&MetadataDialog::edit_release_territory, this)); - _enable_release_territory->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::enable_release_territory_changed, this)); } @@ -184,6 +199,22 @@ MetadataDialog::setup_advanced (wxPanel* panel, wxSizer* sizer) sizer->Add (_enable_studio, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL); _studio = new wxTextCtrl (panel, wxID_ANY); sizer->Add (_studio, 1, wxEXPAND); + + _temp_version = new wxCheckBox (panel, wxID_ANY, _("Temporary version")); + sizer->Add (_temp_version, 0, wxALIGN_CENTER_VERTICAL); + sizer->AddSpacer (0); + + _pre_release = new wxCheckBox (panel, wxID_ANY, _("Pre-release")); + sizer->Add (_pre_release, 0, wxALIGN_CENTER_VERTICAL); + sizer->AddSpacer (0); + + _red_band = new wxCheckBox (panel, wxID_ANY, _("Red band")); + sizer->Add (_red_band, 0, wxALIGN_CENTER_VERTICAL); + sizer->AddSpacer (0); + + _two_d_version_of_three_d = new wxCheckBox (panel, wxID_ANY, _("2D version of 3D DCP")); + sizer->Add (_two_d_version_of_three_d, 0, wxALIGN_CENTER_VERTICAL); + sizer->AddSpacer (0); } @@ -225,3 +256,30 @@ MetadataDialog::enable_studio_changed () } +void +MetadataDialog::temp_version_changed () +{ + film()->set_temp_version(_temp_version->GetValue()); +} + + +void +MetadataDialog::pre_release_changed () +{ + film()->set_pre_release(_pre_release->GetValue()); +} + + +void +MetadataDialog::red_band_changed () +{ + film()->set_red_band(_red_band->GetValue()); +} + + +void +MetadataDialog::two_d_version_of_three_d_changed () +{ + film()->set_two_d_version_of_three_d(_two_d_version_of_three_d->GetValue()); +} + diff --git a/src/wx/metadata_dialog.h b/src/wx/metadata_dialog.h index 50533fc0f..1d49d7cfc 100644 --- a/src/wx/metadata_dialog.h +++ b/src/wx/metadata_dialog.h @@ -55,6 +55,10 @@ private: void enable_facility_changed (); void studio_changed (); void enable_studio_changed (); + void temp_version_changed (); + void pre_release_changed (); + void red_band_changed (); + void two_d_version_of_three_d_changed (); wxCheckBox* _enable_release_territory; /** The current release territory displayed in the UI; since we can't easily convert @@ -68,6 +72,10 @@ private: wxTextCtrl* _facility; wxCheckBox* _enable_studio; wxTextCtrl* _studio; + wxCheckBox* _temp_version; + wxCheckBox* _pre_release; + wxCheckBox* _red_band; + wxCheckBox* _two_d_version_of_three_d; boost::signals2::scoped_connection _film_changed_connection; }; diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc index b55cea1ad..54b9a24d7 100644 --- a/test/isdcf_name_test.cc +++ b/test/isdcf_name_test.cc @@ -139,11 +139,11 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) /* Test content type modifiers */ film->set_three_d (false); - m.temp_version = true; - m.pre_release = true; - m.red_band = true; + film->set_temp_version (true); + film->set_pre_release (true); + film->set_red_band (true); + film->set_two_d_version_of_three_d (true); m.chain = "MyChain"; - m.two_d_version_of_three_d = true; m.mastered_luminance = "4fl"; film->set_isdcf_metadata (m); film->set_video_frame_rate (48); @@ -152,11 +152,11 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) /* Test a name which is already in camelCase */ film->set_three_d (false); - m.temp_version = false; - m.pre_release = false; - m.red_band = false; + film->set_temp_version (false); + film->set_pre_release (false); + film->set_red_band (false); + film->set_two_d_version_of_three_d (false); m.chain = ""; - m.two_d_version_of_three_d = false; m.mastered_luminance = ""; film->set_isdcf_metadata (m); film->set_video_frame_rate (24); -- cgit v1.2.3 From 4b8b74ae8ae721f2fbf317f1d7ce5be6048ae1b0 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 3 Apr 2021 02:02:53 +0200 Subject: Move chain to the Interop/SMPTE metadata. --- src/lib/film.cc | 4 ++-- src/lib/isdcf_metadata.cc | 7 ++----- src/lib/isdcf_metadata.h | 2 -- src/wx/dcp_panel.cc | 1 + src/wx/isdcf_metadata_dialog.cc | 5 ----- src/wx/isdcf_metadata_dialog.h | 1 - src/wx/metadata_dialog.cc | 34 ++++++++++++++++++++++++++++++++++ src/wx/metadata_dialog.h | 4 ++++ src/wx/smpte_metadata_dialog.cc | 33 --------------------------------- src/wx/smpte_metadata_dialog.h | 4 ---- test/isdcf_name_test.cc | 4 ++-- 11 files changed, 45 insertions(+), 54 deletions(-) (limited to 'src/lib') diff --git a/src/lib/film.cc b/src/lib/film.cc index 9857dc1f1..147470585 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -886,8 +886,8 @@ Film::isdcf_name (bool if_created_now) const d += "-RedBand"; } - if (!dm.chain.empty ()) { - d += "-" + dm.chain; + if (_chain && !_chain->empty()) { + d += "-" + *_chain; } if (three_d ()) { diff --git a/src/lib/isdcf_metadata.cc b/src/lib/isdcf_metadata.cc index 71f1fc6d0..22e094b1b 100644 --- a/src/lib/isdcf_metadata.cc +++ b/src/lib/isdcf_metadata.cc @@ -34,8 +34,7 @@ using std::shared_ptr; using dcp::raw_convert; ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node) - : chain (node->optional_string_child ("Chain").get_value_or ("")) - , mastered_luminance (node->optional_string_child ("MasteredLuminance").get_value_or ("")) + : mastered_luminance (node->optional_string_child ("MasteredLuminance").get_value_or ("")) { } @@ -43,13 +42,11 @@ ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node) void ISDCFMetadata::as_xml (xmlpp::Node* root) const { - root->add_child("Chain")->add_child_text (chain); root->add_child("MasteredLuminance")->add_child_text (mastered_luminance); } bool operator== (ISDCFMetadata const & a, ISDCFMetadata const & b) { - return a.chain == b.chain && - a.mastered_luminance == b.mastered_luminance; + return a.mastered_luminance == b.mastered_luminance; } diff --git a/src/lib/isdcf_metadata.h b/src/lib/isdcf_metadata.h index 722bb154f..4237b6a3e 100644 --- a/src/lib/isdcf_metadata.h +++ b/src/lib/isdcf_metadata.h @@ -37,8 +37,6 @@ public: void as_xml (xmlpp::Node *) const; void read_old_metadata (std::string, std::string); - /** specific theatre chain or event */ - std::string chain; /** mastered luminance if there are multiple versions distributed (e.g. 35, 4fl, 6fl etc.) */ std::string mastered_luminance; }; diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 1213fe1fa..a6f4d53c0 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -456,6 +456,7 @@ DCPPanel::film_changed (Film::Property p) case Film::Property::PRE_RELEASE: case Film::Property::RED_BAND: case Film::Property::TWO_D_VERSION_OF_THREE_D: + case Film::Property::CHAIN: setup_dcp_name (); break; default: diff --git a/src/wx/isdcf_metadata_dialog.cc b/src/wx/isdcf_metadata_dialog.cc index 4faf88ee6..ea390c1bb 100644 --- a/src/wx/isdcf_metadata_dialog.cc +++ b/src/wx/isdcf_metadata_dialog.cc @@ -35,13 +35,9 @@ using std::shared_ptr; ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm) : TableDialog (parent, _("ISDCF name"), 2, 1, true) { - add (_("Chain"), true); - _chain = add (new wxTextCtrl (this, wxID_ANY)); - add (_("Mastered luminance (e.g. 14fl)"), true); _mastered_luminance = add (new wxTextCtrl (this, wxID_ANY)); - _chain->SetValue (std_to_wx (dm.chain)); _mastered_luminance->SetValue (std_to_wx (dm.mastered_luminance)); layout (); @@ -53,7 +49,6 @@ ISDCFMetadataDialog::isdcf_metadata () const { ISDCFMetadata dm; - dm.chain = wx_to_std (_chain->GetValue ()); dm.mastered_luminance = wx_to_std (_mastered_luminance->GetValue ()); return dm; diff --git a/src/wx/isdcf_metadata_dialog.h b/src/wx/isdcf_metadata_dialog.h index 4f5e8889b..1eb7c8693 100644 --- a/src/wx/isdcf_metadata_dialog.h +++ b/src/wx/isdcf_metadata_dialog.h @@ -33,6 +33,5 @@ public: ISDCFMetadata isdcf_metadata () const; private: - wxTextCtrl* _chain; wxTextCtrl* _mastered_luminance; }; diff --git a/src/wx/metadata_dialog.cc b/src/wx/metadata_dialog.cc index 75b2eff69..c6d28922b 100644 --- a/src/wx/metadata_dialog.cc +++ b/src/wx/metadata_dialog.cc @@ -78,6 +78,8 @@ MetadataDialog::setup () _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)); + _enable_chain->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::enable_chain_changed, this)); + _chain->Bind (wxEVT_TEXT, boost::bind(&MetadataDialog::chain_changed, this)); _temp_version->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::temp_version_changed, this)); _pre_release->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::pre_release_changed, this)); _red_band->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::red_band_changed, this)); @@ -92,6 +94,7 @@ MetadataDialog::setup () film_changed (ChangeType::DONE, Film::Property::PRE_RELEASE); film_changed (ChangeType::DONE, Film::Property::RED_BAND); film_changed (ChangeType::DONE, Film::Property::TWO_D_VERSION_OF_THREE_D); + film_changed (ChangeType::DONE, Film::Property::CHAIN); setup_sensitivity (); } @@ -121,6 +124,11 @@ MetadataDialog::film_changed (ChangeType type, Film::Property property) if (film()->studio()) { checked_set (_studio, *film()->studio()); } + } else if (property == Film::Property::CHAIN) { + checked_set (_enable_chain, static_cast(film()->chain())); + if (film()->chain()) { + checked_set (_chain, *film()->chain()); + } } else if (property == Film::Property::TEMP_VERSION) { checked_set (_temp_version, film()->temp_version()); } else if (property == Film::Property::PRE_RELEASE) { @@ -171,6 +179,7 @@ MetadataDialog::setup_sensitivity () _release_territory_text->Enable (enabled); _edit_release_territory->Enable (enabled); _facility->Enable (_enable_facility->GetValue()); + _chain->Enable (_enable_chain->GetValue()); _studio->Enable (_enable_studio->GetValue()); } @@ -200,6 +209,11 @@ MetadataDialog::setup_advanced (wxPanel* panel, wxSizer* sizer) _studio = new wxTextCtrl (panel, wxID_ANY); sizer->Add (_studio, 1, wxEXPAND); + _enable_chain = new wxCheckBox (panel, wxID_ANY, _("Chain")); + sizer->Add (_enable_chain, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL); + _chain = new wxTextCtrl (panel, wxID_ANY); + sizer->Add (_chain, 1, wxEXPAND); + _temp_version = new wxCheckBox (panel, wxID_ANY, _("Temporary version")); sizer->Add (_temp_version, 0, wxALIGN_CENTER_VERTICAL); sizer->AddSpacer (0); @@ -283,3 +297,23 @@ MetadataDialog::two_d_version_of_three_d_changed () film()->set_two_d_version_of_three_d(_two_d_version_of_three_d->GetValue()); } + +void +MetadataDialog::chain_changed () +{ + film()->set_chain (wx_to_std(_chain->GetValue())); +} + + +void +MetadataDialog::enable_chain_changed () +{ + setup_sensitivity (); + if (_enable_chain->GetValue()) { + film()->set_chain (wx_to_std(_chain->GetValue())); + } else { + film()->set_chain (); + } +} + + diff --git a/src/wx/metadata_dialog.h b/src/wx/metadata_dialog.h index 1d49d7cfc..3ac5d10a3 100644 --- a/src/wx/metadata_dialog.h +++ b/src/wx/metadata_dialog.h @@ -59,6 +59,8 @@ private: void pre_release_changed (); void red_band_changed (); void two_d_version_of_three_d_changed (); + void chain_changed (); + void enable_chain_changed (); wxCheckBox* _enable_release_territory; /** The current release territory displayed in the UI; since we can't easily convert @@ -70,6 +72,8 @@ private: Button* _edit_release_territory; wxCheckBox* _enable_facility; wxTextCtrl* _facility; + wxCheckBox* _enable_chain; + wxTextCtrl* _chain; wxCheckBox* _enable_studio; wxTextCtrl* _studio; wxCheckBox* _temp_version; diff --git a/src/wx/smpte_metadata_dialog.cc b/src/wx/smpte_metadata_dialog.cc index 37a957921..3bc676052 100644 --- a/src/wx/smpte_metadata_dialog.cc +++ b/src/wx/smpte_metadata_dialog.cc @@ -110,11 +110,6 @@ SMPTEMetadataDialog::setup_advanced (wxPanel* panel, wxSizer* sizer) _status = new wxChoice (panel, wxID_ANY); sizer->Add (_status, 0); - _enable_chain = new wxCheckBox (panel, wxID_ANY, _("Chain")); - sizer->Add (_enable_chain, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL); - _chain = new wxTextCtrl (panel, wxID_ANY); - sizer->Add (_chain, 1, wxEXPAND); - _enable_distributor = new wxCheckBox (panel, wxID_ANY, _("Distributor")); sizer->Add (_enable_distributor, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL); _distributor = new wxTextCtrl (panel, wxID_ANY); @@ -178,8 +173,6 @@ SMPTEMetadataDialog::setup () _name_language->Changed.connect (boost::bind(&SMPTEMetadataDialog::name_language_changed, this, _1)); _version_number->Bind (wxEVT_SPINCTRL, boost::bind(&SMPTEMetadataDialog::version_number_changed, this)); _status->Bind (wxEVT_CHOICE, boost::bind(&SMPTEMetadataDialog::status_changed, this)); - _enable_chain->Bind (wxEVT_CHECKBOX, boost::bind(&SMPTEMetadataDialog::enable_chain_changed, this)); - _chain->Bind (wxEVT_TEXT, boost::bind(&SMPTEMetadataDialog::chain_changed, this)); _enable_distributor->Bind (wxEVT_CHECKBOX, boost::bind(&SMPTEMetadataDialog::enable_distributor_changed, this)); _distributor->Bind (wxEVT_TEXT, boost::bind(&SMPTEMetadataDialog::distributor_changed, this)); _luminance_value->Bind (wxEVT_SPINCTRLDOUBLE, boost::bind(&SMPTEMetadataDialog::luminance_changed, this)); @@ -188,7 +181,6 @@ SMPTEMetadataDialog::setup () film_changed (ChangeType::DONE, Film::Property::NAME_LANGUAGE); film_changed (ChangeType::DONE, Film::Property::VERSION_NUMBER); film_changed (ChangeType::DONE, Film::Property::STATUS); - film_changed (ChangeType::DONE, Film::Property::CHAIN); film_changed (ChangeType::DONE, Film::Property::DISTRIBUTOR); film_changed (ChangeType::DONE, Film::Property::CONTENT_VERSIONS); film_changed (ChangeType::DONE, Film::Property::LUMINANCE); @@ -222,11 +214,6 @@ SMPTEMetadataDialog::film_changed (ChangeType type, Film::Property property) checked_set (_status, 2); break; } - } else if (property == Film::Property::CHAIN) { - checked_set (_enable_chain, static_cast(film()->chain())); - if (film()->chain()) { - checked_set (_chain, *film()->chain()); - } } else if (property == Film::Property::DISTRIBUTOR) { checked_set (_enable_distributor, static_cast(film()->distributor())); if (film()->distributor()) { @@ -311,13 +298,6 @@ SMPTEMetadataDialog::status_changed () } -void -SMPTEMetadataDialog::chain_changed () -{ - film()->set_chain (wx_to_std(_chain->GetValue())); -} - - void SMPTEMetadataDialog::distributor_changed () { @@ -349,23 +329,10 @@ SMPTEMetadataDialog::setup_sensitivity () { MetadataDialog::setup_sensitivity (); - _chain->Enable (_enable_chain->GetValue()); _distributor->Enable (_enable_distributor->GetValue()); } -void -SMPTEMetadataDialog::enable_chain_changed () -{ - setup_sensitivity (); - if (_enable_chain->GetValue()) { - film()->set_chain (wx_to_std(_chain->GetValue())); - } else { - film()->set_chain (); - } -} - - void SMPTEMetadataDialog::enable_distributor_changed () { diff --git a/src/wx/smpte_metadata_dialog.h b/src/wx/smpte_metadata_dialog.h index f1cbee977..acf1ac111 100644 --- a/src/wx/smpte_metadata_dialog.h +++ b/src/wx/smpte_metadata_dialog.h @@ -57,17 +57,13 @@ private: void name_language_changed (dcp::LanguageTag tag); void version_number_changed (); void status_changed (); - void chain_changed (); void distributor_changed (); void luminance_changed (); - void enable_chain_changed (); void enable_distributor_changed (); LanguageTagWidget* _name_language; wxSpinCtrl* _version_number; wxChoice* _status; - wxCheckBox* _enable_chain; - wxTextCtrl* _chain; wxCheckBox* _enable_distributor; wxTextCtrl* _distributor; wxSpinCtrlDouble* _luminance_value; diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc index 54b9a24d7..c559e433f 100644 --- a/test/isdcf_name_test.cc +++ b/test/isdcf_name_test.cc @@ -143,7 +143,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) film->set_pre_release (true); film->set_red_band (true); film->set_two_d_version_of_three_d (true); - m.chain = "MyChain"; + film->set_chain (string("MyChain")); m.mastered_luminance = "4fl"; film->set_isdcf_metadata (m); film->set_video_frame_rate (48); @@ -156,7 +156,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) film->set_pre_release (false); film->set_red_band (false); film->set_two_d_version_of_three_d (false); - m.chain = ""; + film->set_chain (string("")); m.mastered_luminance = ""; film->set_isdcf_metadata (m); film->set_video_frame_rate (24); -- cgit v1.2.3 From 8336cba4e6a8c594680696d2337ddc800d84c267 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 3 Apr 2021 20:08:12 +0200 Subject: Move luminance to Interop/SMPTE metadata and remove the ISDCF metadata dialogue. --- src/lib/config.cc | 14 --------- src/lib/config.h | 11 ------- src/lib/film.cc | 21 +++---------- src/lib/film.h | 9 ------ src/lib/isdcf_metadata.cc | 52 ------------------------------ src/lib/isdcf_metadata.h | 46 --------------------------- src/lib/wscript | 1 - src/wx/dcp_panel.cc | 34 ++++---------------- src/wx/dcp_panel.h | 2 -- src/wx/full_config_dialog.cc | 16 ---------- src/wx/isdcf_metadata_dialog.cc | 55 -------------------------------- src/wx/isdcf_metadata_dialog.h | 37 ---------------------- src/wx/metadata_dialog.cc | 70 ++++++++++++++++++++++++++++++++++++++++- src/wx/metadata_dialog.h | 6 ++++ src/wx/player_config_dialog.cc | 1 - src/wx/smpte_metadata_dialog.cc | 53 ------------------------------- src/wx/smpte_metadata_dialog.h | 3 -- src/wx/wscript | 1 - test/isdcf_name_test.cc | 9 ++---- test/test.cc | 1 - 20 files changed, 88 insertions(+), 354 deletions(-) delete mode 100644 src/lib/isdcf_metadata.cc delete mode 100644 src/lib/isdcf_metadata.h delete mode 100644 src/wx/isdcf_metadata_dialog.cc delete mode 100644 src/wx/isdcf_metadata_dialog.h (limited to 'src/lib') diff --git a/src/lib/config.cc b/src/lib/config.cc index 0dcc84117..6ec3b0588 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -309,12 +309,6 @@ try _dcp_product_version = f.optional_string_child("DCPProductVersion").get_value_or(""); _dcp_j2k_comment = f.optional_string_child("DCPJ2KComment").get_value_or(""); - if (version && version.get() >= 2) { - _default_isdcf_metadata = ISDCFMetadata (f.node_child ("ISDCFMetadata")); - } else { - _default_isdcf_metadata = ISDCFMetadata (f.node_child ("DCIMetadata")); - } - _default_still_length = f.optional_number_child("DefaultStillLength").get_value_or (10); _default_j2k_bandwidth = f.optional_number_child("DefaultJ2KBandwidth").get_value_or (200000000); _default_audio_delay = f.optional_number_child("DefaultAudioDelay").get_value_or (0); @@ -688,14 +682,6 @@ Config::write_config () const /* [XML] UploadAfterMakeDCP 1 to upload to a TMS after making a DCP, 0 for no upload. */ root->add_child("UploadAfterMakeDCP")->add_child_text (_upload_after_make_dcp ? "1" : "0"); - /* [XML] ISDCFMetadata Default ISDCF metadata to use for new films; child tags are <ContentVersion>, - <AudioLanguage>, <SubtitleLanguage>, <Territory>, - <Rating>, <Studio>, <Facility>, <TempVersion>, - <PreRelease>, <RedBand>, <Chain>, <TwoDVersionOFThreeD>, - <MasteredLuminance>. - */ - _default_isdcf_metadata.as_xml (root->add_child ("ISDCFMetadata")); - /* [XML] DefaultStillLength Default length (in seconds) for still images in new films. */ root->add_child("DefaultStillLength")->add_child_text (raw_convert (_default_still_length)); /* [XML] DefaultJ2KBandwidth Default bitrate (in bits per second) for JPEG2000 data in new films. */ diff --git a/src/lib/config.h b/src/lib/config.h index 0a48a00e1..eb8f88da9 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -25,7 +25,6 @@ #ifndef DCPOMATIC_CONFIG_H #define DCPOMATIC_CONFIG_H -#include "isdcf_metadata.h" #include "types.h" #include "state.h" #include "edid.h" @@ -166,10 +165,6 @@ public: return _show_experimental_audio_processors; } - ISDCFMetadata default_isdcf_metadata () const { - return _default_isdcf_metadata; - } - boost::optional language () const { return _language; } @@ -636,10 +631,6 @@ public: maybe_set (_show_experimental_audio_processors, e, SHOW_EXPERIMENTAL_AUDIO_PROCESSORS); } - void set_default_isdcf_metadata (ISDCFMetadata d) { - maybe_set (_default_isdcf_metadata, d); - } - void set_language (std::string l) { if (_language && _language.get() == l) { return; @@ -1174,8 +1165,6 @@ private: bool _allow_any_container; /** Offer the upmixers in the audio processor settings */ bool _show_experimental_audio_processors; - /** Default ISDCF metadata for newly-created Films */ - ISDCFMetadata _default_isdcf_metadata; boost::optional _language; /** Default length of still image content (seconds) */ int _default_still_length; diff --git a/src/lib/film.cc b/src/lib/film.cc index 147470585..a9ac82b5a 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -155,7 +155,6 @@ Film::Film (optional dir) , _encrypted (false) , _context_id (dcp::make_uuid ()) , _j2k_bandwidth (Config::instance()->default_j2k_bandwidth ()) - , _isdcf_metadata (Config::instance()->default_isdcf_metadata ()) , _video_frame_rate (24) , _audio_channels (Config::instance()->default_dcp_audio_channels ()) , _three_d (false) @@ -446,7 +445,6 @@ Film::metadata (bool with_content_paths) const root->add_child("Resolution")->add_child_text (resolution_to_string (_resolution)); root->add_child("J2KBandwidth")->add_child_text (raw_convert (_j2k_bandwidth)); - _isdcf_metadata.as_xml (root->add_child ("ISDCFMetadata")); root->add_child("VideoFrameRate")->add_child_text (raw_convert (_video_frame_rate)); root->add_child("ISDCFDate")->add_child_text (boost::gregorian::to_iso_string (_isdcf_date)); root->add_child("AudioChannels")->add_child_text (raw_convert (_audio_channels)); @@ -572,11 +570,9 @@ Film::read_metadata (optional path) _name = f.string_child ("Name"); if (_state_version >= 9) { _use_isdcf_name = f.bool_child ("UseISDCFName"); - _isdcf_metadata = ISDCFMetadata (f.node_child ("ISDCFMetadata")); _isdcf_date = boost::gregorian::from_undelimited_string (f.string_child ("ISDCFDate")); } else { _use_isdcf_name = f.bool_child ("UseDCIName"); - _isdcf_metadata = ISDCFMetadata (f.node_child ("DCIMetadata")); _isdcf_date = boost::gregorian::from_undelimited_string (f.string_child ("DCIDate")); } @@ -872,8 +868,6 @@ Film::isdcf_name (bool if_created_now) const d += "-" + version; } - auto const dm = isdcf_metadata (); - if (_temp_version) { d += "-Temp"; } @@ -898,8 +892,11 @@ Film::isdcf_name (bool if_created_now) const d += "-2D"; } - if (!dm.mastered_luminance.empty ()) { - d += "-" + dm.mastered_luminance; + if (_luminance) { + auto fl = _luminance->value_in_foot_lamberts(); + char buffer[64]; + snprintf (buffer, sizeof(buffer), "%.1f", fl); + d += String::compose("-%1fl", buffer); } if (video_frame_rate() != 24) { @@ -1129,13 +1126,6 @@ Film::set_j2k_bandwidth (int b) _j2k_bandwidth = b; } -void -Film::set_isdcf_metadata (ISDCFMetadata m) -{ - FilmChangeSignaller ch (this, Property::ISDCF_METADATA); - _isdcf_metadata = m; -} - /** @param f New frame rate. * @param user_explicit true if this comes from a direct user instruction, false if it is from * DCP-o-matic being helpful. @@ -1889,7 +1879,6 @@ Film::use_template (string name) _audio_processor = _template_film->_audio_processor; _reel_type = _template_film->_reel_type; _reel_length = _template_film->_reel_length; - _isdcf_metadata = _template_film->_isdcf_metadata; } pair diff --git a/src/lib/film.h b/src/lib/film.h index e0c5cb2f7..5fc56acfb 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -29,7 +29,6 @@ #include "change_signaller.h" #include "dcp_text_track.h" #include "frame_rate_change.h" -#include "isdcf_metadata.h" #include "signaller.h" #include "types.h" #include "util.h" @@ -217,7 +216,6 @@ public: RESOLUTION, ENCRYPTED, J2K_BANDWIDTH, - ISDCF_METADATA, VIDEO_FRAME_RATE, AUDIO_CHANNELS, /** The setting of _three_d has changed */ @@ -286,10 +284,6 @@ public: return _j2k_bandwidth; } - ISDCFMetadata isdcf_metadata () const { - return _isdcf_metadata; - } - /** @return The frame rate of the DCP */ int video_frame_rate () const { return _video_frame_rate; @@ -418,7 +412,6 @@ public: void set_resolution (Resolution, bool user_explicit = true); void set_encrypted (bool); void set_j2k_bandwidth (int); - void set_isdcf_metadata (ISDCFMetadata); void set_video_frame_rate (int rate, bool user_explicit = false); void set_audio_channels (int); void set_three_d (bool); @@ -518,8 +511,6 @@ private: std::string _context_id; /** bandwidth for J2K files in bits per second */ int _j2k_bandwidth; - /** ISDCF naming stuff */ - ISDCFMetadata _isdcf_metadata; /** Frames per second to run our DCP at */ int _video_frame_rate; /** The date that we should use in a ISDCF name */ diff --git a/src/lib/isdcf_metadata.cc b/src/lib/isdcf_metadata.cc deleted file mode 100644 index 22e094b1b..000000000 --- a/src/lib/isdcf_metadata.cc +++ /dev/null @@ -1,52 +0,0 @@ -/* - Copyright (C) 2012-2019 Carl Hetherington - - This file is part of DCP-o-matic. - - DCP-o-matic is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - DCP-o-matic is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with DCP-o-matic. If not, see . - -*/ - -#include "isdcf_metadata.h" -#include "warnings.h" -#include -#include -DCPOMATIC_DISABLE_WARNINGS -#include -DCPOMATIC_ENABLE_WARNINGS -#include - -#include "i18n.h" - -using std::string; -using std::shared_ptr; -using dcp::raw_convert; - -ISDCFMetadata::ISDCFMetadata (cxml::ConstNodePtr node) - : mastered_luminance (node->optional_string_child ("MasteredLuminance").get_value_or ("")) -{ - -} - -void -ISDCFMetadata::as_xml (xmlpp::Node* root) const -{ - root->add_child("MasteredLuminance")->add_child_text (mastered_luminance); -} - -bool -operator== (ISDCFMetadata const & a, ISDCFMetadata const & b) -{ - return a.mastered_luminance == b.mastered_luminance; -} diff --git a/src/lib/isdcf_metadata.h b/src/lib/isdcf_metadata.h deleted file mode 100644 index 4237b6a3e..000000000 --- a/src/lib/isdcf_metadata.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (C) 2012-2019 Carl Hetherington - - This file is part of DCP-o-matic. - - DCP-o-matic is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - DCP-o-matic is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with DCP-o-matic. If not, see . - -*/ - -#ifndef DCPOMATIC_ISDCF_METADATA_H -#define DCPOMATIC_ISDCF_METADATA_H - -#include -#include - -namespace xmlpp { - class Node; -} - -class ISDCFMetadata -{ -public: - ISDCFMetadata () {} - explicit ISDCFMetadata (cxml::ConstNodePtr); - - void as_xml (xmlpp::Node *) const; - void read_old_metadata (std::string, std::string); - - /** mastered luminance if there are multiple versions distributed (e.g. 35, 4fl, 6fl etc.) */ - std::string mastered_luminance; -}; - -bool operator== (ISDCFMetadata const & a, ISDCFMetadata const & b); - -#endif diff --git a/src/lib/wscript b/src/lib/wscript index 1b45152a4..7cbd85a4c 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -121,7 +121,6 @@ sources = """ image_examiner.cc image_filename_sorter.cc image_proxy.cc - isdcf_metadata.cc j2k_image_proxy.cc job.cc job_manager.cc diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index a6f4d53c0..302ed4184 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -20,7 +20,6 @@ #include "dcp_panel.h" #include "wx_util.h" -#include "isdcf_metadata_dialog.h" #include "audio_dialog.h" #include "focus_manager.h" #include "check_box.h" @@ -85,7 +84,6 @@ DCPPanel::DCPPanel (wxNotebook* n, shared_ptr film, weak_ptr v FocusManager::instance()->add(_name); _use_isdcf_name = new CheckBox (_panel, _("Use ISDCF name")); - _edit_isdcf_button = new Button (_panel, _("Details...")); _copy_isdcf_name_button = new Button (_panel, _("Copy as name")); /* wxST_ELLIPSIZE_MIDDLE works around a bug in GTK2 and/or wxWidgets, see @@ -126,7 +124,6 @@ DCPPanel::DCPPanel (wxNotebook* n, shared_ptr film, weak_ptr v _name->Bind (wxEVT_TEXT, boost::bind (&DCPPanel::name_changed, this)); _use_isdcf_name->Bind (wxEVT_CHECKBOX, boost::bind (&DCPPanel::use_isdcf_name_toggled, this)); - _edit_isdcf_button->Bind (wxEVT_BUTTON, boost::bind (&DCPPanel::edit_isdcf_button_clicked, this)); _copy_isdcf_name_button->Bind(wxEVT_BUTTON, boost::bind (&DCPPanel::copy_isdcf_name_button_clicked, this)); _dcp_content_type->Bind (wxEVT_CHOICE, boost::bind (&DCPPanel::dcp_content_type_changed, this)); _encrypted->Bind (wxEVT_CHECKBOX, boost::bind (&DCPPanel::encrypted_toggled, this)); @@ -162,8 +159,8 @@ DCPPanel::add_to_grid () auto name_sizer = new wxBoxSizer (wxHORIZONTAL); name_sizer->Add (_name_label, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_X_GAP); - name_sizer->Add (_name, 1, wxALIGN_CENTER_VERTICAL); - _grid->Add (name_sizer, wxGBPosition(r, 0), wxGBSpan(1, 2), wxEXPAND); + name_sizer->Add (_name, 1, wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_X_GAP); + _grid->Add (name_sizer, wxGBPosition(r, 0), wxGBSpan(1, 2), wxRIGHT | wxEXPAND, DCPOMATIC_DIALOG_BORDER); ++r; int flags = wxALIGN_CENTER_VERTICAL; @@ -173,14 +170,13 @@ DCPPanel::add_to_grid () _grid->Add (_use_isdcf_name, wxGBPosition (r, 0), wxDefaultSpan, flags); { - wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); - s->Add (_edit_isdcf_button, 1, wxEXPAND | wxRIGHT, DCPOMATIC_SIZER_X_GAP); - s->Add (_copy_isdcf_name_button, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_X_GAP); + auto s = new wxBoxSizer (wxHORIZONTAL); + s->Add (_copy_isdcf_name_button, 0, wxLEFT, DCPOMATIC_SIZER_X_GAP); _grid->Add (s, wxGBPosition (r, 1), wxDefaultSpan, wxEXPAND); } ++r; - _grid->Add (_dcp_name, wxGBPosition(r, 0), wxGBSpan (1, 2), wxALIGN_CENTER_VERTICAL | wxEXPAND); + _grid->Add (_dcp_name, wxGBPosition(r, 0), wxGBSpan(1, 2), wxALIGN_CENTER_VERTICAL); ++r; add_label_to_sizer (_grid, _dcp_content_type_label, true, wxGBPosition (r, 0)); @@ -379,12 +375,8 @@ DCPPanel::film_changed (Film::Property p) } } setup_dcp_name (); - _edit_isdcf_button->Enable (_film->use_isdcf_name ()); break; } - case Film::Property::ISDCF_METADATA: - setup_dcp_name (); - break; case Film::Property::VIDEO_FRAME_RATE: { bool done = false; @@ -457,6 +449,7 @@ DCPPanel::film_changed (Film::Property p) case Film::Property::RED_BAND: case Film::Property::TWO_D_VERSION_OF_THREE_D: case Film::Property::CHAIN: + case Film::Property::LUMINANCE: setup_dcp_name (); break; default: @@ -575,7 +568,6 @@ DCPPanel::set_film (shared_ptr film) film_changed (Film::Property::RESOLUTION); film_changed (Film::Property::ENCRYPTED); film_changed (Film::Property::J2K_BANDWIDTH); - film_changed (Film::Property::ISDCF_METADATA); film_changed (Film::Property::VIDEO_FRAME_RATE); film_changed (Film::Property::AUDIO_CHANNELS); film_changed (Film::Property::SEQUENCE); @@ -601,7 +593,6 @@ DCPPanel::setup_sensitivity () { _name->Enable (_generally_sensitive); _use_isdcf_name->Enable (_generally_sensitive); - _edit_isdcf_button->Enable (_generally_sensitive); _dcp_content_type->Enable (_generally_sensitive); _copy_isdcf_name_button->Enable (_generally_sensitive); _encrypted->Enable (_generally_sensitive); @@ -647,19 +638,6 @@ DCPPanel::use_isdcf_name_toggled () _film->set_use_isdcf_name (_use_isdcf_name->GetValue ()); } -void -DCPPanel::edit_isdcf_button_clicked () -{ - if (!_film) { - return; - } - - auto d = new ISDCFMetadataDialog (_panel, _film->isdcf_metadata ()); - d->ShowModal (); - _film->set_isdcf_metadata (d->isdcf_metadata ()); - d->Destroy (); -} - void DCPPanel::setup_dcp_name () { diff --git a/src/wx/dcp_panel.h b/src/wx/dcp_panel.h index 9b362a26c..a076e4bb4 100644 --- a/src/wx/dcp_panel.h +++ b/src/wx/dcp_panel.h @@ -64,7 +64,6 @@ public: private: void name_changed (); void use_isdcf_name_toggled (); - void edit_isdcf_button_clicked (); void copy_isdcf_name_button_clicked (); void container_changed (); void dcp_content_type_changed (); @@ -118,7 +117,6 @@ private: wxStaticText* _container_label; wxChoice* _container; wxStaticText* _container_size; - wxButton* _edit_isdcf_button; wxButton* _copy_isdcf_name_button; wxStaticText* _j2k_bandwidth_label; wxStaticText* _mbits_label; diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc index 27159e7f2..962295528 100644 --- a/src/wx/full_config_dialog.cc +++ b/src/wx/full_config_dialog.cc @@ -28,7 +28,6 @@ #include "filter_dialog.h" #include "dir_picker_ctrl.h" #include "file_picker_ctrl.h" -#include "isdcf_metadata_dialog.h" #include "server_dialog.h" #include "make_chain_dialog.h" #include "email_dialog.h" @@ -275,10 +274,6 @@ private: #endif table->Add (_directory, 1, wxEXPAND); - add_label_to_sizer (table, _panel, _("Default ISDCF name details"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); - _isdcf_metadata_button = new Button (_panel, _("Edit...")); - table->Add (_isdcf_metadata_button); - add_label_to_sizer (table, _panel, _("Default container"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL); _container = new wxChoice (_panel, wxID_ANY); table->Add (_container); @@ -328,8 +323,6 @@ private: _directory->Bind (wxEVT_DIRPICKER_CHANGED, boost::bind (&DefaultsPage::directory_changed, this)); _kdm_directory->Bind (wxEVT_DIRPICKER_CHANGED, boost::bind (&DefaultsPage::kdm_directory_changed, this)); - _isdcf_metadata_button->Bind (wxEVT_BUTTON, boost::bind (&DefaultsPage::edit_isdcf_metadata_clicked, this)); - for (auto i: Ratio::containers()) { _container->Append (std_to_wx(i->container_nickname())); } @@ -414,14 +407,6 @@ private: Config::instance()->set_default_kdm_directory (wx_to_std (_kdm_directory->GetPath ())); } - void edit_isdcf_metadata_clicked () - { - auto d = new ISDCFMetadataDialog (_panel, Config::instance()->default_isdcf_metadata ()); - d->ShowModal (); - Config::instance()->set_default_isdcf_metadata (d->isdcf_metadata ()); - d->Destroy (); - } - void still_length_changed () { Config::instance()->set_default_still_length (_still_length->GetValue ()); @@ -446,7 +431,6 @@ private: wxSpinCtrl* _j2k_bandwidth; wxSpinCtrl* _audio_delay; - wxButton* _isdcf_metadata_button; wxSpinCtrl* _still_length; #ifdef DCPOMATIC_USE_OWN_PICKER DirPickerCtrl* _directory; diff --git a/src/wx/isdcf_metadata_dialog.cc b/src/wx/isdcf_metadata_dialog.cc deleted file mode 100644 index ea390c1bb..000000000 --- a/src/wx/isdcf_metadata_dialog.cc +++ /dev/null @@ -1,55 +0,0 @@ -/* - Copyright (C) 2012-2019 Carl Hetherington - - This file is part of DCP-o-matic. - - DCP-o-matic is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - DCP-o-matic is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with DCP-o-matic. If not, see . - -*/ - -#include "isdcf_metadata_dialog.h" -#include "wx_util.h" -#include "check_box.h" -#include "lib/film.h" -#include -#include -#include - -using std::shared_ptr; - -/** @param parent Parent window. - * @param dm Initial ISDCF metadata. - * @param threed true if the film is in 3D. - */ -ISDCFMetadataDialog::ISDCFMetadataDialog (wxWindow* parent, ISDCFMetadata dm) - : TableDialog (parent, _("ISDCF name"), 2, 1, true) -{ - add (_("Mastered luminance (e.g. 14fl)"), true); - _mastered_luminance = add (new wxTextCtrl (this, wxID_ANY)); - - _mastered_luminance->SetValue (std_to_wx (dm.mastered_luminance)); - - layout (); -} - - -ISDCFMetadata -ISDCFMetadataDialog::isdcf_metadata () const -{ - ISDCFMetadata dm; - - dm.mastered_luminance = wx_to_std (_mastered_luminance->GetValue ()); - - return dm; -} diff --git a/src/wx/isdcf_metadata_dialog.h b/src/wx/isdcf_metadata_dialog.h deleted file mode 100644 index 1eb7c8693..000000000 --- a/src/wx/isdcf_metadata_dialog.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright (C) 2012-2019 Carl Hetherington - - This file is part of DCP-o-matic. - - DCP-o-matic is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - DCP-o-matic is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with DCP-o-matic. If not, see . - -*/ - -#include "table_dialog.h" -#include "lib/isdcf_metadata.h" -#include - -class wxSpinCtrl; -class Film; - -class ISDCFMetadataDialog : public TableDialog -{ -public: - ISDCFMetadataDialog (wxWindow *, ISDCFMetadata); - - ISDCFMetadata isdcf_metadata () const; - -private: - wxTextCtrl* _mastered_luminance; -}; diff --git a/src/wx/metadata_dialog.cc b/src/wx/metadata_dialog.cc index c6d28922b..c0e543b34 100644 --- a/src/wx/metadata_dialog.cc +++ b/src/wx/metadata_dialog.cc @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -84,6 +85,9 @@ MetadataDialog::setup () _pre_release->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::pre_release_changed, this)); _red_band->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::red_band_changed, this)); _two_d_version_of_three_d->Bind (wxEVT_CHECKBOX, boost::bind(&MetadataDialog::two_d_version_of_three_d_changed, this)); + _enable_luminance->Bind (wxEVT_CHECKBOX, boost::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)); _film_changed_connection = film()->Change.connect(boost::bind(&MetadataDialog::film_changed, this, _1, _2)); @@ -95,6 +99,7 @@ MetadataDialog::setup () film_changed (ChangeType::DONE, Film::Property::RED_BAND); film_changed (ChangeType::DONE, Film::Property::TWO_D_VERSION_OF_THREE_D); film_changed (ChangeType::DONE, Film::Property::CHAIN); + film_changed (ChangeType::DONE, Film::Property::LUMINANCE); setup_sensitivity (); } @@ -137,6 +142,20 @@ MetadataDialog::film_changed (ChangeType type, Film::Property property) checked_set (_red_band, film()->red_band()); } else if (property == Film::Property::TWO_D_VERSION_OF_THREE_D) { checked_set (_two_d_version_of_three_d, film()->two_d_version_of_three_d()); + } else if (property == Film::Property::LUMINANCE) { + auto lum = film()->luminance(); + checked_set (_enable_luminance, static_cast(lum)); + if (lum) { + checked_set (_luminance_value, lum->value()); + switch (lum->unit()) { + case dcp::Luminance::Unit::CANDELA_PER_SQUARE_METRE: + checked_set (_luminance_unit, 0); + break; + case dcp::Luminance::Unit::FOOT_LAMBERT: + checked_set (_luminance_unit, 1); + break; + } + } } } @@ -181,6 +200,8 @@ MetadataDialog::setup_sensitivity () _facility->Enable (_enable_facility->GetValue()); _chain->Enable (_enable_chain->GetValue()); _studio->Enable (_enable_studio->GetValue()); + _luminance_value->Enable (_enable_luminance->GetValue()); + _luminance_unit->Enable (_enable_luminance->GetValue()); } @@ -229,6 +250,23 @@ MetadataDialog::setup_advanced (wxPanel* panel, wxSizer* sizer) _two_d_version_of_three_d = new wxCheckBox (panel, wxID_ANY, _("2D version of 3D DCP")); sizer->Add (_two_d_version_of_three_d, 0, wxALIGN_CENTER_VERTICAL); sizer->AddSpacer (0); + + _enable_luminance = new wxCheckBox (panel, wxID_ANY, _("Luminance")); + sizer->Add (_enable_luminance, 0, wxALIGN_CENTER_VERTICAL); + { + auto s = new wxBoxSizer (wxHORIZONTAL); + _luminance_value = new wxSpinCtrlDouble (panel, wxID_ANY); + _luminance_value->SetDigits (1); + _luminance_value->SetIncrement (0.1); + s->Add (_luminance_value, 0); + _luminance_unit = new wxChoice (panel, wxID_ANY); + s->Add (_luminance_unit, 0, wxLEFT, DCPOMATIC_SIZER_X_GAP); + sizer->Add (s, 1, wxEXPAND); + } + + _luminance_unit->Append (wxString::FromUTF8(_("candela per m²"))); + _luminance_unit->Append (_("foot lambert")); + } @@ -310,10 +348,40 @@ MetadataDialog::enable_chain_changed () { setup_sensitivity (); if (_enable_chain->GetValue()) { - film()->set_chain (wx_to_std(_chain->GetValue())); + chain_changed (); } else { film()->set_chain (); } } +void +MetadataDialog::enable_luminance_changed () +{ + setup_sensitivity (); + if (_enable_luminance->GetValue()) { + luminance_changed (); + } else { + film()->set_luminance (); + } +} + + +void +MetadataDialog::luminance_changed () +{ + dcp::Luminance::Unit unit; + switch (_luminance_unit->GetSelection()) { + case 0: + unit = dcp::Luminance::Unit::CANDELA_PER_SQUARE_METRE; + break; + case 1: + unit = dcp::Luminance::Unit::FOOT_LAMBERT; + break; + default: + DCPOMATIC_ASSERT (false); + } + + film()->set_luminance (dcp::Luminance(_luminance_value->GetValue(), unit)); +} + diff --git a/src/wx/metadata_dialog.h b/src/wx/metadata_dialog.h index 3ac5d10a3..7c4471e59 100644 --- a/src/wx/metadata_dialog.h +++ b/src/wx/metadata_dialog.h @@ -33,6 +33,7 @@ DCPOMATIC_ENABLE_WARNINGS class Button; +class wxSpinCtrlDouble; class MetadataDialog : public wxDialog, public WeakFilm @@ -61,6 +62,8 @@ private: void two_d_version_of_three_d_changed (); void chain_changed (); void enable_chain_changed (); + void enable_luminance_changed (); + void luminance_changed (); wxCheckBox* _enable_release_territory; /** The current release territory displayed in the UI; since we can't easily convert @@ -80,6 +83,9 @@ private: wxCheckBox* _pre_release; wxCheckBox* _red_band; wxCheckBox* _two_d_version_of_three_d; + wxCheckBox* _enable_luminance; + wxSpinCtrlDouble* _luminance_value; + wxChoice* _luminance_unit; boost::signals2::scoped_connection _film_changed_connection; }; diff --git a/src/wx/player_config_dialog.cc b/src/wx/player_config_dialog.cc index c32e892d9..3c480e37e 100644 --- a/src/wx/player_config_dialog.cc +++ b/src/wx/player_config_dialog.cc @@ -28,7 +28,6 @@ #include "filter_dialog.h" #include "file_picker_ctrl.h" #include "dir_picker_ctrl.h" -#include "isdcf_metadata_dialog.h" #include "server_dialog.h" #include "make_chain_dialog.h" #include "email_dialog.h" diff --git a/src/wx/smpte_metadata_dialog.cc b/src/wx/smpte_metadata_dialog.cc index 3bc676052..e4d2d9622 100644 --- a/src/wx/smpte_metadata_dialog.cc +++ b/src/wx/smpte_metadata_dialog.cc @@ -115,18 +115,6 @@ SMPTEMetadataDialog::setup_advanced (wxPanel* panel, wxSizer* sizer) _distributor = new wxTextCtrl (panel, wxID_ANY); sizer->Add (_distributor, 1, wxEXPAND); - add_label_to_sizer (sizer, panel, _("Luminance"), true, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL); - { - auto s = new wxBoxSizer (wxHORIZONTAL); - _luminance_value = new wxSpinCtrlDouble (panel, wxID_ANY); - _luminance_value->SetDigits (1); - _luminance_value->SetIncrement (0.1); - s->Add (_luminance_value, 0); - _luminance_unit = new wxChoice (panel, wxID_ANY); - s->Add (_luminance_unit, 0, wxLEFT, DCPOMATIC_SIZER_X_GAP); - sizer->Add (s, 1, wxEXPAND); - } - { int flags = wxALIGN_TOP | wxRIGHT | wxTOP; #ifdef __WXOSX__ @@ -167,23 +155,17 @@ SMPTEMetadataDialog::setup () _status->Append (_("Pre-release")); _status->Append (_("Final")); - _luminance_unit->Append (wxString::FromUTF8(_("candela per m²"))); - _luminance_unit->Append (_("foot lambert")); - _name_language->Changed.connect (boost::bind(&SMPTEMetadataDialog::name_language_changed, this, _1)); _version_number->Bind (wxEVT_SPINCTRL, boost::bind(&SMPTEMetadataDialog::version_number_changed, this)); _status->Bind (wxEVT_CHOICE, boost::bind(&SMPTEMetadataDialog::status_changed, this)); _enable_distributor->Bind (wxEVT_CHECKBOX, boost::bind(&SMPTEMetadataDialog::enable_distributor_changed, this)); _distributor->Bind (wxEVT_TEXT, boost::bind(&SMPTEMetadataDialog::distributor_changed, this)); - _luminance_value->Bind (wxEVT_SPINCTRLDOUBLE, boost::bind(&SMPTEMetadataDialog::luminance_changed, this)); - _luminance_unit->Bind (wxEVT_CHOICE, boost::bind(&SMPTEMetadataDialog::luminance_changed, this)); film_changed (ChangeType::DONE, Film::Property::NAME_LANGUAGE); film_changed (ChangeType::DONE, Film::Property::VERSION_NUMBER); film_changed (ChangeType::DONE, Film::Property::STATUS); film_changed (ChangeType::DONE, Film::Property::DISTRIBUTOR); film_changed (ChangeType::DONE, Film::Property::CONTENT_VERSIONS); - film_changed (ChangeType::DONE, Film::Property::LUMINANCE); setup_sensitivity (); } @@ -219,22 +201,6 @@ SMPTEMetadataDialog::film_changed (ChangeType type, Film::Property property) if (film()->distributor()) { checked_set (_distributor, *film()->distributor()); } - } else if (property == Film::Property::LUMINANCE) { - auto lum = film()->luminance(); - if (lum) { - checked_set (_luminance_value, lum->value()); - switch (lum->unit()) { - case dcp::Luminance::Unit::CANDELA_PER_SQUARE_METRE: - checked_set (_luminance_unit, 0); - break; - case dcp::Luminance::Unit::FOOT_LAMBERT: - checked_set (_luminance_unit, 1); - break; - } - } else { - checked_set (_luminance_value, 4.5); - checked_set (_luminance_unit, 1); - } } } @@ -305,25 +271,6 @@ SMPTEMetadataDialog::distributor_changed () } -void -SMPTEMetadataDialog::luminance_changed () -{ - dcp::Luminance::Unit unit; - switch (_luminance_unit->GetSelection()) { - case 0: - unit = dcp::Luminance::Unit::CANDELA_PER_SQUARE_METRE; - break; - case 1: - unit = dcp::Luminance::Unit::FOOT_LAMBERT; - break; - default: - DCPOMATIC_ASSERT (false); - } - - film()->set_luminance (dcp::Luminance(_luminance_value->GetValue(), unit)); -} - - void SMPTEMetadataDialog::setup_sensitivity () { diff --git a/src/wx/smpte_metadata_dialog.h b/src/wx/smpte_metadata_dialog.h index acf1ac111..d1a792a36 100644 --- a/src/wx/smpte_metadata_dialog.h +++ b/src/wx/smpte_metadata_dialog.h @@ -58,7 +58,6 @@ private: void version_number_changed (); void status_changed (); void distributor_changed (); - void luminance_changed (); void enable_distributor_changed (); LanguageTagWidget* _name_language; @@ -66,8 +65,6 @@ private: wxChoice* _status; wxCheckBox* _enable_distributor; wxTextCtrl* _distributor; - wxSpinCtrlDouble* _luminance_value; - wxChoice* _luminance_unit; EditableList* _ratings; EditableList* _content_versions; }; diff --git a/src/wx/wscript b/src/wx/wscript index 013377e16..1d0fb0810 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -85,7 +85,6 @@ sources = """ image_sequence_dialog.cc instant_i18n_dialog.cc interop_metadata_dialog.cc - isdcf_metadata_dialog.cc job_manager_view.cc job_view.cc job_view_dialog.cc diff --git a/test/isdcf_name_test.cc b/test/isdcf_name_test.cc index c559e433f..325ee62f4 100644 --- a/test/isdcf_name_test.cc +++ b/test/isdcf_name_test.cc @@ -66,8 +66,6 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) film->set_ratings({dcp::Rating("BBFC", "PG")}); film->set_studio (string("ST")); film->set_facility (string("FAC")); - ISDCFMetadata m; - film->set_isdcf_metadata (m); film->set_interop (true); BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilm_FTR-1_F_EN-XX_GB-PG_10_2K_ST_20140704_FAC_IOP_OV"); @@ -99,7 +97,6 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) BOOST_REQUIRE (!wait_for_jobs()); BOOST_REQUIRE (audio->audio); audio->audio->set_language (dcp::LanguageTag("de-DE")); - film->set_isdcf_metadata (m); film->set_interop (false); BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_TLR-2_S_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV"); @@ -144,8 +141,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) film->set_red_band (true); film->set_two_d_version_of_three_d (true); film->set_chain (string("MyChain")); - m.mastered_luminance = "4fl"; - film->set_isdcf_metadata (m); + film->set_luminance (dcp::Luminance(4.5, dcp::Luminance::Unit::FOOT_LAMBERT)); film->set_video_frame_rate (48); BOOST_CHECK_EQUAL (film->isdcf_name(false), "MyNiceFilmWith_XSN-2-Temp-Pre-RedBand-MyChain-2D-4fl-48_F-133_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV"); @@ -157,8 +153,7 @@ BOOST_AUTO_TEST_CASE (isdcf_name_test) film->set_red_band (false); film->set_two_d_version_of_three_d (false); film->set_chain (string("")); - m.mastered_luminance = ""; - film->set_isdcf_metadata (m); + film->set_luminance (boost::none); film->set_video_frame_rate (24); film->set_name ("IKnowCamels"); BOOST_CHECK_EQUAL (film->isdcf_name(false), "IKnowCamels_XSN-2_F-133_DE-fr_US-R_MOS_4K_DI_20140704_PPF_SMPTE_OV"); diff --git a/test/test.cc b/test/test.cc index 8cbb2408b..ed8a93135 100644 --- a/test/test.cc +++ b/test/test.cc @@ -105,7 +105,6 @@ setup_test_config () Config::instance()->set_master_encoding_threads (boost::thread::hardware_concurrency()); Config::instance()->set_server_encoding_threads (1); Config::instance()->set_server_port_base (61921); - Config::instance()->set_default_isdcf_metadata (ISDCFMetadata ()); Config::instance()->set_default_container (Ratio::from_id ("185")); Config::instance()->set_default_dcp_content_type (static_cast (0)); Config::instance()->set_default_audio_delay (0); -- cgit v1.2.3