diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-12 15:17:45 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-12 15:17:45 +0100 |
| commit | c2b6ca1193107581b433d294aa2327a936f77383 (patch) | |
| tree | 08d26653c408f8af7e070a60f62e6feac1509e58 /src/lib/video_content.cc | |
| parent | 4b971f28170354c415f74fd99cbcc3a328325337 (diff) | |
Tidy up video state identifer code slightly.
Diffstat (limited to 'src/lib/video_content.cc')
| -rw-r--r-- | src/lib/video_content.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index 3818fa792..c1f4d0089 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -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 (); +} |
