Content trim and position in the digests used to decide whether or not a rebuild...
authorCarl Hetherington <cth@carlh.net>
Wed, 16 Oct 2013 22:08:31 +0000 (23:08 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 16 Oct 2013 22:08:31 +0000 (23:08 +0100)
src/lib/content.cc
src/lib/content.h
src/lib/video_content.cc

index d2a07f79523f0e052b649a0d64425af9941b62d7..dbb84120034f441ed2028e2eb63a2836aed8ea48 100644 (file)
@@ -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 ();
+}
index 3c57dddbe5847289fab8211439f4cf23a0f593ae..9c7ad2fc2984df5ff021c2f623634ba96310f6a3 100644 (file)
@@ -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;
        
index 23ef2cf89dcce74463abcbadc0bbd8d824b0905d..3478368555b8139944144170b05ab67198134d4b 100644 (file)
@@ -227,7 +227,7 @@ string
 VideoContent::identifier () const
 {
        stringstream s;
-       s << Content::digest()
+       s << Content::identifier()
          << "_" << crop().left
          << "_" << crop().right
          << "_" << crop().top