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

Set selection whenever scrub/seek stops by any means besides ESC key

This commit is contained in:
Paul Licameli
2016-06-06 01:44:33 -04:00
parent 8dab37de01
commit fd9d6a8fcf
5 changed files with 40 additions and 17 deletions

View File

@@ -163,7 +163,7 @@ private:
void Scrubber::ScrubPoller::Notify()
{
// Call ContinueScrubbing() here in a timer handler
// Call Continue functions here in a timer handler
// rather than in SelectionHandleDrag()
// so that even without drag events, we can instruct the play head to
// keep approaching the mouse cursor, when its maximum speed is limited.
@@ -276,6 +276,8 @@ void Scrubber::MarkScrubStart(
mScrubStartPosition = xx;
ctb->UpdateStatusBar(mProject);
mOptions.startClockTimeMillis = ::wxGetLocalTimeMillis();
mCancelled = false;
}
#ifdef EXPERIMENTAL_SCRUBBING_SUPPORT
@@ -453,6 +455,8 @@ void Scrubber::ContinueScrubbingUI()
if (mDragging && !state.LeftIsDown()) {
// Stop and set cursor
mProject->DoPlayStopSelect(true, state.ShiftDown());
wxCommandEvent evt;
mProject->GetControlToolBar()->OnStop(evt);
return;
}
@@ -490,6 +494,12 @@ void Scrubber::StopScrubbing()
mPoller->Stop();
if (!mCancelled) {
const wxMouseState state(::wxGetMouseState());
// Stop and set cursor
mProject->DoPlayStopSelect(true, state.ShiftDown());
}
mScrubStartPosition = -1;
mDragging = false;

View File

@@ -103,6 +103,9 @@ public:
bool Scrubs() const
{ return mScrubbing; }
void Cancel()
{ mCancelled = true; }
bool ShouldDrawScrubSpeed();
double FindScrubSpeed(bool seeking, double time) const;
double GetMaxScrubSpeed() const { return mOptions.maxSpeed; }
@@ -164,6 +167,8 @@ private:
bool mDragging {};
bool mCancelled {};
#ifdef EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL
int mLogMaxScrubSpeed;
#endif