root->add_child("ContentVersion")->add_child_text(i);
}
root->add_child("NameLanguage")->add_child_text(_name_language.to_string());
+ root->add_child("TerritoryType")->add_child_text(territory_type_to_string(_territory_type));
if (_release_territory) {
root->add_child("ReleaseTerritory")->add_child_text(_release_territory->subtag());
}
if (name_language) {
_name_language = dcp::LanguageTag (*name_language);
}
+ auto territory_type = f.optional_string_child("TerritoryType");
+ if (territory_type) {
+ _territory_type = string_to_territory_type(*territory_type);
+ }
auto release_territory = f.optional_string_child("ReleaseTerritory");
if (release_territory) {
_release_territory = dcp::LanguageTag::RegionSubtag (*release_territory);
isdcf_name += "-XX";
}
- if (_release_territory) {
+ if (_territory_type == TerritoryType::INTERNATIONAL_TEXTED) {
+ isdcf_name += "_INT-TD";
+ } else if (_territory_type == TerritoryType::INTERNATIONAL_TEXTLESS) {
+ isdcf_name += "_INT-TL";
+ } else if (_release_territory) {
auto territory = _release_territory->subtag();
isdcf_name += "_" + to_upper (territory);
if (!_ratings.empty()) {
return our_micro < micro;
}
+
+void
+Film::set_territory_type(TerritoryType type)
+{
+ FilmChangeSignaller ch(this, FilmProperty::TERRITORY_TYPE);
+ _territory_type = type;
+}
+
#include "named_channel.h"
#include "resolution.h"
#include "signaller.h"
+#include "territory_type.h"
#include "transcode_job.h"
#include "types.h"
#include "util.h"
return _name_language;
}
+ TerritoryType territory_type() const {
+ return _territory_type;
+ }
+
boost::optional<dcp::LanguageTag::RegionSubtag> release_territory () const {
return _release_territory;
}
void set_ratings (std::vector<dcp::Rating> r);
void set_content_versions (std::vector<std::string> v);
void set_name_language (dcp::LanguageTag lang);
+ void set_territory_type(TerritoryType type);
void set_release_territory (boost::optional<dcp::LanguageTag::RegionSubtag> region = boost::none);
void set_sign_language_video_language (boost::optional<dcp::LanguageTag> tag);
void set_version_number (int v);
std::vector<dcp::Rating> _ratings;
std::vector<std::string> _content_versions;
dcp::LanguageTag _name_language;
+ TerritoryType _territory_type = TerritoryType::SPECIFIC;
boost::optional<dcp::LanguageTag::RegionSubtag> _release_territory;
boost::optional<dcp::LanguageTag> _sign_language_video_language;
int _version_number;
RED_BAND,
TWO_D_VERSION_OF_THREE_D,
LUMINANCE,
+ TERRITORY_TYPE,
};
--- /dev/null
+/*
+ Copyright (C) 2023 Carl Hetherington <cth@carlh.net>
+
+ 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 <http://www.gnu.org/licenses/>.
+*/
+
+
+#include "dcpomatic_assert.h"
+#include "territory_type.h"
+
+
+using std::string;
+
+
+string
+territory_type_to_string(TerritoryType type)
+{
+ switch (type) {
+ case TerritoryType::INTERNATIONAL_TEXTED:
+ return "international-texted";
+ case TerritoryType::INTERNATIONAL_TEXTLESS:
+ return "international-textless";
+ case TerritoryType::SPECIFIC:
+ return "specific";
+ }
+
+ DCPOMATIC_ASSERT(false);
+}
+
+
+TerritoryType
+string_to_territory_type(string type)
+{
+ if (type == "international-texted") {
+ return TerritoryType::INTERNATIONAL_TEXTED;
+ } else if (type == "international-textless") {
+ return TerritoryType::INTERNATIONAL_TEXTLESS;
+ } else if (type == "specific") {
+ return TerritoryType::SPECIFIC;
+ }
+
+ DCPOMATIC_ASSERT(false);
+}
+
--- /dev/null
+/*
+ Copyright (C) 2023 Carl Hetherington <cth@carlh.net>
+
+ 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 <http://www.gnu.org/licenses/>.
+*/
+
+
+#ifndef DCPOMATIC_TERRITORY_TYPE_H
+#define DCPOMATIC_TERRITORY_TYPE_H
+
+
+#include <string>
+
+
+enum class TerritoryType
+{
+ INTERNATIONAL_TEXTED,
+ INTERNATIONAL_TEXTLESS,
+ SPECIFIC
+};
+
+
+std::string territory_type_to_string(TerritoryType);
+TerritoryType string_to_territory_type(std::string);
+
+
+#endif
+
case FilmProperty::TWO_D_VERSION_OF_THREE_D:
case FilmProperty::CHAIN:
case FilmProperty::LUMINANCE:
+ case FilmProperty::TERRITORY_TYPE:
setup_dcp_name ();
break;
default:
_enable_luminance->bind(&MetadataDialog::enable_luminance_changed, this);
_luminance_value->Bind (wxEVT_SPINCTRLDOUBLE, boost::bind(&MetadataDialog::luminance_changed, this));
_luminance_unit->Bind (wxEVT_CHOICE, boost::bind(&MetadataDialog::luminance_changed, this));
+ _territory_type->bind(&MetadataDialog::territory_type_changed, this);
_film_changed_connection = film()->Change.connect(boost::bind(&MetadataDialog::film_changed, this, _1, _2));
film_changed(ChangeType::DONE, FilmProperty::TWO_D_VERSION_OF_THREE_D);
film_changed(ChangeType::DONE, FilmProperty::CHAIN);
film_changed(ChangeType::DONE, FilmProperty::LUMINANCE);
+ film_changed(ChangeType::DONE, FilmProperty::TERRITORY_TYPE);
setup_sensitivity ();
}
+void
+MetadataDialog::territory_type_changed()
+{
+ auto data = _territory_type->get_data();
+ if (data) {
+ film()->set_territory_type(string_to_territory_type(wx_to_std(data->data())));
+ }
+}
+
+
void
MetadataDialog::film_changed(ChangeType type, FilmProperty property)
{
checked_set(_luminance_value, 14);
checked_set (_luminance_unit, 1);
}
+ } else if (property == FilmProperty::TERRITORY_TYPE) {
+ _territory_type->set_by_data(territory_type_to_string(film()->territory_type()));
+ setup_sensitivity();
}
}
void
MetadataDialog::setup_standard (wxPanel* panel, wxSizer* sizer)
{
+ add_label_to_sizer(sizer, panel, _("Territory type"), true, 0, wxALIGN_CENTER_VERTICAL);
+ _territory_type = new Choice(panel);
+ _territory_type->add(_("Specific"), wx_to_std(territory_type_to_string(TerritoryType::SPECIFIC)));
+ _territory_type->add(_("International texted"), wx_to_std(territory_type_to_string(TerritoryType::INTERNATIONAL_TEXTED)));
+ _territory_type->add(_("International textless"), wx_to_std(territory_type_to_string(TerritoryType::INTERNATIONAL_TEXTLESS)));
+ sizer->Add(_territory_type);
+
_enable_release_territory = new CheckBox(panel, _("Release territory"));
sizer->Add (_enable_release_territory, 0, wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_GAP);
_release_territory = new RegionSubtagWidget(panel, _("Release territory for this DCP"), film()->release_territory());
void
MetadataDialog::setup_sensitivity ()
{
+ auto const territory_type = film()->territory_type();
+ _enable_release_territory->Enable(territory_type == TerritoryType::SPECIFIC);
_sign_language_video_language->enable (film()->has_sign_language_video_channel());
auto const enabled = _enable_release_territory->GetValue();
- _release_territory->enable(enabled);
+ _release_territory->enable(enabled && territory_type == TerritoryType::SPECIFIC);
+ _ratings->Enable(territory_type == TerritoryType::SPECIFIC);
_facility->Enable (_enable_facility->GetValue());
_chain->Enable (_enable_chain->GetValue());
_studio->Enable (_enable_studio->GetValue());
void luminance_changed ();
std::vector<dcp::Rating> ratings () const;
void set_ratings (std::vector<dcp::Rating> r);
+ void territory_type_changed();
CheckBox* _enable_release_territory;
/** The current release territory displayed in the UI; since we can't easily convert
*/
boost::optional<dcp::LanguageTag::RegionSubtag> _release_territory_copy;
RegionSubtagWidget* _release_territory;
+ Choice* _territory_type;
LanguageTagWidget* _sign_language_video_language = nullptr;
CheckBox* _enable_facility;
wxTextCtrl* _facility;
-Subproject commit a513e2cd9f48dd0f6f748e4b5a77c559bbf915cf
+Subproject commit ae6d44f2c605b2035fa0346798c3b536ed1a0160