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:
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user