From a5364119eb1d18b46e757a93f4befdc0964468b5 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 26 Jun 2019 13:40:56 -0400 Subject: [PATCH] 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. --- src/ProjectAudioManager.cpp | 3 -- src/ProjectWindow.cpp | 9 +++++- src/ProjectWindow.h | 1 + src/SelectUtilities.cpp | 4 --- src/TrackUtilities.cpp | 7 ----- src/effects/EffectManager.cpp | 3 ++ src/menus/ClipMenus.cpp | 4 --- src/menus/EditMenus.cpp | 30 ------------------- src/menus/LabelMenus.cpp | 22 -------------- src/menus/SelectMenus.cpp | 33 --------------------- src/menus/TrackMenus.cpp | 21 +------------ src/menus/ViewMenus.cpp | 3 -- src/tracks/labeltrack/ui/LabelTrackView.cpp | 1 - 13 files changed, 13 insertions(+), 128 deletions(-) diff --git a/src/ProjectAudioManager.cpp b/src/ProjectAudioManager.cpp index a9579b8e6..f2818050a 100644 --- a/src/ProjectAudioManager.cpp +++ b/src/ProjectAudioManager.cpp @@ -146,9 +146,6 @@ You are saving directly to a slow external storage device\n\ else // Add to history history.PushState(_("Recorded Audio"), _("Record")); - - // Refresh the project window - window.RedrawProject(); } // Write all cached files to disk, if any diff --git a/src/ProjectWindow.cpp b/src/ProjectWindow.cpp index 12fa7eb74..84e83f639 100644 --- a/src/ProjectWindow.cpp +++ b/src/ProjectWindow.cpp @@ -641,6 +641,8 @@ ProjectWindow::ProjectWindow(wxWindow * parent, wxWindowID id, mPlaybackScroller = std::make_unique( &project ); + project.Bind( EVT_UNDO_MODIFIED, &ProjectWindow::OnUndoPushedModified, this ); + project.Bind( EVT_UNDO_PUSHED, &ProjectWindow::OnUndoPushedModified, this ); project.Bind( EVT_UNDO_OR_REDO, &ProjectWindow::OnUndoRedo, this ); project.Bind( EVT_UNDO_RESET, &ProjectWindow::OnUndoReset, this ); } @@ -1439,6 +1441,12 @@ void ProjectWindow::OnToolBarUpdate(wxCommandEvent & event) event.Skip(false); /* No need to propagate any further */ } +void ProjectWindow::OnUndoPushedModified( wxCommandEvent &evt ) +{ + evt.Skip(); + RedrawProject(); +} + void ProjectWindow::OnUndoRedo( wxCommandEvent &evt ) { evt.Skip(); @@ -1612,7 +1620,6 @@ void ProjectWindow::ZoomAfterImport(Track *pTrack) DoZoomFit(); trackPanel.SetFocus(); - RedrawProject(); if (!pTrack) pTrack = *tracks.Selected().begin(); if (!pTrack) diff --git a/src/ProjectWindow.h b/src/ProjectWindow.h index 9f7156bc8..f3489cc09 100644 --- a/src/ProjectWindow.h +++ b/src/ProjectWindow.h @@ -155,6 +155,7 @@ public: void DoScroll(); void OnScroll(wxScrollEvent & event); void OnToolBarUpdate(wxCommandEvent & event); + void OnUndoPushedModified( wxCommandEvent & ); void OnUndoRedo( wxCommandEvent & ); void OnUndoReset( wxCommandEvent & ); diff --git a/src/SelectUtilities.cpp b/src/SelectUtilities.cpp index 60e8a8f56..5c990c3a3 100644 --- a/src/SelectUtilities.cpp +++ b/src/SelectUtilities.cpp @@ -30,7 +30,6 @@ void DoSelectTimeAndAudioTracks (AudacityProject &project, bool bAllTime, bool bAllTracks) { auto &tracks = TrackList::Get( project ); - auto &trackPanel = TrackPanel::Get( project ); auto &selectedRegion = ViewInfo::Get( project ).selectedRegion; if( bAllTime ) @@ -45,7 +44,6 @@ void DoSelectTimeAndAudioTracks t->SetSelected(true); ProjectHistory::Get( project ).ModifyState(false); - trackPanel.Refresh(false); } } @@ -56,7 +54,6 @@ void DoSelectTimeAndTracks (AudacityProject &project, bool bAllTime, bool bAllTracks) { auto &tracks = TrackList::Get( project ); - auto &trackPanel = TrackPanel::Get( project ); auto &selectedRegion = ViewInfo::Get( project ).selectedRegion; if( bAllTime ) @@ -68,7 +65,6 @@ void DoSelectTimeAndTracks t->SetSelected(true); ProjectHistory::Get( project ).ModifyState(false); - trackPanel.Refresh(false); } } diff --git a/src/TrackUtilities.cpp b/src/TrackUtilities.cpp index 371db3102..e8aad9189 100644 --- a/src/TrackUtilities.cpp +++ b/src/TrackUtilities.cpp @@ -56,7 +56,6 @@ void DoRemoveTracks( AudacityProject &project ) .PushState(_("Removed audio track(s)"), _("Remove Track")); trackPanel.UpdateViewIfNoTracks(); - trackPanel.Refresh(false); } void DoTrackMute(AudacityProject &project, Track *t, bool exclusive) @@ -106,7 +105,6 @@ void DoTrackMute(AudacityProject &project, Track *t, bool exclusive) ProjectHistory::Get( project ).ModifyState(true); trackPanel.UpdateAccessibility(); - trackPanel.Refresh(false); } void DoTrackSolo(AudacityProject &project, Track *t, bool exclusive) @@ -159,7 +157,6 @@ void DoTrackSolo(AudacityProject &project, Track *t, bool exclusive) ProjectHistory::Get( project ).ModifyState(true); trackPanel.UpdateAccessibility(); - trackPanel.Refresh(false); } void DoRemoveTrack(AudacityProject &project, Track * toRemove) @@ -196,9 +193,6 @@ void DoRemoveTrack(AudacityProject &project, Track * toRemove) wxString::Format(_("Removed track '%s.'"), name), _("Track Remove")); - - window.HandleResize(); - trackPanel.Refresh(false); } void DoMoveTrack @@ -251,7 +245,6 @@ void DoMoveTrack longDesc = longDesc.Format(target->GetName()); ProjectHistory::Get( project ).PushState(longDesc, shortDesc); - trackPanel.Refresh(false); } } diff --git a/src/effects/EffectManager.cpp b/src/effects/EffectManager.cpp index a3567d60c..6b3de8523 100644 --- a/src/effects/EffectManager.cpp +++ b/src/effects/EffectManager.cpp @@ -207,7 +207,10 @@ void EffectManager::UnregisterEffect(const PluginID & ID) window.DoZoomFit(); // trackPanel->Refresh(false); } + + // PRL: RedrawProject explicitly because sometimes history push is skipped window.RedrawProject(); + if (focus != nullptr && focus->GetParent()==parent) { focus->SetFocus(); } diff --git a/src/menus/ClipMenus.cpp b/src/menus/ClipMenus.cpp index c94de4b79..a2adf4e15 100644 --- a/src/menus/ClipMenus.cpp +++ b/src/menus/ClipMenus.cpp @@ -391,7 +391,6 @@ void DoSelectClipBoundary(AudacityProject &project, bool next) selectedRegion.setT0(results[0].time); ProjectHistory::Get( project ).ModifyState(false); - trackPanel.Refresh(false); wxString message = ClipBoundaryMessage(results); trackPanel.MessageForScreenReader(message); @@ -575,7 +574,6 @@ void DoSelectClip(AudacityProject &project, bool next) selectedRegion.setTimes(t0, t1); ProjectHistory::Get( project ).ModifyState(false); trackPanel.ScrollIntoView(selectedRegion.t0()); - trackPanel.Refresh(false); // create and send message to screen reader wxString message; @@ -621,7 +619,6 @@ void DoCursorClipBoundary selectedRegion.setTimes(time, time); ProjectHistory::Get( project ).ModifyState(false); trackPanel.ScrollIntoView(selectedRegion.t0()); - trackPanel.Refresh(false); wxString message = ClipBoundaryMessage(results); trackPanel.MessageForScreenReader(message); @@ -711,7 +708,6 @@ void DoClipLeftOrRight tracks, isSyncLocked, right ); trackPanel.ScrollIntoView(selectedRegion.t0()); - trackPanel.Refresh(false); if (amount != 0.0) { wxString message = right? _("Time shifted clips to the right") : diff --git a/src/menus/EditMenus.cpp b/src/menus/EditMenus.cpp index 73b6cdf15..119f207c0 100644 --- a/src/menus/EditMenus.cpp +++ b/src/menus/EditMenus.cpp @@ -64,8 +64,6 @@ bool DoPasteText(AudacityProject &project) trackPanel.ScrollIntoView(x); } - // Redraw everyting (is that necessary???) and bail - window.RedrawProject(); return true; } } @@ -157,8 +155,6 @@ bool DoPasteNothingSelected(AudacityProject &project) ProjectHistory::Get( project ) .PushState(_("Pasted from the clipboard"), _("Paste")); - window.RedrawProject(); - if (pFirstNewTrack) pFirstNewTrack->EnsureVisible(); @@ -315,8 +311,6 @@ void OnCut(const CommandContext &context) // Bug 1663 //mRuler->ClearPlayRegion(); ruler.DrawOverlays( true ); - - window.RedrawProject(); } void OnDelete(const CommandContext &context) @@ -340,8 +334,6 @@ void OnDelete(const CommandContext &context) seconds, selectedRegion.t0()), _("Delete")); - - window.RedrawProject(); } @@ -639,8 +631,6 @@ void OnPaste(const CommandContext &context) ProjectHistory::Get( project ) .PushState(_("Pasted from the clipboard"), _("Paste")); - window.RedrawProject(); - if (ff) ff->EnsureVisible(); } @@ -670,8 +660,6 @@ void OnDuplicate(const CommandContext &context) } ProjectHistory::Get( project ).PushState(_("Duplicated"), _("Duplicate")); - - window.RedrawProject(); } void OnSplitCut(const CommandContext &context) @@ -712,8 +700,6 @@ void OnSplitCut(const CommandContext &context) selectedRegion.t0(), selectedRegion.t1(), &project ); ProjectHistory::Get( project ).PushState(_("Split-cut to the clipboard"), _("Split Cut")); - - window.RedrawProject(); } void OnSplitDelete(const CommandContext &context) @@ -739,8 +725,6 @@ void OnSplitDelete(const CommandContext &context) selectedRegion.duration(), selectedRegion.t0()), _("Split Delete")); - - window.RedrawProject(); } void OnSilence(const CommandContext &context) @@ -758,8 +742,6 @@ void OnSilence(const CommandContext &context) selectedRegion.duration(), selectedRegion.t0()), _("Silence")); - - trackPanel.Refresh(false); } void OnTrim(const CommandContext &context) @@ -785,8 +767,6 @@ void OnTrim(const CommandContext &context) _("Trim selected audio tracks from %.2f seconds to %.2f seconds"), selectedRegion.t0(), selectedRegion.t1()), _("Trim Audio")); - - window.RedrawProject(); } void OnSplit(const CommandContext &context) @@ -803,7 +783,6 @@ void OnSplit(const CommandContext &context) wt->Split( sel0, sel1 ); ProjectHistory::Get( project ).PushState(_("Split"), _("Split")); - trackPanel.Refresh(false); #if 0 //ANSWER-ME: Do we need to keep this commented out OnSplit() code? // This whole section no longer used... @@ -848,9 +827,6 @@ void OnSplit(const CommandContext &context) } PushState(_("Split"), _("Split")); - - FixScrollbars(); - trackPanel.Refresh(false); */ #endif } @@ -904,8 +880,6 @@ void OnSplitNew(const CommandContext &context) ProjectHistory::Get( project ) .PushState(_("Split to new track"), _("Split New")); - - window.RedrawProject(); } void OnJoin(const CommandContext &context) @@ -924,8 +898,6 @@ void OnJoin(const CommandContext &context) selectedRegion.duration(), selectedRegion.t0()), _("Join")); - - window.RedrawProject(); } void OnDisjoin(const CommandContext &context) @@ -944,8 +916,6 @@ void OnDisjoin(const CommandContext &context) selectedRegion.duration(), selectedRegion.t0()), _("Detach")); - - window.RedrawProject(); } void OnEditMetadata(const CommandContext &context) diff --git a/src/menus/LabelMenus.cpp b/src/menus/LabelMenus.cpp index 066f4dc4a..ab55381c7 100644 --- a/src/menus/LabelMenus.cpp +++ b/src/menus/LabelMenus.cpp @@ -76,7 +76,6 @@ int DoAddLabel( ProjectHistory::Get( project ).PushState(_("Added label"), _("Label")); - window.RedrawProject(); if (!useDialog) { lt->EnsureVisible(); } @@ -343,9 +342,6 @@ void OnPasteNewLabel(const CommandContext &context) if (bPastedSomething) { ProjectHistory::Get( project ).PushState( _("Pasted from the clipboard"), _("Paste Text to New Label")); - - // Is this necessary? (carried over from former logic in OnPaste()) - window.RedrawProject(); } } @@ -387,8 +383,6 @@ void OnCutLabels(const CommandContext &context) _( "Cut labeled audio regions to clipboard" ), /* i18n-hint: (verb)*/ _( "Cut Labeled Audio" ) ); - - window.RedrawProject(); } void OnDeleteLabels(const CommandContext &context) @@ -410,8 +404,6 @@ void OnDeleteLabels(const CommandContext &context) _( "Deleted labeled audio regions" ), /* i18n-hint: (verb)*/ _( "Delete Labeled Audio" ) ); - - window.RedrawProject(); } void OnSplitCutLabels(const CommandContext &context) @@ -433,8 +425,6 @@ void OnSplitCutLabels(const CommandContext &context) _( "Split Cut labeled audio regions to clipboard" ), /* i18n-hint: (verb) Do a special kind of cut on the labels*/ _( "Split Cut Labeled Audio" ) ); - - window.RedrawProject(); } void OnSplitDeleteLabels(const CommandContext &context) @@ -456,8 +446,6 @@ void OnSplitDeleteLabels(const CommandContext &context) /* i18n-hint: (verb) Do a special kind of DELETE on labeled audio regions */ _( "Split Delete Labeled Audio" ) ); - - window.RedrawProject(); } void OnSilenceLabels(const CommandContext &context) @@ -477,8 +465,6 @@ void OnSilenceLabels(const CommandContext &context) _( "Silenced labeled audio regions" ), /* i18n-hint: (verb)*/ _( "Silence Labeled Audio" ) ); - - trackPanel.Refresh( false ); } void OnCopyLabels(const CommandContext &context) @@ -497,8 +483,6 @@ void OnCopyLabels(const CommandContext &context) ProjectHistory::Get( project ).PushState( _( "Copied labeled audio regions to clipboard" ), /* i18n-hint: (verb)*/ _( "Copy Labeled Audio" ) ); - - trackPanel.Refresh( false ); } void OnSplitLabels(const CommandContext &context) @@ -516,8 +500,6 @@ void OnSplitLabels(const CommandContext &context) _( "Split labeled audio (points or regions)" ), /* i18n-hint: (verb)*/ _( "Split Labeled Audio" ) ); - - window.RedrawProject(); } void OnJoinLabels(const CommandContext &context) @@ -538,8 +520,6 @@ void OnJoinLabels(const CommandContext &context) _( "Joined labeled audio (points or regions)" ), /* i18n-hint: (verb) */ _( "Join Labeled Audio" ) ); - - window.RedrawProject(); } void OnDisjoinLabels(const CommandContext &context) @@ -561,8 +541,6 @@ void OnDisjoinLabels(const CommandContext &context) _( "Detached labeled audio regions" ), /* i18n-hint: (verb)*/ _( "Detach Labeled Audio" ) ); - - window.RedrawProject(); } }; // struct Handler diff --git a/src/menus/SelectMenus.cpp b/src/menus/SelectMenus.cpp index 44eed0ee3..e46f73862 100644 --- a/src/menus/SelectMenus.cpp +++ b/src/menus/SelectMenus.cpp @@ -28,7 +28,6 @@ void DoNextPeakFrequency(AudacityProject &project, bool up) { auto &tracks = TrackList::Get( project ); auto &viewInfo = ViewInfo::Get( project ); - auto &trackPanel = TrackPanel::Get( project ); // Find the first selected wave track that is in a spectrogram view. const WaveTrack *pTrack {}; @@ -43,7 +42,6 @@ void DoNextPeakFrequency(AudacityProject &project, bool up) if (pTrack) { SpectrumAnalyst analyst; SelectHandle::SnapCenterOnce(analyst, viewInfo, pTrack, up); - trackPanel.Refresh(false); ProjectHistory::Get( project ).ModifyState(false); } } @@ -413,7 +411,6 @@ void DoBoundaryMove(AudacityProject &project, int step, SeekInfo &info) viewInfo.selectedRegion.setT1(indicator); ProjectHistory::Get( project ).ModifyState(false); - trackPanel.Refresh(false); return; } @@ -482,7 +479,6 @@ void OnSelectSyncLockSel(const CommandContext &context) { auto &project = context.project; auto &tracks = TrackList::Get( project ); - auto &trackPanel = TrackPanel::Get( project ); bool selected = false; for (auto t : tracks.Any() @@ -493,8 +489,6 @@ void OnSelectSyncLockSel(const CommandContext &context) if (selected) ProjectHistory::Get( project ).ModifyState(false); - - trackPanel.Refresh(false); } //this pops up a dialog which allows the left selection to be set. @@ -506,7 +500,6 @@ void OnSetLeftSelection(const CommandContext &context) auto token = ProjectAudioIO::Get( project ).GetAudioIOToken(); auto &selectedRegion = ViewInfo::Get( project ).selectedRegion; const auto &settings = ProjectSettings::Get( project ); - auto &trackPanel = TrackPanel::Get( project ); auto &window = GetProjectFrame( project ); bool bSelChanged = false; @@ -537,7 +530,6 @@ void OnSetLeftSelection(const CommandContext &context) if (bSelChanged) { ProjectHistory::Get( project ).ModifyState(false); - trackPanel.Refresh(false); } } @@ -547,7 +539,6 @@ void OnSetRightSelection(const CommandContext &context) auto token = ProjectAudioIO::Get( project ).GetAudioIOToken(); auto &selectedRegion = ViewInfo::Get( project ).selectedRegion; const auto &settings = ProjectSettings::Get( project ); - auto &trackPanel = TrackPanel::Get( project ); auto &window = GetProjectFrame( project ); bool bSelChanged = false; @@ -578,7 +569,6 @@ void OnSetRightSelection(const CommandContext &context) if (bSelChanged) { ProjectHistory::Get( project ).ModifyState(false); - trackPanel.Refresh(false); } } @@ -586,7 +576,6 @@ void OnSelectStartCursor(const CommandContext &context) { auto &project = context.project; auto &tracks = TrackList::Get( project ); - auto &trackPanel = TrackPanel::Get( project ); auto &selectedRegion = ViewInfo::Get( project ).selectedRegion; double kWayOverToRight = std::numeric_limits::max(); @@ -604,15 +593,12 @@ void OnSelectStartCursor(const CommandContext &context) selectedRegion.setT0(minOffset); ProjectHistory::Get( project ).ModifyState(false); - - trackPanel.Refresh(false); } void OnSelectCursorEnd(const CommandContext &context) { auto &project = context.project; auto &tracks = TrackList::Get( project ); - auto &trackPanel = TrackPanel::Get( project ); auto &selectedRegion = ViewInfo::Get( project ).selectedRegion; double kWayOverToLeft = std::numeric_limits::lowest(); @@ -630,8 +616,6 @@ void OnSelectCursorEnd(const CommandContext &context) selectedRegion.setT1(maxEndOffset); ProjectHistory::Get( project ).ModifyState(false); - - trackPanel.Refresh(false); } void OnSelectTrackStartToEnd(const CommandContext &context) @@ -639,7 +623,6 @@ void OnSelectTrackStartToEnd(const CommandContext &context) auto &project = context.project; auto &viewInfo = ViewInfo::Get( project ); auto &tracks = TrackList::Get( project ); - auto &trackPanel = TrackPanel::Get( project ); auto range = tracks.Selected(); double maxEndOffset = range.max( &Track::GetEndTime ); @@ -650,8 +633,6 @@ void OnSelectTrackStartToEnd(const CommandContext &context) viewInfo.selectedRegion.setTimes( minOffset, maxEndOffset ); ProjectHistory::Get( project ).ModifyState(false); - - trackPanel.Refresh(false); } // Handler state: @@ -669,7 +650,6 @@ void OnSelectionRestore(const CommandContext &context) { auto &project = context.project; auto &selectedRegion = ViewInfo::Get( project ).selectedRegion; - auto &trackPanel = TrackPanel::Get( project ); if ((mRegionSave.t0() == 0.0) && (mRegionSave.t1() == 0.0)) @@ -678,8 +658,6 @@ void OnSelectionRestore(const CommandContext &context) selectedRegion = mRegionSave; ProjectHistory::Get( project ).ModifyState(false); - - trackPanel.Refresh(false); } #ifdef EXPERIMENTAL_SPECTRAL_EDITING @@ -691,7 +669,6 @@ double mLastF1{ SelectedRegion::UndefinedFrequency }; void OnToggleSpectralSelection(const CommandContext &context) { auto &project = context.project; - auto &trackPanel = TrackPanel::Get( project ); auto &selectedRegion = ViewInfo::Get( project ).selectedRegion; const double f0 = selectedRegion.f0(); @@ -709,7 +686,6 @@ void OnToggleSpectralSelection(const CommandContext &context) else selectedRegion.setFrequencies(mLastF0, mLastF1); - trackPanel.Refresh(false); ProjectHistory::Get( project ).ModifyState(false); } @@ -733,7 +709,6 @@ double mCursorPositionStored{ 0.0 }; void OnSelectCursorStoredCursor(const CommandContext &context) { auto &project = context.project; - auto &trackPanel = TrackPanel::Get( project ); auto &selectedRegion = ViewInfo::Get( project ).selectedRegion; auto isAudioActive = ProjectAudioIO::Get( project ).IsAudioActive(); @@ -747,7 +722,6 @@ void OnSelectCursorStoredCursor(const CommandContext &context) std::max(cursorPositionCurrent, mCursorPositionStored)); ProjectHistory::Get( project ).ModifyState(false); - trackPanel.Refresh(false); } } @@ -768,7 +742,6 @@ void OnZeroCrossing(const CommandContext &context) auto &project = context.project; auto &selectedRegion = ViewInfo::Get( project ).selectedRegion; const auto &settings = ProjectSettings::Get( project ); - auto &trackPanel = TrackPanel::Get( project ); const double t0 = NearestZeroCrossing(project, selectedRegion.t0()); if (selectedRegion.isPoint()) @@ -781,8 +754,6 @@ void OnZeroCrossing(const CommandContext &context) } ProjectHistory::Get( project ).ModifyState(false); - - trackPanel.Refresh(false); } void OnSnapToOff(const CommandContext &context) @@ -869,7 +840,6 @@ void OnCursorSelStart(const CommandContext &context) selectedRegion.collapseToT0(); ProjectHistory::Get( project ).ModifyState(false); trackPanel.ScrollIntoView(selectedRegion.t0()); - trackPanel.Refresh(false); } void OnCursorSelEnd(const CommandContext &context) @@ -881,7 +851,6 @@ void OnCursorSelEnd(const CommandContext &context) selectedRegion.collapseToT1(); ProjectHistory::Get( project ).ModifyState(false); trackPanel.ScrollIntoView(selectedRegion.t1()); - trackPanel.Refresh(false); } void OnCursorTrackStart(const CommandContext &context) @@ -908,7 +877,6 @@ void OnCursorTrackStart(const CommandContext &context) selectedRegion.setTimes(minOffset, minOffset); ProjectHistory::Get( project ).ModifyState(false); trackPanel.ScrollIntoView(selectedRegion.t0()); - trackPanel.Refresh(false); } void OnCursorTrackEnd(const CommandContext &context) @@ -935,7 +903,6 @@ void OnCursorTrackEnd(const CommandContext &context) selectedRegion.setTimes(maxEndOffset, maxEndOffset); ProjectHistory::Get( project ).ModifyState(false); trackPanel.ScrollIntoView(selectedRegion.t1()); - trackPanel.Refresh(false); } void OnSkipStart(const CommandContext &context) diff --git a/src/menus/TrackMenus.cpp b/src/menus/TrackMenus.cpp index e1cd080c0..174e051dc 100644 --- a/src/menus/TrackMenus.cpp +++ b/src/menus/TrackMenus.cpp @@ -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) diff --git a/src/menus/ViewMenus.cpp b/src/menus/ViewMenus.cpp index 52bbefab2..a7fd3236e 100644 --- a/src/menus/ViewMenus.cpp +++ b/src/menus/ViewMenus.cpp @@ -258,7 +258,6 @@ void OnZoomFitV(const CommandContext &context) DoZoomFitV(project); window.GetVerticalScrollBar().SetThumbPosition(0); - window.RedrawProject(); ProjectHistory::Get( project ).ModifyState(true); } @@ -284,7 +283,6 @@ void OnCollapseAllTracks(const CommandContext &context) TrackView::Get( *t ).SetMinimized(true); ProjectHistory::Get( project ).ModifyState(true); - window.RedrawProject(); } void OnExpandAllTracks(const CommandContext &context) @@ -297,7 +295,6 @@ void OnExpandAllTracks(const CommandContext &context) TrackView::Get( *t ).SetMinimized(false); ProjectHistory::Get( project ).ModifyState(true); - window.RedrawProject(); } void OnGoSelStart(const CommandContext &context) diff --git a/src/tracks/labeltrack/ui/LabelTrackView.cpp b/src/tracks/labeltrack/ui/LabelTrackView.cpp index 9c8fe54d8..c90a86f10 100644 --- a/src/tracks/labeltrack/ui/LabelTrackView.cpp +++ b/src/tracks/labeltrack/ui/LabelTrackView.cpp @@ -2051,7 +2051,6 @@ void LabelTrackView::DoEditLabels if (dlg.ShowModal() == wxID_OK) { ProjectHistory::Get( project ) .PushState(_("Edited labels"), _("Label")); - window.RedrawProject(); } }