From f13e621bc15be198ecb7d3655443610c6f10dda1 Mon Sep 17 00:00:00 2001 From: James Crook Date: Fri, 27 Jul 2018 17:13:03 +0100 Subject: [PATCH] Bug 1906 - Issues with dynamic Play-at-Speed This fix addresses the remaining issue, issue 4, that the selection was often cleared when Play-at-Speed stopped. The problem was that Scrubbing 'Set Selection to here' code was not being disabled by the Play-at-Speed state. --- src/Menus.cpp | 8 +++++++- src/tracks/ui/Scrubbing.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Menus.cpp b/src/Menus.cpp index c0e0fa4fd..dc112d9b9 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -2930,7 +2930,13 @@ bool AudacityProject::DoPlayStopSelect(bool click, bool shift) // change the selection auto time = gAudioIO->GetStreamTime(); auto &selection = mViewInfo.selectedRegion; - if (shift && click) { + // Test WasSpeedPlaying(), not IsSpeedPlaying() + // as we could be stopped now. + if (GetScrubber().WasSpeedPlaying()) + { + ;// don't change the selection. + } + else if (shift && click) { // Change the region selection, as if by shift-click at the play head auto t0 = selection.t0(), t1 = selection.t1(); if (time < t0) diff --git a/src/tracks/ui/Scrubbing.h b/src/tracks/ui/Scrubbing.h index 2d45ef44d..94014abb7 100644 --- a/src/tracks/ui/Scrubbing.h +++ b/src/tracks/ui/Scrubbing.h @@ -92,6 +92,8 @@ public: wxCoord GetScrubStartPosition() const { return mScrubStartPosition; } + bool WasSpeedPlaying() const + { return mSpeedPlaying;} bool IsSpeedPlaying() const { return IsScrubbing() && mSpeedPlaying; } // True iff the user has clicked to start scrub and not yet stopped,