summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2021-04-03 01:10:20 +0200
committerCarl Hetherington <cth@carlh.net>2021-04-04 20:48:35 +0200
commit8d9e73b753ed51067d93aa377bb24400ff22936e (patch)
treec9db8a0ac290c9ed50c44f707f5a987dbcec64d6 /src
parentea51ac3483161343b7aefabe54420c6cb431c0fe (diff)
Move some ISDCF flags to the Interop/SMPTE metadata.
Diffstat (limited to 'src')
-rw-r--r--src/lib/film.cc54
-rw-r--r--src/lib/film.h28
-rw-r--r--src/lib/isdcf_metadata.cc16
-rw-r--r--src/lib/isdcf_metadata.h16
-rw-r--r--src/wx/dcp_panel.cc6
-rw-r--r--src/wx/full_config_dialog.cc2
-rw-r--r--src/wx/isdcf_metadata_dialog.cc26
-rw-r--r--src/wx/isdcf_metadata_dialog.h6
-rw-r--r--src/wx/metadata_dialog.cc64
-rw-r--r--src/wx/metadata_dialog.h8
10 files changed, 155 insertions, 71 deletions
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<string>(_luminance->value()));
root->add_child("LuminanceUnit")->add_child_text(dcp::Luminance::unit_to_string(_luminance->unit()));
@@ -670,6 +674,10 @@ Film::read_metadata (optional<boost::filesystem::path> 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<float>("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<dcp::Luminance> luminance () const {
return _luminance;
}
@@ -422,6 +442,10 @@ public:
void set_chain (boost::optional<std::string> c = boost::none);
void set_facility (boost::optional<std::string> f = boost::none);
void set_studio (boost::optional<std::string> 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<std::string> d = boost::none);
void set_luminance (boost::optional<dcp::Luminance> l = boost::none);
@@ -529,6 +553,10 @@ private:
boost::optional<std::string> _distributor;
boost::optional<std::string> _facility;
boost::optional<std::string> _studio;
+ bool _temp_version = false;
+ bool _pre_release = false;
+ bool _red_band = false;
+ bool _two_d_version_of_three_d = false;
boost::optional<dcp::Luminance> _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;
};