Fix assertion failure on opening content properties (#816).
[dcpomatic.git] / src / lib / content.cc
index aa596f75a3f931ed0fc83b52914b737e6db600d4..724cabb6c6ce28f4bf1d5057e08dc062ab07b525 100644 (file)
@@ -223,9 +223,7 @@ Content::technical_summary () const
 DCPTime
 Content::length_after_trim () const
 {
-       shared_ptr<const Film> film = _film.lock ();
-       DCPOMATIC_ASSERT (film);
-       return max (DCPTime (), full_length() - DCPTime (trim_start() + trim_end(), film->active_frame_rate_change (position ())));
+       return max (DCPTime (), full_length() - DCPTime (trim_start() + trim_end(), film()->active_frame_rate_change (position ())));
 }
 
 /** @return string which changes when something about this content changes which affects
@@ -279,13 +277,29 @@ Content::path_summary () const
        return s;
 }
 
-/** @return a list of properties that might be interesting to the user; first string is the property name,
- *  second is the value.
- */
-list<pair<string, string> >
-Content::properties () const
+/** @return a list of properties that might be interesting to the user */
+list<Content::UserProperty>
+Content::user_properties () const
 {
-       list<pair<string, string> > p;
+       list<UserProperty> p;
        add_properties (p);
        return p;
 }
+
+shared_ptr<const Film>
+Content::film () const
+{
+       shared_ptr<const Film> film = _film.lock ();
+       DCPOMATIC_ASSERT (film);
+       return film;
+}
+
+/** @return DCP times of points within this content where a reel split could occur */
+list<DCPTime>
+Content::reel_split_points () const
+{
+       list<DCPTime> t;
+       /* XXX: this is questionable; perhaps the position itself should be forced to be on a frame boundary */
+       t.push_back (position().round_up (film()->video_frame_rate()));
+       return t;
+}