# HG changeset patch # User Chris Cannam # Date 1138119658 0 # Node ID aa37f84ab70a700abe0d1cce9ceeaf614f42c4c9 # Parent 01849cd277e6a76322ed512936ee32ea6f310552 * Add play-selection and looping modes. Looping seems to work OK, but the plain play-selection is miscalculating current frame number to feed back to the GUI. * Cache selection rectanges wherever possible in View::paintEvent. diff -r 01849cd277e6 -r aa37f84ab70a widgets/Pane.cpp --- a/widgets/Pane.cpp Mon Jan 23 17:02:57 2006 +0000 +++ b/widgets/Pane.cpp Tue Jan 24 16:20:58 2006 +0000 @@ -445,9 +445,15 @@ int offset = mouseFrame - getStartFrame(); int available = getEndFrame() - getStartFrame(); if (offset >= available * 0.9) { - setCentreFrame(m_centreFrame + int(offset - available * 0.9) + 1); + int move = int(offset - available * 0.9) + 1; + setCentreFrame(m_centreFrame + move); } else if (offset <= available * 0.15) { - setCentreFrame(m_centreFrame - int(available * 0.15 - offset) - 1); + int move = int(available * 0.15 - offset) + 1; + if (m_centreFrame > move) { + setCentreFrame(m_centreFrame - move); + } else { + setCentreFrame(0); + } } }