mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-01 16:39:30 +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)
|
, mPaused(true)
|
||||||
, mScrubSpeedDisplayCountdown(0)
|
, mScrubSpeedDisplayCountdown(0)
|
||||||
, mScrubStartPosition(-1)
|
, mScrubStartPosition(-1)
|
||||||
, mScrubSeekPress(false)
|
|
||||||
#ifdef EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL
|
#ifdef EXPERIMENTAL_SCRUBBING_SCROLL_WHEEL
|
||||||
, mSmoothScrollingScrub(false)
|
, mSmoothScrollingScrub(false)
|
||||||
, mLogMaxScrubSpeed(0)
|
, mLogMaxScrubSpeed(0)
|
||||||
@ -396,12 +395,12 @@ void Scrubber::ContinueScrubbingPoll()
|
|||||||
{
|
{
|
||||||
// Thus scrubbing relies mostly on periodic polling of mouse and keys,
|
// Thus scrubbing relies mostly on periodic polling of mouse and keys,
|
||||||
// not event notifications. But there are a few event handlers that
|
// 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,
|
// 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
|
// or there was a left click event. (This is then a delayed reaction, in a
|
||||||
// timer callback, to a left click event detected elsewhere.)
|
// timer callback, to a left click event detected elsewhere.)
|
||||||
const bool seek = PollIsSeeking() || mScrubSeekPress;
|
const bool seek = Seeks();
|
||||||
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
if (mPaused) {
|
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()
|
void Scrubber::ContinueScrubbingUI()
|
||||||
@ -462,7 +456,7 @@ void Scrubber::ContinueScrubbingUI()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool seek = PollIsSeeking();
|
const bool seek = Seeks();
|
||||||
|
|
||||||
{
|
{
|
||||||
// Show the correct status for seeking.
|
// Show the correct status for seeking.
|
||||||
@ -532,7 +526,7 @@ bool Scrubber::ShouldDrawScrubSpeed()
|
|||||||
return IsScrubbing() &&
|
return IsScrubbing() &&
|
||||||
!mPaused && (
|
!mPaused && (
|
||||||
// Draw for (non-scroll) scrub, sometimes, but never for seek
|
// 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
|
// Draw always for scroll-scrub and for scroll-seek
|
||||||
|| mSmoothScrollingScrub
|
|| mSmoothScrollingScrub
|
||||||
);
|
);
|
||||||
@ -594,12 +588,7 @@ void Scrubber::Forwarder::OnMouse(wxMouseEvent &event)
|
|||||||
auto ruler = scrubber.mProject->GetRulerPanel();
|
auto ruler = scrubber.mProject->GetRulerPanel();
|
||||||
auto isScrubbing = scrubber.IsScrubbing();
|
auto isScrubbing = scrubber.IsScrubbing();
|
||||||
if (isScrubbing && !event.HasAnyModifiers()) {
|
if (isScrubbing && !event.HasAnyModifiers()) {
|
||||||
if(event.LeftDown() ||
|
if (event.m_wheelRotation) {
|
||||||
(event.LeftIsDown() && event.Dragging())) {
|
|
||||||
if (!scrubber.mDragging)
|
|
||||||
scrubber.mScrubSeekPress = true;
|
|
||||||
}
|
|
||||||
else if (event.m_wheelRotation) {
|
|
||||||
double steps = event.m_wheelRotation /
|
double steps = event.m_wheelRotation /
|
||||||
(event.m_wheelDelta > 0 ? (double)event.m_wheelDelta : 120.0);
|
(event.m_wheelDelta > 0 ? (double)event.m_wheelDelta : 120.0);
|
||||||
scrubber.HandleScrollWheel(steps);
|
scrubber.HandleScrollWheel(steps);
|
||||||
@ -713,7 +702,7 @@ void ScrubbingOverlay::OnTimer(wxCommandEvent &event)
|
|||||||
// Where's the mouse?
|
// Where's the mouse?
|
||||||
position = trackPanel->ScreenToClient(position);
|
position = trackPanel->ScreenToClient(position);
|
||||||
|
|
||||||
const bool seeking = scrubber.PollIsSeeking();
|
const bool seeking = scrubber.Seeks();
|
||||||
|
|
||||||
// Find the text
|
// Find the text
|
||||||
const double maxScrubSpeed = GetScrubber().GetMaxScrubSpeed();
|
const double maxScrubSpeed = GetScrubber().GetMaxScrubSpeed();
|
||||||
@ -764,11 +753,6 @@ Scrubber &ScrubbingOverlay::GetScrubber()
|
|||||||
return mProject->GetScrubber();
|
return mProject->GetScrubber();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scrubber::PollIsSeeking()
|
|
||||||
{
|
|
||||||
return mDragging || (mSeeking || ::wxGetMouseState().LeftIsDown());
|
|
||||||
}
|
|
||||||
|
|
||||||
void Scrubber::DoScrub()
|
void Scrubber::DoScrub()
|
||||||
{
|
{
|
||||||
const bool wasScrubbing = IsScrubbing();
|
const bool wasScrubbing = IsScrubbing();
|
||||||
|
@ -109,8 +109,6 @@ public:
|
|||||||
|
|
||||||
void HandleScrollWheel(int steps);
|
void HandleScrollWheel(int steps);
|
||||||
|
|
||||||
bool PollIsSeeking();
|
|
||||||
|
|
||||||
// This returns the same as the enabled state of the menu items:
|
// This returns the same as the enabled state of the menu items:
|
||||||
bool CanScrub() const;
|
bool CanScrub() const;
|
||||||
|
|
||||||
@ -157,7 +155,6 @@ private:
|
|||||||
int mScrubSpeedDisplayCountdown;
|
int mScrubSpeedDisplayCountdown;
|
||||||
wxCoord mScrubStartPosition;
|
wxCoord mScrubStartPosition;
|
||||||
wxCoord mLastScrubPosition {};
|
wxCoord mLastScrubPosition {};
|
||||||
bool mScrubSeekPress;
|
|
||||||
bool mSmoothScrollingScrub;
|
bool mSmoothScrollingScrub;
|
||||||
|
|
||||||
// These hold the three-way choice among click-to-scrub, click-to-seek, or disabled.
|
// These hold the three-way choice among click-to-scrub, click-to-seek, or disabled.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user