summaryrefslogtreecommitdiff
path: root/src/lib/content.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-07-30 21:34:16 +0100
committerCarl Hetherington <cth@carlh.net>2013-07-30 21:34:16 +0100
commitc57e92b12c64d4ad1a7f23876a97471565f9a252 (patch)
tree008213d35e4be34c55caa51760ab7aef6fa33113 /src/lib/content.h
parente241b3d295fe4158239170f17391e08473e159c5 (diff)
Somewhat untested and sketchy basics of trimming.
Diffstat (limited to 'src/lib/content.h')
-rw-r--r--src/lib/content.h39
1 files changed, 32 insertions, 7 deletions
diff --git a/src/lib/content.h b/src/lib/content.h
index 78b80e254..e3f559752 100644
--- a/src/lib/content.h
+++ b/src/lib/content.h
@@ -38,8 +38,10 @@ class Film;
class ContentProperty
{
public:
- static int const START;
+ static int const POSITION;
static int const LENGTH;
+ static int const TRIM_START;
+ static int const TRIM_END;
};
class Content : public boost::enable_shared_from_this<Content>, public boost::noncopyable
@@ -55,7 +57,7 @@ public:
virtual std::string technical_summary () const;
virtual std::string information () const = 0;
virtual void as_xml (xmlpp::Node *) const;
- virtual Time length () const = 0;
+ virtual Time full_length () const = 0;
boost::shared_ptr<Content> clone () const;
@@ -70,21 +72,42 @@ public:
return _digest;
}
- void set_start (Time);
+ void set_position (Time);
- Time start () const {
+ /** Time that this content starts; i.e. the time that the first
+ * bit of the content (trimmed or not) will happen.
+ */
+ Time position () const {
boost::mutex::scoped_lock lm (_mutex);
- return _start;
+ return _position;
}
+ void set_trim_start (Time);
+
+ Time trim_start () const {
+ boost::mutex::scoped_lock lm (_mutex);
+ return _trim_start;
+ }
+
+ void set_trim_end (Time);
+
+ Time trim_end () const {
+ boost::mutex::scoped_lock lm (_mutex);
+ return _trim_end;
+ }
+
Time end () const {
- return start() + length();
+ return position() + length_after_trim();
}
+ Time length_after_trim () const;
+
void set_change_signals_frequent (bool f) {
_change_signals_frequent = f;
}
+ bool trimmed (Time) const;
+
boost::signals2::signal<void (boost::weak_ptr<Content>, int, bool)> Changed;
protected:
@@ -97,7 +120,9 @@ private:
/** Path of a file or a directory containing files */
boost::filesystem::path _path;
std::string _digest;
- Time _start;
+ Time _position;
+ Time _trim_start;
+ Time _trim_end;
bool _change_signals_frequent;
};