diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/content.cc | 17 | ||||
| -rw-r--r-- | src/lib/content.h | 1 | ||||
| -rw-r--r-- | src/lib/video_content.cc | 2 |
3 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/content.cc b/src/lib/content.cc index d2a07f795..dbb841200 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -26,6 +26,7 @@ #include "ui_signaller.h" using std::string; +using std::stringstream; using std::set; using boost::shared_ptr; using boost::lexical_cast; @@ -174,3 +175,19 @@ Content::trimmed (Time t) const { return (t < trim_start() || t > (full_length() - trim_end ())); } + +/** @return string which includes everything about how this content affects + * its playlist. + */ +string +Content::identifier () const +{ + stringstream s; + + s << Content::digest() + << "_" << position() + << "_" << trim_start() + << "_" << trim_end(); + + return s.str (); +} diff --git a/src/lib/content.h b/src/lib/content.h index 3c57dddbe..9c7ad2fc2 100644 --- a/src/lib/content.h +++ b/src/lib/content.h @@ -58,6 +58,7 @@ public: virtual std::string information () const = 0; virtual void as_xml (xmlpp::Node *) const; virtual Time full_length () const = 0; + virtual std::string identifier () const; boost::shared_ptr<Content> clone () const; diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index 23ef2cf89..347836855 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -227,7 +227,7 @@ string VideoContent::identifier () const { stringstream s; - s << Content::digest() + s << Content::identifier() << "_" << crop().left << "_" << crop().right << "_" << crop().top |
