mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-14 17:14:07 +01:00
Don't let seek make a stutter at less than unit speed
This commit is contained in:
@@ -341,6 +341,7 @@ bool Scrubber::MaybeStartScrubbing(wxCoord xx)
|
||||
options.pScrubbingOptions = &mOptions;
|
||||
options.timeTrack = NULL;
|
||||
mOptions.delay = (ScrubPollInterval_ms * 0.9 / 1000.0);
|
||||
mOptions.minSpeed = 0.0;
|
||||
#ifdef USE_TRANSCRIPTION_TOOLBAR
|
||||
if (!mAlwaysSeeking) {
|
||||
// Take the starting speed limit from the transcription toolbar,
|
||||
@@ -414,6 +415,7 @@ void Scrubber::ContinueScrubbingPoll()
|
||||
bool result = false;
|
||||
if (mPaused) {
|
||||
// When paused, enqueue silent scrubs.
|
||||
mOptions.minSpeed = 0.0;
|
||||
mOptions.maxSpeed = mMaxSpeed;
|
||||
mOptions.adjustStart = false;
|
||||
mOptions.enqueueBySpeed = true;
|
||||
@@ -428,6 +430,7 @@ void Scrubber::ContinueScrubbingPoll()
|
||||
const auto lastTime = gAudioIO->GetLastTimeInScrubQueue();
|
||||
const auto delta = mLastScrubPosition - position.x;
|
||||
const double time = viewInfo.OffsetTimeByPixels(lastTime, delta);
|
||||
mOptions.minSpeed = 0.0;
|
||||
mOptions.maxSpeed = mMaxSpeed;
|
||||
mOptions.adjustStart = true;
|
||||
mOptions.enqueueBySpeed = false;
|
||||
@@ -437,6 +440,7 @@ void Scrubber::ContinueScrubbingPoll()
|
||||
else {
|
||||
const double time = viewInfo.PositionToTime(position.x, trackPanel->GetLeftOffset());
|
||||
mOptions.adjustStart = seek;
|
||||
mOptions.minSpeed = (mDragging || !seek) ? 0.0 : 1.0;
|
||||
mOptions.maxSpeed = (mDragging || !seek) ? mMaxSpeed : 1.0;
|
||||
|
||||
if (mSmoothScrollingScrub) {
|
||||
|
||||
@@ -40,7 +40,8 @@ struct ScrubbingOptions {
|
||||
|
||||
double delay {};
|
||||
|
||||
// A limiting value for the speed of a scrub interval:
|
||||
// Limiting values for the speed of a scrub interval:
|
||||
double minSpeed { 0.0 };
|
||||
double maxSpeed { 1.0 };
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user