From c5d42377b770d491fca439427a8bd9969a570a16 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Fri, 6 May 2016 12:38:41 -0400 Subject: [PATCH] Scrub during play stops play, repositions play head --- src/tracks/ui/Scrubbing.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/tracks/ui/Scrubbing.cpp b/src/tracks/ui/Scrubbing.cpp index b8fe0dc82..125c14422 100644 --- a/src/tracks/ui/Scrubbing.cpp +++ b/src/tracks/ui/Scrubbing.cpp @@ -203,19 +203,26 @@ void Scrubber::MarkScrubStart( SetScrollScrubbing (smoothScrolling); #endif mAlwaysSeeking = alwaysSeeking; - mScrubStartPosition = xx; - mScrubStartClockTimeMillis = ::wxGetLocalTimeMillis(); ControlToolBar * const ctb = mProject->GetControlToolBar(); + + // Stop any play in progress + ctb->StopPlaying(); + // Usually the timer handler of TrackPanel does this, but we do this now, + // so that same timer does not StopPlaying() again after this function and destroy + // scrubber state + mProject->SetAudioIOToken(0); + ctb->SetPlay(true, ControlToolBar::PlayAppearance::Scrub); - if(gAudioIO->IsPaused()) - ctb->Pause(); // un-pause // This disables the pause button. ctb->EnableDisableButtons(); ctb->UpdateStatusBar(mProject); + mScrubStartPosition = xx; + mScrubStartClockTimeMillis = ::wxGetLocalTimeMillis(); + CheckMenuItem(); }