1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

Fix regression in scroll scrub

This commit is contained in:
Paul Licameli 2016-05-09 21:53:32 -04:00
parent 34d0a52011
commit cc0190054c
2 changed files with 7 additions and 12 deletions

View File

@ -201,7 +201,7 @@ void Scrubber::MarkScrubStart(
// needed for the decision to start scrubbing later when handling // needed for the decision to start scrubbing later when handling
// drag events. // drag events.
#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL #ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL
SetScrollScrubbing (smoothScrolling); mSmoothScrollingScrub = smoothScrolling;
#endif #endif
mAlwaysSeeking = alwaysSeeking; mAlwaysSeeking = alwaysSeeking;
@ -303,8 +303,10 @@ bool Scrubber::MaybeStartScrubbing(wxCoord xx)
// Wait to test again // Wait to test again
mScrubStartClockTimeMillis = ::wxGetLocalTimeMillis(); mScrubStartClockTimeMillis = ::wxGetLocalTimeMillis();
if (IsScrubbing()) if (IsScrubbing()) {
mProject->GetPlaybackScroller().Activate(mSmoothScrollingScrub);
mScrubHasFocus = true; mScrubHasFocus = true;
}
// Return true whether we started scrub, or are still waiting to decide. // Return true whether we started scrub, or are still waiting to decide.
return true; return true;
@ -380,7 +382,7 @@ void Scrubber::StopScrubbing()
UncheckAllMenuItems(); UncheckAllMenuItems();
mScrubStartPosition = -1; mScrubStartPosition = -1;
SetScrollScrubbing (false); mProject->GetPlaybackScroller().Activate(false);
if (!IsScrubbing()) if (!IsScrubbing())
{ {
@ -393,12 +395,6 @@ void Scrubber::StopScrubbing()
mProject->GetRulerPanel()->HideQuickPlayIndicator(); mProject->GetRulerPanel()->HideQuickPlayIndicator();
} }
void Scrubber::SetScrollScrubbing(bool scrollScrubbing)
{
mSmoothScrollingScrub = scrollScrubbing;
mProject->GetPlaybackScroller().Activate(scrollScrubbing);
}
bool Scrubber::IsScrubbing() const bool Scrubber::IsScrubbing() const
{ {
if (mScrubToken <= 0) if (mScrubToken <= 0)
@ -409,7 +405,6 @@ bool Scrubber::IsScrubbing() const
const_cast<Scrubber&>(*this).mScrubToken = -1; const_cast<Scrubber&>(*this).mScrubToken = -1;
const_cast<Scrubber&>(*this).mScrubStartPosition = -1; const_cast<Scrubber&>(*this).mScrubStartPosition = -1;
#ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL #ifdef EXPERIMENTAL_SCRUBBING_SMOOTH_SCROLL
// Don't call SetScrollScrubbing
const_cast<Scrubber&>(*this).mSmoothScrollingScrub = false; const_cast<Scrubber&>(*this).mSmoothScrollingScrub = false;
#endif #endif
return false; return false;
@ -677,7 +672,8 @@ void Scrubber::DoScrub(bool scroll, bool seek)
MarkScrubStart(xx, scroll, seek); MarkScrubStart(xx, scroll, seek);
} }
else if(!match) { else if(!match) {
SetScrollScrubbing(scroll); mSmoothScrollingScrub = scroll;
mProject->GetPlaybackScroller().Activate(scroll);
mAlwaysSeeking = seek; mAlwaysSeeking = seek;
UncheckAllMenuItems(); UncheckAllMenuItems();
CheckMenuItem(); CheckMenuItem();

View File

@ -57,7 +57,6 @@ public:
bool IsScrollScrubbing() const // If true, implies HasStartedScrubbing() bool IsScrollScrubbing() const // If true, implies HasStartedScrubbing()
{ return mSmoothScrollingScrub; } { return mSmoothScrollingScrub; }
void SetScrollScrubbing(bool scrollScrubbing);
bool IsAlwaysSeeking() const bool IsAlwaysSeeking() const
{ return mAlwaysSeeking; } { return mAlwaysSeeking; }