+ if (ui_signaller) {
+ ui_signaller->emit (boost::bind (boost::ref (Changed), shared_from_this (), p, _change_signals_frequent));
+ }
+}
+
+void
+Content::set_position (Time p)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _position = p;
+ }
+
+ signal_changed (ContentProperty::POSITION);
+}
+
+void
+Content::set_trim_start (Time t)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _trim_start = t;
+ }
+
+ signal_changed (ContentProperty::TRIM_START);
+}
+
+void
+Content::set_trim_end (Time t)
+{
+ {
+ boost::mutex::scoped_lock lm (_mutex);
+ _trim_end = t;
+ }
+
+ signal_changed (ContentProperty::TRIM_END);
+}
+
+
+shared_ptr<Content>
+Content::clone () const
+{
+ shared_ptr<const Film> film = _film.lock ();
+ if (!film) {
+ return shared_ptr<Content> ();
+ }
+
+ /* This is a bit naughty, but I can't think of a compelling reason not to do it ... */
+ xmlpp::Document doc;
+ xmlpp::Node* node = doc.create_root_node ("Content");
+ as_xml (node);
+ return content_factory (film, shared_ptr<cxml::Node> (new cxml::Node (node)));
+}
+
+string
+Content::technical_summary () const
+{
+ return String::compose ("%1 %2 %3", path(), digest(), position());
+}
+
+Time
+Content::length_after_trim () const
+{
+ return full_length() - trim_start() - trim_end();
+}
+
+/** @param t A time relative to the start of this content (not the position).
+ * @return true if this time is trimmed by our trim settings.
+ */
+bool
+Content::trimmed (Time t) const
+{
+ return (t < trim_start() || t > (full_length() - trim_end ()));