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

Scrub during play stops play, repositions play head

This commit is contained in:
Paul Licameli 2016-05-06 12:38:41 -04:00
parent 66454b7e4c
commit c5d42377b7

View File

@ -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();
}