comparison 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
comparison
equal deleted inserted replaced
367:06360ed99cd1 368:eedb7f341ec5
273 ViewManager::constrainFrameToSelection(size_t frame) const 273 ViewManager::constrainFrameToSelection(size_t frame) const
274 { 274 {
275 MultiSelection::SelectionList sl = getSelections(); 275 MultiSelection::SelectionList sl = getSelections();
276 if (sl.empty()) return frame; 276 if (sl.empty()) return frame;
277 277
278 size_t selectionStartFrame = sl.begin()->getStartFrame(); 278 for (MultiSelection::SelectionList::const_iterator i = sl.begin();
279 if (frame < selectionStartFrame) { 279 i != sl.end(); ++i) {
280 frame = selectionStartFrame; 280
281 return frame; 281 if (frame < i->getEndFrame()) {
282 } 282 if (frame < i->getStartFrame()) {
283 283 return i->getStartFrame();
284 MultiSelection::SelectionList::iterator i = sl.end(); 284 } else {
285 --i; 285 return frame;
286 size_t selectionEndFrame = i->getEndFrame(); 286 }
287 if (frame > selectionEndFrame) frame = selectionEndFrame; 287 }
288 288 }
289 return frame; 289
290 return sl.begin()->getStartFrame();
290 } 291 }
291 292
292 void 293 void
293 ViewManager::signalSelectionChange() 294 ViewManager::signalSelectionChange()
294 { 295 {