# HG changeset patch # User Chris Cannam # Date 1183125488 0 # Node ID 63a9c88fbba9f2c384deff1dd26713a0f92d9218 # Parent 7310316bf74b426fe3ca79b9b7002c1fe035c23c * highlight the nearest measurement rect * fix rewind during playback diff -r 7310316bf74b -r 63a9c88fbba9 main/MainWindow.cpp --- a/main/MainWindow.cpp Thu Jun 28 14:50:58 2007 +0000 +++ b/main/MainWindow.cpp Fri Jun 29 13:58:08 2007 +0000 @@ -3411,6 +3411,18 @@ Layer *layer = getSnapLayer(); size_t sr = getMainModel()->getSampleRate(); + + // when rewinding during playback, we want to allow a period + // following a rewind target point at which the rewind will go to + // the prior point instead of the immediately neighbouring one + if (m_playSource && m_playSource->isPlaying()) { + RealTime ct = RealTime::frame2RealTime(frame, sr); + ct = ct - RealTime::fromSeconds(0.25); + if (ct < RealTime::zeroTime) ct = RealTime::zeroTime; +// std::cerr << "rewind: frame " << frame << " -> "; + frame = RealTime::realTime2Frame(ct, sr); +// std::cerr << frame << std::endl; + } if (!layer) {