1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-04 17:49:45 +02:00

Don't squeak when starting a drag-scrub

This commit is contained in:
Paul Licameli 2016-05-22 16:34:43 -04:00
parent e4a2d23017
commit 24ef578a89

View File

@ -49,6 +49,7 @@ enum {
};
static const double MinStutter = 0.2;
static const double MaxDragSpeed = 1.0;
namespace {
double FindScrubbingSpeed(const ViewInfo &viewInfo, double maxScrubSpeed, double screen, double timeAtMouse)
@ -311,8 +312,7 @@ bool Scrubber::MaybeStartScrubbing(wxCoord xx)
#else
// That idea seems unpopular... just make it one for move-scrub,
// but big for drag-scrub
mOptions.maxSpeed =
mDragging ? ScrubbingOptions::MaxAllowedScrubSpeed() : 1.0;
mOptions.maxSpeed = mDragging ? MaxDragSpeed : 1.0;
#endif
mOptions.minSample = 0;
mOptions.maxSample =
@ -420,7 +420,9 @@ void Scrubber::ContinueScrubbing()
}
else {
mOptions.enqueueBySpeed = false;
result = gAudioIO->EnqueueScrub(time, seek ? 1.0 : mOptions.maxSpeed, mOptions);
auto maxSpeed =
(mDragging || !seek) ? mOptions.maxSpeed : 1.0;
result = gAudioIO->EnqueueScrub(time, maxSpeed, mOptions);
}
}