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/film.cc | |
| parent | 39dcdd18487d5d1e20f0343fe617ed5bf44c1387 (diff) | |
Add UI for DCP head/tail.1608
Diffstat (limited to 'src/lib/film.cc')
| -rw-r--r-- | src/lib/film.cc | 30 |
1 files changed, 30 insertions, 0 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 { |
