diff view/ViewManager.cpp @ 368:eedb7f341ec5 sv1-v1.2pre4

* a hack to try to prevent playback pointer bouncing back when playback starts
author Chris Cannam
date Mon, 11 Feb 2008 17:08:59 +0000
parents 6167a28d25fc
children e1a9e478b7f2
line wrap: on
line diff
--- a/view/ViewManager.cpp	Mon Feb 11 12:46:39 2008 +0000
+++ b/view/ViewManager.cpp	Mon Feb 11 17:08:59 2008 +0000
@@ -275,18 +275,19 @@
     MultiSelection::SelectionList sl = getSelections();
     if (sl.empty()) return frame;
 
-    size_t selectionStartFrame = sl.begin()->getStartFrame();
-    if (frame < selectionStartFrame) {
-        frame = selectionStartFrame;
-        return frame;
+    for (MultiSelection::SelectionList::const_iterator i = sl.begin();
+         i != sl.end(); ++i) {
+
+        if (frame < i->getEndFrame()) {
+            if (frame < i->getStartFrame()) {
+                return i->getStartFrame();
+            } else {
+                return frame;
+            }
+        }
     }
 
-    MultiSelection::SelectionList::iterator i = sl.end();
-    --i;
-    size_t selectionEndFrame = i->getEndFrame();
-    if (frame > selectionEndFrame) frame = selectionEndFrame;
-
-    return frame;
+    return sl.begin()->getStartFrame();
 }
 
 void