From 039d9d0c98ed62e7d08667af3427869dc6207d45 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 16 Nov 2019 01:42:49 +0100 Subject: Add UI for DCP head/tail. --- src/lib/film.cc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/lib/film.cc') 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(_head.get())); + root->add_child("Tail")->add_child_text(raw_convert(_tail.get())); _playlist->as_xml (root->add_child ("Playlist"), with_content_paths); return doc; @@ -578,6 +580,20 @@ Film::read_metadata (optional path) _content_version = f.optional_string_child("ContentVersion").get_value_or(""); + { + optional h = f.optional_number_child("Head"); + if (h) { + _head = DCPTime(*h); + } + } + + { + optional t = f.optional_number_child("Tail"); + if (t) { + _tail = DCPTime(*t); + } + } + list 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 ch (this, HEAD); + _head = h; +} + +void +Film::set_tail (DCPTime t) +{ + ChangeSignaller ch (this, TAIL); + _tail = t; +} + ContentList Film::content () const { -- cgit v1.2.3