1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 08:27:13 +01:00

Eliminate many calls to RedrawProject & TrackPanel::Refresh()...

... Let the window respond to an undo manager event instead, whenever there
is a push or modify

Maybe this makes a few unnecessary redraws that did not happen before.  If
that is important, then we should figure out how to put the logic for eliding
the redraw into ProjectWindow, and the extra information needed for the
decision into the events, but not make intrusions in other code all over the
place.
This commit is contained in:
Paul Licameli
2019-06-26 13:40:56 -04:00
parent 63c7b3740e
commit a5364119eb
13 changed files with 13 additions and 128 deletions

View File

@@ -115,7 +115,6 @@ void DoMixAndRender
trackPanel.SetFocus();
trackPanel.SetFocusedTrack(pNewLeft);
pNewLeft->EnsureVisible();
window.RedrawProject();
}
}
@@ -133,8 +132,6 @@ void DoPanTracks(AudacityProject &project, float PanValue)
for (auto left : count == 0 ? range : selectedRange )
left->SetPan( PanValue );
window.RedrawProject();
auto flags = UndoPush::AUTOSAVE;
/*i18n-hint: One or more audio tracks have been panned*/
ProjectHistory::Get( project )
@@ -299,8 +296,6 @@ void DoAlign
selectedRegion.move(delta);
ProjectHistory::Get( project ).PushState(action, shortAction);
window.RedrawProject();
}
#ifdef EXPERIMENTAL_SCOREALIGN
@@ -590,7 +585,6 @@ void OnNewWaveTrack(const CommandContext &context)
ProjectHistory::Get( project )
.PushState(_("Created new audio track"), _("New Track"));
window.RedrawProject();
t->EnsureVisible();
}
@@ -618,7 +612,6 @@ void OnNewStereoTrack(const CommandContext &context)
ProjectHistory::Get( project )
.PushState(_("Created new stereo audio track"), _("New Track"));
window.RedrawProject();
left->EnsureVisible();
}
@@ -638,7 +631,6 @@ void OnNewLabelTrack(const CommandContext &context)
ProjectHistory::Get( project )
.PushState(_("Created new label track"), _("New Track"));
window.RedrawProject();
t->EnsureVisible();
}
@@ -663,7 +655,6 @@ void OnNewTimeTrack(const CommandContext &context)
ProjectHistory::Get( project )
.PushState(_("Created new time track"), _("New Track"));
window.RedrawProject();
t->EnsureVisible();
}
@@ -789,8 +780,7 @@ void OnResample(const CommandContext &context)
}
undoManager.StopConsolidating();
window.RedrawProject();
// Need to reset
window.FinishAutoScroll();
}
@@ -818,7 +808,6 @@ void OnMuteAllTracks(const CommandContext &context)
}
ProjectHistory::Get( project ).ModifyState(true);
window.RedrawProject();
}
void OnUnmuteAllTracks(const CommandContext &context)
@@ -839,7 +828,6 @@ void OnUnmuteAllTracks(const CommandContext &context)
}
ProjectHistory::Get( project ).ModifyState(true);
window.RedrawProject();
}
void OnPanLeft(const CommandContext &context)
@@ -997,7 +985,6 @@ void OnScoreAlign(const CommandContext &context)
if (result == SA_SUCCESS) {
tracks->Replace(nt, holder);
project.RedrawProject();
AudacityMessageBox(wxString::Format(
_("Alignment completed: MIDI from %.2f to %.2f secs, Audio from %.2f to %.2f secs."),
params.mMidiStart, params.mMidiEnd,
@@ -1027,9 +1014,6 @@ void OnSortTime(const CommandContext &context)
ProjectHistory::Get( project )
.PushState(_("Tracks sorted by time"), _("Sort by Time"));
auto &trackPanel = TrackPanel::Get( project );
trackPanel.Refresh(false);
}
void OnSortName(const CommandContext &context)
@@ -1039,9 +1023,6 @@ void OnSortName(const CommandContext &context)
ProjectHistory::Get( project )
.PushState(_("Tracks sorted by name"), _("Sort by Name"));
auto &trackPanel = TrackPanel::Get( project );
trackPanel.Refresh(false);
}
void OnSyncLock(const CommandContext &context)