mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-05 22:28:57 +02:00
Changed misleading terminology in scrubber...
... It was confusing that HasStartedScrubbing() could be true while also not IsScrubbing()
This commit is contained in:
parent
b33d3516f0
commit
5f27ae905c
@ -1676,7 +1676,7 @@ void AudacityApp::OnKeyDown(wxKeyEvent &event)
|
||||
auto project = ::GetActiveProject();
|
||||
auto token = project->GetAudioIOToken();
|
||||
auto &scrubber = project->GetScrubber();
|
||||
auto scrubbing = scrubber.HasStartedScrubbing();
|
||||
auto scrubbing = scrubber.HasMark();
|
||||
if (scrubbing)
|
||||
scrubber.Cancel();
|
||||
if((token > 0 &&
|
||||
|
@ -2922,7 +2922,7 @@ bool AudacityProject::DoPlayStopSelect(bool click, bool shift)
|
||||
ControlToolBar *toolbar = GetControlToolBar();
|
||||
|
||||
//If busy, stop playing, make sure everything is unpaused.
|
||||
if (GetScrubber().HasStartedScrubbing() ||
|
||||
if (GetScrubber().HasMark() ||
|
||||
gAudioIO->IsStreamActive(GetAudioIOToken())) {
|
||||
toolbar->SetPlay(false); //Pops
|
||||
toolbar->SetStop(true); //Pushes stop down
|
||||
@ -3007,7 +3007,7 @@ void AudacityProject::OnTogglePinnedHead(const CommandContext &WXUNUSED(context)
|
||||
ruler->UpdateButtonStates();
|
||||
|
||||
auto &scrubber = GetScrubber();
|
||||
if (scrubber.HasStartedScrubbing())
|
||||
if (scrubber.HasMark())
|
||||
scrubber.SetScrollScrubbing(value);
|
||||
}
|
||||
|
||||
|
@ -1801,7 +1801,7 @@ bool AudacityProject::MayScrollBeyondZero() const
|
||||
if (mViewInfo.bScrollBeyondZero)
|
||||
return true;
|
||||
|
||||
if (GetScrubber().HasStartedScrubbing() ||
|
||||
if (GetScrubber().HasMark() ||
|
||||
IsAudioActive()) {
|
||||
if (mPlaybackScroller) {
|
||||
auto mode = mPlaybackScroller->GetMode();
|
||||
|
@ -1496,7 +1496,7 @@ void ControlToolBar::StartScrollingIfPreferred()
|
||||
if (TracksPrefs::GetPinnedHeadPreference())
|
||||
StartScrolling();
|
||||
#ifdef __WXMAC__
|
||||
else if (::GetActiveProject()->GetScrubber().HasStartedScrubbing()) {
|
||||
else if (::GetActiveProject()->GetScrubber().HasMark()) {
|
||||
// PRL: cause many "unnecessary" refreshes. For reasons I don't understand,
|
||||
// doing this causes wheel rotation events (mapped from the double finger vertical
|
||||
// swipe) to be delivered more uniformly to the application, so that speed control
|
||||
|
@ -137,7 +137,7 @@ void PlayIndicatorOverlay::OnTimer(wxCommandEvent &event)
|
||||
if (!mProject->IsAudioActive()) {
|
||||
mNewIndicatorX = -1;
|
||||
const auto &scrubber = mProject->GetScrubber();
|
||||
if (scrubber.HasStartedScrubbing()) {
|
||||
if (scrubber.HasMark()) {
|
||||
auto position = scrubber.GetScrubStartPosition();
|
||||
int width;
|
||||
trackPanel->GetTracksUsableArea(&width, nullptr);
|
||||
|
@ -636,7 +636,7 @@ void Scrubber::StopScrubbing()
|
||||
|
||||
mPoller->Stop();
|
||||
|
||||
if (HasStartedScrubbing() && !mCancelled) {
|
||||
if (HasMark() && !mCancelled) {
|
||||
const wxMouseState state(::wxGetMouseState());
|
||||
// Stop and set cursor
|
||||
bool bShift = state.ShiftDown();
|
||||
@ -719,14 +719,14 @@ bool Scrubber::TemporarilySeeks() const
|
||||
|
||||
bool Scrubber::Seeks() const
|
||||
{
|
||||
return (HasStartedScrubbing() || IsScrubbing()) && ChoseSeeking();
|
||||
return (HasMark() || IsScrubbing()) && ChoseSeeking();
|
||||
}
|
||||
|
||||
bool Scrubber::Scrubs() const
|
||||
{
|
||||
if( Seeks() )
|
||||
return false;
|
||||
return (HasStartedScrubbing() || IsScrubbing()) && !ChoseSeeking();
|
||||
return (HasMark() || IsScrubbing()) && !ChoseSeeking();
|
||||
}
|
||||
|
||||
bool Scrubber::ShouldDrawScrubSpeed()
|
||||
@ -889,7 +889,7 @@ void ScrubbingOverlay::OnTimer(wxCommandEvent &event)
|
||||
return;
|
||||
|
||||
{
|
||||
if(scrubber.HasStartedScrubbing()) {
|
||||
if(scrubber.HasMark()) {
|
||||
auto xx = ruler->ScreenToClient(position).x;
|
||||
ruler->UpdateQuickPlayPos(xx);
|
||||
|
||||
@ -972,7 +972,7 @@ void Scrubber::DoScrub(bool seek)
|
||||
{
|
||||
if( !CanScrub() )
|
||||
return;
|
||||
const bool wasScrubbing = HasStartedScrubbing() || IsScrubbing();
|
||||
const bool wasScrubbing = HasMark() || IsScrubbing();
|
||||
const bool scroll = TracksPrefs::GetPinnedHeadPreference();
|
||||
if (!wasScrubbing) {
|
||||
auto tp = mProject->GetTrackPanel();
|
||||
@ -997,7 +997,7 @@ void Scrubber::OnScrubOrSeek(bool seek)
|
||||
{
|
||||
DoScrub(seek);
|
||||
|
||||
if (HasStartedScrubbing()) {
|
||||
if (HasMark()) {
|
||||
// Show the correct status.
|
||||
const auto ctb = mProject->GetControlToolBar();
|
||||
ctb->UpdateStatusBar(mProject);
|
||||
@ -1059,7 +1059,7 @@ const wxString &Scrubber::GetUntranslatedStateString() const
|
||||
if (IsSpeedPlaying()) {
|
||||
return(_("Playing at Speed"));
|
||||
}
|
||||
else if (HasStartedScrubbing()) {
|
||||
else if (HasMark()) {
|
||||
auto &item = FindMenuItem(Seeks() || TemporarilySeeks());
|
||||
return item.status;
|
||||
}
|
||||
|
@ -98,11 +98,11 @@ public:
|
||||
{ return IsScrubbing() && mSpeedPlaying; }
|
||||
// True iff the user has clicked to start scrub and not yet stopped,
|
||||
// but IsScrubbing() may yet be false
|
||||
bool HasStartedScrubbing() const
|
||||
bool HasMark() const
|
||||
{ return GetScrubStartPosition() >= 0; }
|
||||
bool IsScrubbing() const;
|
||||
|
||||
bool IsScrollScrubbing() const // If true, implies HasStartedScrubbing()
|
||||
bool IsScrollScrubbing() const // If true, implies HasMark()
|
||||
{ return mSmoothScrollingScrub; }
|
||||
void SetScrollScrubbing(bool value)
|
||||
{ mSmoothScrollingScrub = value; }
|
||||
|
@ -2216,7 +2216,7 @@ namespace {
|
||||
|
||||
const wxString ScrubbingMessage(const Scrubber &scrubber)
|
||||
{
|
||||
if (scrubber.HasStartedScrubbing())
|
||||
if (scrubber.HasMark())
|
||||
return ContinueScrubbingMessage(scrubber);
|
||||
else
|
||||
return StartScrubbingMessage(scrubber);
|
||||
@ -2450,7 +2450,7 @@ void AdornedRulerPanel::OnMouseEvents(wxMouseEvent &evt)
|
||||
mPrevZone = zone;
|
||||
|
||||
auto &scrubber = mProject->GetScrubber();
|
||||
if (scrubber.HasStartedScrubbing()) {
|
||||
if (scrubber.HasMark()) {
|
||||
if (evt.RightDown() )
|
||||
// Fall through to context menu handling
|
||||
;
|
||||
@ -2863,7 +2863,7 @@ void AdornedRulerPanel::UpdateStatusBarAndTooltips(StatusChoice choice)
|
||||
wxString message {};
|
||||
|
||||
const auto &scrubber = mProject->GetScrubber();
|
||||
const bool scrubbing = scrubber.HasStartedScrubbing();
|
||||
const bool scrubbing = scrubber.HasMark();
|
||||
if (scrubbing && choice != StatusChoice::Leaving)
|
||||
// Don't distinguish zones
|
||||
choice = StatusChoice::EnteringScrubZone;
|
||||
@ -2922,7 +2922,7 @@ bool AdornedRulerPanel::ShowingScrubControl() const
|
||||
return
|
||||
mMouseEventState == AdornedRulerPanel::mesNone &&
|
||||
(mPrevZone == AdornedRulerPanel::StatusChoice::EnteringScrubZone ||
|
||||
(scrubber.HasStartedScrubbing()));
|
||||
(scrubber.HasMark()));
|
||||
}
|
||||
|
||||
void AdornedRulerPanel::OnContextMenu(wxContextMenuEvent & WXUNUSED(event))
|
||||
|
Loading…
x
Reference in New Issue
Block a user