diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-04-03 01:10:20 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-04-04 20:48:35 +0200 |
| commit | 8d9e73b753ed51067d93aa377bb24400ff22936e (patch) | |
| tree | c9db8a0ac290c9ed50c44f707f5a987dbcec64d6 /src/lib | |
| parent | ea51ac3483161343b7aefabe54420c6cb431c0fe (diff) | |
Move some ISDCF flags to the Interop/SMPTE metadata.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/film.cc | 54 | ||||
| -rw-r--r-- | src/lib/film.h | 28 | ||||
| -rw-r--r-- | src/lib/isdcf_metadata.cc | 16 | ||||
| -rw-r--r-- | src/lib/isdcf_metadata.h | 16 |
4 files changed, 78 insertions, 36 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; }; |
