diff options
| author | Carl Hetherington <cth@carlh.net> | 2019-11-16 01:42:49 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-04-15 01:15:00 +0200 |
| commit | 039d9d0c98ed62e7d08667af3427869dc6207d45 (patch) | |
| tree | 54a4292f798b673f98d040cc02dd0e67cf44ce77 /src/lib | |
| parent | 39dcdd18487d5d1e20f0343fe617ed5bf44c1387 (diff) | |
Add UI for DCP head/tail.1608
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/film.cc | 30 | ||||
| -rw-r--r-- | src/lib/film.h | 17 |
2 files changed, 46 insertions, 1 deletions
diff --git a/src/lib/film.cc b/src/lib/film.cc index ed2c5a372..c46caff03 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -429,6 +429,8 @@ Film::metadata (bool with_content_paths) const i.as_xml (root->add_child("Rating")); } root->add_child("ContentVersion")->add_child_text(_content_version); + root->add_child("Head")->add_child_text(raw_convert<string>(_head.get())); + root->add_child("Tail")->add_child_text(raw_convert<string>(_tail.get())); _playlist->as_xml (root->add_child ("Playlist"), with_content_paths); return doc; @@ -578,6 +580,20 @@ Film::read_metadata (optional<boost::filesystem::path> path) _content_version = f.optional_string_child("ContentVersion").get_value_or(""); + { + optional<DCPTime::Type> h = f.optional_number_child<int64_t>("Head"); + if (h) { + _head = DCPTime(*h); + } + } + + { + optional<DCPTime::Type> t = f.optional_number_child<int64_t>("Tail"); + if (t) { + _tail = DCPTime(*t); + } + } + list<string> notes; _playlist->set_from_xml (shared_from_this(), f.node_child ("Playlist"), _state_version, notes); @@ -1165,6 +1181,20 @@ Film::set_key (dcp::Key key) _key = key; } +void +Film::set_head (DCPTime h) +{ + ChangeSignaller<Film> ch (this, HEAD); + _head = h; +} + +void +Film::set_tail (DCPTime t) +{ + ChangeSignaller<Film> ch (this, TAIL); + _tail = t; +} + ContentList Film::content () const { diff --git a/src/lib/film.h b/src/lib/film.h index c72251880..8d5f51a41 100644 --- a/src/lib/film.h +++ b/src/lib/film.h @@ -240,7 +240,9 @@ public: REENCODE_J2K, MARKERS, RATINGS, - CONTENT_VERSION + CONTENT_VERSION, + HEAD, + TAIL }; @@ -349,6 +351,15 @@ public: return _content_version; } + dcpomatic::DCPTime head () const { + return _head; + } + + dcpomatic::DCPTime tail () const { + return _tail; + } + + /* SET */ void set_directory (boost::filesystem::path); @@ -383,6 +394,8 @@ public: void unset_marker (dcp::Marker type); void set_ratings (std::vector<dcp::Rating> r); void set_content_version (std::string v); + void set_head (dcpomatic::DCPTime); + void set_tail (dcpomatic::DCPTime); /** Emitted when some property has of the Film is about to change or has changed */ mutable boost::signals2::signal<void (ChangeType, Property)> Change; @@ -474,6 +487,8 @@ private: std::map<dcp::Marker, dcpomatic::DCPTime> _markers; std::vector<dcp::Rating> _ratings; std::string _content_version; + dcpomatic::DCPTime _head; + dcpomatic::DCPTime _tail; int _state_version; |
