1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-14 17:14:07 +01:00

Consolidate the code that starts and stops play/rec head scrolling

This commit is contained in:
Paul Licameli
2016-05-29 14:28:06 -04:00
parent d62442827c
commit fecc6f53e4
5 changed files with 61 additions and 37 deletions

View File

@@ -508,8 +508,6 @@ void Scrubber::StopScrubbing()
UncheckAllMenuItems();
mScrubStartPosition = -1;
mProject->GetPlaybackScroller().Activate
(AudacityProject::PlaybackScroller::Mode::Off);
mDragging = false;
if (!IsScrubbing())
@@ -784,20 +782,21 @@ bool Scrubber::PollIsSeeking()
void Scrubber::ActivateScroller()
{
using Mode = AudacityProject::PlaybackScroller::Mode;
mProject->GetPlaybackScroller().Activate(mSmoothScrollingScrub
? Mode::Centered
:
const auto ctb = mProject->GetControlToolBar();
if (mSmoothScrollingScrub)
ctb->StartScrolling();
else {
#ifdef __WXMAC__
// PRL: cause many "unnecessary" refreshes. For reasons I don't understand,
// doing this causes wheel rotation events (mapped from the double finger vertical
// swipe) to be delivered more uniformly to the application, so that spped control
// works better.
Mode::Refresh
// PRL: cause many "unnecessary" refreshes. For reasons I don't understand,
// doing this causes wheel rotation events (mapped from the double finger vertical
// swipe) to be delivered more uniformly to the application, so that speed control
// works better.
mProject->GetPlaybackScroller().Activate
(AudacityProject::PlaybackScroller::Mode::Refresh);
#else
Mode::Off
ctb->StopScrolling();
#endif
);
}
}
void Scrubber::DoScrub(bool scroll, bool seek)