+
+/** @return a list of properties that might be interesting to the user */
+list<UserProperty>
+Content::user_properties () const
+{
+ 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;
+ /* This is only called for video content and such content has its position forced
+ to start on a frame boundary.
+ */
+ t.push_back (position());
+ return t;
+}
+
+void
+Content::set_video_frame_rate (double r)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _video_frame_rate = r;
+ }
+
+ signal_changed (ContentProperty::VIDEO_FRAME_RATE);
+
+ /* Make sure things are still on frame boundaries */
+ if (video) {
+ set_position (position());
+ set_trim_start (trim_start());
+ }
+}
+
+void
+Content::unset_video_frame_rate ()
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _video_frame_rate = optional<double>();
+ }
+
+ signal_changed (ContentProperty::VIDEO_FRAME_RATE);
+}
+
+double
+Content::active_video_frame_rate () const
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ if (_video_frame_rate) {
+ return _video_frame_rate.get ();
+ }
+ }
+
+ /* No frame rate specified, so assume this content has been
+ prepared for any concurrent video content or perhaps
+ just the DCP rate.
+ */
+ shared_ptr<const Film> film = _film.lock ();
+ DCPOMATIC_ASSERT (film);
+ return film->active_frame_rate_change(position()).source;
+}
+
+void
+Content::add_properties (list<UserProperty>& p) const
+{
+ p.push_back (UserProperty (UserProperty::GENERAL, _("Filename"), path(0).string ()));
+
+ if (_video_frame_rate) {
+ if (video) {
+ p.push_back (
+ UserProperty (
+ UserProperty::VIDEO,
+ _("Frame rate"),
+ locale_convert<string> (_video_frame_rate.get(), 5),
+ _("frames per second")
+ )
+ );
+ } else {
+ p.push_back (
+ UserProperty (
+ UserProperty::GENERAL,
+ _("Prepared for video frame rate"),
+ locale_convert<string> (_video_frame_rate.get(), 5),
+ _("frames per second")
+ )
+ );
+ }
+ }
+}
+
+/** Take settings from the given content if it is of the correct type */
+void
+Content::take_settings_from (shared_ptr<const Content> c)
+{
+ if (video && c->video) {
+ video->take_settings_from (c->video);
+ }
+ if (audio && c->audio) {
+ audio->take_settings_from (c->audio);
+ }
+ if (subtitle && c->subtitle) {
+ subtitle->take_settings_from (c->subtitle);
+ }
+}