mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-23 15:50:05 +02:00
No more left-click to seek
This commit is contained in:
parent
39d03424d0
commit
bbfc730399
@ -180,7 +180,6 @@ Scrubber::Scrubber(AudacityProject *project)
|
||||
, mPaused(true)
|
||||
, mScrubSpeedDisplayCountdown(0)
|
||||
, mScrubStartPosition(-1)
|
||||
, mScrubSeekPress(false)
|
||||
#ifdef EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL
|
||||
, mSmoothScrollingScrub(false)
|
||||
, mLogMaxScrubSpeed(0)
|
||||
@ -396,12 +395,12 @@ void Scrubber::ContinueScrubbingPoll()
|
||||
{
|
||||
// Thus scrubbing relies mostly on periodic polling of mouse and keys,
|
||||
// not event notifications. But there are a few event handlers that
|
||||
// leave messages for this routine, in mScrubSeekPress and in mPaused.
|
||||
// leave messages for this routine, in mPaused.
|
||||
|
||||
// Decide whether to skip play, because either mouse is down now,
|
||||
// or there was a left click event. (This is then a delayed reaction, in a
|
||||
// timer callback, to a left click event detected elsewhere.)
|
||||
const bool seek = PollIsSeeking() || mScrubSeekPress;
|
||||
const bool seek = Seeks();
|
||||
|
||||
bool result = false;
|
||||
if (mPaused) {
|
||||
@ -445,11 +444,6 @@ void Scrubber::ContinueScrubbingPoll()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (result)
|
||||
mScrubSeekPress = false;
|
||||
// else, if seek requested, try again at a later time when we might
|
||||
// enqueue a long enough stutter
|
||||
}
|
||||
|
||||
void Scrubber::ContinueScrubbingUI()
|
||||
@ -462,7 +456,7 @@ void Scrubber::ContinueScrubbingUI()
|
||||
return;
|
||||
}
|
||||
|
||||
const bool seek = PollIsSeeking();
|
||||
const bool seek = Seeks();
|
||||
|
||||
{
|
||||
// Show the correct status for seeking.
|
||||
@ -532,7 +526,7 @@ bool Scrubber::ShouldDrawScrubSpeed()
|
||||
return IsScrubbing() &&
|
||||
!mPaused && (
|
||||
// Draw for (non-scroll) scrub, sometimes, but never for seek
|
||||
(!PollIsSeeking() && mScrubSpeedDisplayCountdown > 0)
|
||||
(!Seeks() && mScrubSpeedDisplayCountdown > 0)
|
||||
// Draw always for scroll-scrub and for scroll-seek
|
||||
|| mSmoothScrollingScrub
|
||||
);
|
||||
@ -594,12 +588,7 @@ void Scrubber::Forwarder::OnMouse(wxMouseEvent &event)
|
||||
auto ruler = scrubber.mProject->GetRulerPanel();
|
||||
auto isScrubbing = scrubber.IsScrubbing();
|
||||
if (isScrubbing && !event.HasAnyModifiers()) {
|
||||
if(event.LeftDown() ||
|
||||
(event.LeftIsDown() && event.Dragging())) {
|
||||
if (!scrubber.mDragging)
|
||||
scrubber.mScrubSeekPress = true;
|
||||
}
|
||||
else if (event.m_wheelRotation) {
|
||||
if (event.m_wheelRotation) {
|
||||
double steps = event.m_wheelRotation /
|
||||
(event.m_wheelDelta > 0 ? (double)event.m_wheelDelta : 120.0);
|
||||
scrubber.HandleScrollWheel(steps);
|
||||
@ -713,7 +702,7 @@ void ScrubbingOverlay::OnTimer(wxCommandEvent &event)
|
||||
// Where's the mouse?
|
||||
position = trackPanel->ScreenToClient(position);
|
||||
|
||||
const bool seeking = scrubber.PollIsSeeking();
|
||||
const bool seeking = scrubber.Seeks();
|
||||
|
||||
// Find the text
|
||||
const double maxScrubSpeed = GetScrubber().GetMaxScrubSpeed();
|
||||
@ -764,11 +753,6 @@ Scrubber &ScrubbingOverlay::GetScrubber()
|
||||
return mProject->GetScrubber();
|
||||
}
|
||||
|
||||
bool Scrubber::PollIsSeeking()
|
||||
{
|
||||
return mDragging || (mSeeking || ::wxGetMouseState().LeftIsDown());
|
||||
}
|
||||
|
||||
void Scrubber::DoScrub()
|
||||
{
|
||||
const bool wasScrubbing = IsScrubbing();
|
||||
|
@ -109,8 +109,6 @@ public:
|
||||
|
||||
void HandleScrollWheel(int steps);
|
||||
|
||||
bool PollIsSeeking();
|
||||
|
||||
// This returns the same as the enabled state of the menu items:
|
||||
bool CanScrub() const;
|
||||
|
||||
@ -157,7 +155,6 @@ private:
|
||||
int mScrubSpeedDisplayCountdown;
|
||||
wxCoord mScrubStartPosition;
|
||||
wxCoord mLastScrubPosition {};
|
||||
bool mScrubSeekPress;
|
||||
bool mSmoothScrollingScrub;
|
||||
|
||||
// These hold the three-way choice among click-to-scrub, click-to-seek, or disabled.
|
||||
|
Loading…
x
Reference in New Issue
Block a user