Use release territory from Interop/SMPTE metadata instead of ISDCF metadata dialogue.
authorCarl Hetherington <cth@carlh.net>
Fri, 2 Apr 2021 20:38:16 +0000 (22:38 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 4 Apr 2021 18:48:34 +0000 (20:48 +0200)
13 files changed:
src/lib/film.cc
src/lib/isdcf_metadata.cc
src/lib/isdcf_metadata.h
src/wx/dcp_panel.cc
src/wx/interop_metadata_dialog.cc
src/wx/interop_metadata_dialog.h
src/wx/isdcf_metadata_dialog.cc
src/wx/isdcf_metadata_dialog.h
src/wx/metadata_dialog.cc
src/wx/metadata_dialog.h
src/wx/smpte_metadata_dialog.cc
src/wx/smpte_metadata_dialog.h
test/isdcf_name_test.cc

index 5ccc5437a5cafedd6af5d32a950667772856d901..9051c5a1528d9696cdc7cb2e7480d8ab7aa963c2 100644 (file)
@@ -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 {
index 4f157ce70b1166f1dc503ae1696d8c7409f5dd48..daf3a4c4fb6158a92d5522deee297e3eb9c59d6e 100644 (file)
@@ -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 &&
index 22c418c6eaaa4775773838e6f45ff2760fd458f3..3dc2c2d354dee453a9ec9a050fbf65a3a5923520 100644 (file)
@@ -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;
index dcb78dc93f8e6b6283839825822a9bbf0fdd7bd0..ecedec66fc096cf269f1794985c0f714705117d9 100644 (file)
@@ -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:
index aa61984b36275c9d388005872167b1ed771793b2..61aa2349867426cdb6ba334d53af71bbd7b84e5a 100644 (file)
@@ -38,24 +38,22 @@ using namespace boost::placeholders;
 
 
 InteropMetadataDialog::InteropMetadataDialog (wxWindow* parent, weak_ptr<Film> 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<Film> f
        columns.push_back (EditableListColumn(_("Agency"), 200, true));
        columns.push_back (EditableListColumn(_("Label"), 50, true));
        _ratings = new EditableList<dcp::Rating, RatingDialog> (
-               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<Film> 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<Film> f
 vector<dcp::Rating>
 InteropMetadataDialog::ratings () const
 {
-       auto film = _film.lock ();
-       DCPOMATIC_ASSERT (film);
-       return film->ratings ();
+       return film()->ratings ();
 }
 
+
 void
 InteropMetadataDialog::set_ratings (vector<dcp::Rating> 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<string> 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()) });
 }
index b8a1a36e61c121d0c74e0f54b66a3c5033856805..b730c12381e85868f877fd77bb417f8884fb297e 100644 (file)
@@ -20,6 +20,7 @@
 
 
 #include "editable_list.h"
+#include "metadata_dialog.h"
 #include <dcp/language_tag.h>
 #include <dcp/types.h>
 #include <wx/wx.h>
@@ -31,17 +32,19 @@ class LanguageTagWidget;
 class RatingDialog;
 
 
-class InteropMetadataDialog : public wxDialog
+class InteropMetadataDialog : public MetadataDialog
 {
 public:
        InteropMetadataDialog (wxWindow* parent, std::weak_ptr<Film> film);
 
 private:
-       std::vector<dcp::Rating> ratings () const;
+       void setup_standard (wxPanel* panel, wxSizer* sizer) override;
+
        void set_ratings (std::vector<dcp::Rating> r);
        void content_version_changed ();
 
-       std::weak_ptr<Film> _film;
+       std::vector<dcp::Rating> ratings () const;
+
        EditableList<dcp::Rating, RatingDialog>* _ratings;
        wxTextCtrl* _content_version;
 };
index d204258dd3e95fce0e7488d6aa6efbcf4deb6d25..cb12d6a292d29e828ead50c8f7ee9c1d6edadc33 100644 (file)
@@ -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 ());
index 0df00017a22eb0b6f2a8c4f007493ca496985f96..8980bd11a438abda5cabe286903df1421600a482 100644 (file)
@@ -33,7 +33,6 @@ public:
        ISDCFMetadata isdcf_metadata () const;
 
 private:
-       wxTextCtrl* _territory;
        wxTextCtrl* _rating;
        wxTextCtrl* _studio;
        wxTextCtrl* _facility;
index abc95c3c15c57f5ae28c7091956a89faa2602640..376591ca23760977457b23f8e767c3bfa1b21ba8 100644 (file)
@@ -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<bool>(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 ();
+       }
 }
 
index ef5dd0687fe23dd66cd95308e6b0c7b91d2449be..8483d861506d362194e20c2d89f1376ed99c7200 100644 (file)
 */
 
 
+#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<dcp::LanguageTag::RegionSubtag> _release_territory;
+       wxStaticText* _release_territory_text;
+       Button* _edit_release_territory;
+
+       boost::signals2::scoped_connection _film_changed_connection;
 };
+
+
+#endif
+
index a2e9d355adf5bab34c8e6c432ff76b1434707f13..857be282c8ba75a0917d11185047672c89f6d81a 100644 (file)
@@ -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<bool>(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 ()
 {
index e27401e87531bcb0ddcab9ac8fa6fadf871b915f..28cc381439e3c0afa023a2a879650c0489475c41 100644 (file)
@@ -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<dcp::Rating> ratings () const;
        void set_ratings (std::vector<dcp::Rating> r);
        std::vector<std::string> content_versions () const;
        void set_content_versions (std::vector<std::string> 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<dcp::LanguageTag::RegionSubtag> _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<dcp::Rating, RatingDialog>* _ratings;
        EditableList<std::string, ContentVersionDialog>* _content_versions;
-
-       boost::signals2::scoped_connection _film_changed_connection;
 };
index 3d7b69665dd1387c980d2a2b95a4fbacca6d460b..51a8c500943b74dd51555c772d8b7fe8b466b5c4 100644 (file)
@@ -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";