X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffilm.cc;h=90b18ea707eb3e20c043160e482b18a8704c9688;hb=579d18cb7770efe2da03afaf6a33faaf624119e3;hp=f7fd96a01a35e4f405bb0f575ec9cb161092de03;hpb=b69813dd682c8a0c3b7c46287b1a75c7c10f6a10;p=dcpomatic.git diff --git a/src/lib/film.cc b/src/lib/film.cc index f7fd96a01..90b18ea70 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -167,8 +167,9 @@ Film::Film (optional dir) set_isdcf_date_today (); _playlist_change_connection = _playlist->Change.connect (bind (&Film::playlist_change, this, _1)); - _playlist_order_changed_connection = _playlist->OrderChanged.connect (bind (&Film::playlist_order_changed, this)); + _playlist_order_changed_connection = _playlist->OrderChange.connect (bind (&Film::playlist_order_changed, this)); _playlist_content_change_connection = _playlist->ContentChange.connect (bind (&Film::playlist_content_change, this, _1, _2, _3, _4)); + _playlist_length_change_connection = _playlist->LengthChange.connect (bind(&Film::playlist_length_change, this)); if (dir) { /* Make state.directory a complete path without ..s (where possible) @@ -427,6 +428,7 @@ Film::metadata (bool with_content_paths) const BOOST_FOREACH (dcp::Rating i, _ratings) { i.as_xml (root->add_child("Rating")); } + root->add_child("ContentVersion")->add_child_text(_content_version); _playlist->as_xml (root->add_child ("Playlist"), with_content_paths); return doc; @@ -570,6 +572,8 @@ Film::read_metadata (optional path) _ratings.push_back (dcp::Rating(i)); } + _content_version = f.optional_string_child("ContentVersion").get_value_or(""); + list notes; _playlist->set_from_xml (shared_from_this(), f.node_child ("Playlist"), _state_version, notes); @@ -1289,6 +1293,12 @@ Film::playlist_content_change (ChangeType type, weak_ptr c, int p, bool } } +void +Film::playlist_length_change () +{ + LengthChange (); +} + void Film::playlist_change (ChangeType type) { @@ -1763,6 +1773,13 @@ Film::set_ratings (vector r) _ratings = r; } +void +Film::set_content_version (string v) +{ + ChangeSignaller ch (this, CONTENT_VERSION); + _content_version = v; +} + optional Film::marker (dcp::Marker type) const {