Tidy up video state identifer code slightly.
[dcpomatic.git] / src / lib / video_content.cc
index 3818fa7920fb4b86d6cbf990858a192473428a1b..c1f4d0089d8fab807b74d1fae14c8125ac6426f0 100644 (file)
@@ -222,3 +222,21 @@ VideoContent::set_ratio (Ratio const * r)
 
        signal_changed (VideoContentProperty::VIDEO_RATIO);
 }
+
+/** @return string which includes everything about how this content looks */
+string
+VideoContent::identifier () const
+{
+       stringstream s;
+       s << Content::digest()
+         << "_" << crop().left
+         << "_" << crop().right
+         << "_" << crop().top
+         << "_" << crop().bottom;
+
+       if (ratio()) {
+               s << "_" << ratio()->id ();
+       }
+
+       return s.str ();
+}