mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-10 17:11:17 +02:00
Rename Scrubbber::mScrubHasFocues to mPaused, reverse its sense
This commit is contained in:
parent
68cf7adcb1
commit
5997beec9d
@ -137,7 +137,7 @@ void Scrubber::ScrubPoller::Notify()
|
|||||||
Scrubber::Scrubber(AudacityProject *project)
|
Scrubber::Scrubber(AudacityProject *project)
|
||||||
: mScrubToken(-1)
|
: mScrubToken(-1)
|
||||||
, mScrubStartClockTimeMillis(-1)
|
, mScrubStartClockTimeMillis(-1)
|
||||||
, mScrubHasFocus(false)
|
, mPaused(true)
|
||||||
, mScrubSpeedDisplayCountdown(0)
|
, mScrubSpeedDisplayCountdown(0)
|
||||||
, mScrubStartPosition(-1)
|
, mScrubStartPosition(-1)
|
||||||
, mMaxScrubSpeed(-1.0)
|
, mMaxScrubSpeed(-1.0)
|
||||||
@ -334,7 +334,7 @@ bool Scrubber::MaybeStartScrubbing(wxCoord xx)
|
|||||||
using Mode = AudacityProject::PlaybackScroller::Mode;
|
using Mode = AudacityProject::PlaybackScroller::Mode;
|
||||||
mProject->GetPlaybackScroller().Activate
|
mProject->GetPlaybackScroller().Activate
|
||||||
(mSmoothScrollingScrub ? Mode::Centered : Mode::Off);
|
(mSmoothScrollingScrub ? Mode::Centered : Mode::Off);
|
||||||
mScrubHasFocus = true;
|
mPaused = false;
|
||||||
mLastScrubPosition = xx;
|
mLastScrubPosition = xx;
|
||||||
|
|
||||||
mPoller->Start(ScrubPollInterval_ms);
|
mPoller->Start(ScrubPollInterval_ms);
|
||||||
@ -357,7 +357,7 @@ void Scrubber::ContinueScrubbing()
|
|||||||
|
|
||||||
// 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 mScrubHasFocus.
|
// leave messages for this routine, in mScrubSeekPress and in mPaused.
|
||||||
|
|
||||||
// Seek only when the pointer is in the panel. Else, scrub.
|
// Seek only when the pointer is in the panel. Else, scrub.
|
||||||
TrackPanel *const trackPanel = mProject->GetTrackPanel();
|
TrackPanel *const trackPanel = mProject->GetTrackPanel();
|
||||||
@ -380,8 +380,8 @@ void Scrubber::ContinueScrubbing()
|
|||||||
const auto &viewInfo = mProject->GetViewInfo();
|
const auto &viewInfo = mProject->GetViewInfo();
|
||||||
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
if (!mScrubHasFocus)
|
if (mPaused)
|
||||||
// When we don't have focus, enqueue silent scrubs until we regain focus.
|
// When paused, enqueue silent scrubs.
|
||||||
result = gAudioIO->EnqueueScrubBySignedSpeed(0, mMaxScrubSpeed, false);
|
result = gAudioIO->EnqueueScrubBySignedSpeed(0, mMaxScrubSpeed, false);
|
||||||
else if (mDragging && mSmoothScrollingScrub) {
|
else if (mDragging && mSmoothScrollingScrub) {
|
||||||
const auto lastTime = gAudioIO->GetLastTimeInScrubQueue();
|
const auto lastTime = gAudioIO->GetLastTimeInScrubQueue();
|
||||||
@ -460,11 +460,11 @@ bool Scrubber::ShouldDrawScrubSpeed()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
return IsScrubbing() &&
|
return IsScrubbing() &&
|
||||||
mScrubHasFocus && (
|
!mPaused && (
|
||||||
// Draw for (non-scroll) scrub, sometimes, but never for seek
|
// Draw for (non-scroll) scrub, sometimes, but never for seek
|
||||||
(!PollIsSeeking() && mScrubSpeedDisplayCountdown > 0)
|
(!PollIsSeeking() && mScrubSpeedDisplayCountdown > 0)
|
||||||
// Draw always for scroll-scrub and for scroll-seek
|
// Draw always for scroll-scrub and for scroll-seek
|
||||||
|| mSmoothScrollingScrub
|
|| mSmoothScrollingScrub
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -498,12 +498,12 @@ void Scrubber::HandleScrollWheel(int steps)
|
|||||||
|
|
||||||
void Scrubber::Pause( bool paused )
|
void Scrubber::Pause( bool paused )
|
||||||
{
|
{
|
||||||
mScrubHasFocus = !paused;
|
mPaused = paused;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Scrubber::IsPaused() const
|
bool Scrubber::IsPaused() const
|
||||||
{
|
{
|
||||||
return !mScrubHasFocus;
|
return mPaused;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scrubber::OnActivateOrDeactivateApp(wxActivateEvent &event)
|
void Scrubber::OnActivateOrDeactivateApp(wxActivateEvent &event)
|
||||||
|
@ -110,7 +110,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
int mScrubToken;
|
int mScrubToken;
|
||||||
wxLongLong mScrubStartClockTimeMillis;
|
wxLongLong mScrubStartClockTimeMillis;
|
||||||
bool mScrubHasFocus;
|
bool mPaused;
|
||||||
int mScrubSpeedDisplayCountdown;
|
int mScrubSpeedDisplayCountdown;
|
||||||
wxCoord mScrubStartPosition;
|
wxCoord mScrubStartPosition;
|
||||||
wxCoord mLastScrubPosition {};
|
wxCoord mLastScrubPosition {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user