diff --git a/src/Project.cpp b/src/Project.cpp index b0a346ceb..bab32eb4b 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -949,20 +949,6 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id, mLastSavedTracks.reset(); - // Register for tracklist updates - mTracks->Connect(EVT_TRACKLIST_PERMUTED, - wxCommandEventHandler(AudacityProject::OnTrackListUpdate), - NULL, - this); - mTracks->Connect(EVT_TRACKLIST_DELETION, - wxCommandEventHandler(AudacityProject::OnTrackListUpdate), - NULL, - this); - mTracks->Connect(EVT_TRACKLIST_RESIZING, - wxCommandEventHandler(AudacityProject::OnTrackListUpdate), - NULL, - this); - // // Initialize view info (shared with TrackPanel) // @@ -1984,9 +1970,6 @@ void AudacityProject::FixScrollbars() rescroll = false; } - if (lastv != mViewInfo.vpos) - InvalidateFirstVisible(); - // wxScrollbar only supports int values but we need a greater range, so // we scale the scrollbar coordinates on demand. We only do this if we // would exceed the int range, so we can always use the maximum resolution @@ -2035,8 +2018,8 @@ void AudacityProject::FixScrollbars() std::shared_ptr AudacityProject::GetFirstVisible() { - auto pTrack = mViewInfo.track.lock(); - if (!pTrack && GetTracks()) { + std::shared_ptr pTrack; + if (GetTracks()) { // Recompute on demand and memo-ize TrackListIterator iter(GetTracks()); for (Track *t = iter.First(); t; t = iter.Next()) { @@ -2048,17 +2031,11 @@ std::shared_ptr AudacityProject::GetFirstVisible() break; } } - mViewInfo.track = pTrack; } return pTrack; } -void AudacityProject::InvalidateFirstVisible() -{ - mViewInfo.track.reset(); -} - void AudacityProject::UpdateLayout() { if (!mTrackPanel) @@ -2213,14 +2190,6 @@ void AudacityProject::OnToolBarUpdate(wxCommandEvent & event) event.Skip(false); /* No need to propagate any further */ } -// The projects tracklist has been updated -void AudacityProject::OnTrackListUpdate(wxCommandEvent & event) -{ - InvalidateFirstVisible(); - - event.Skip(); -} - ///Handles the redrawing necessary for tasks as they partially update in the background. void AudacityProject::OnODTaskUpdate(wxCommandEvent & WXUNUSED(event)) { @@ -2267,9 +2236,6 @@ void AudacityProject::DoScroll() int lastv = mViewInfo.vpos; mViewInfo.vpos = mVsbar->GetThumbPosition() * mViewInfo.scrollStep; - if (lastv != mViewInfo.vpos) - InvalidateFirstVisible(); - //mchinen: do not always set this project to be the active one. //a project may autoscroll while playing in the background //I think this is okay since OnMouseEvent has one of these. @@ -2675,20 +2641,6 @@ void AudacityProject::OnCloseWindow(wxCloseEvent & event) mImportXMLTagHandler.reset(); - // Unregister for tracklist updates - mTracks->Disconnect(EVT_TRACKLIST_PERMUTED, - wxCommandEventHandler(AudacityProject::OnTrackListUpdate), - NULL, - this); - mTracks->Disconnect(EVT_TRACKLIST_DELETION, - wxCommandEventHandler(AudacityProject::OnTrackListUpdate), - NULL, - this); - mTracks->Disconnect(EVT_TRACKLIST_RESIZING, - wxCommandEventHandler(AudacityProject::OnTrackListUpdate), - NULL, - this); - // Delete all the tracks to free up memory and DirManager references. mTracks->Clear(); mTracks.reset(); @@ -3523,7 +3475,6 @@ bool AudacityProject::HandleXMLTag(const wxChar *tag, const wxChar **attrs) if (longVpos != 0) { // PRL: It seems this must happen after SetSnapTo - mViewInfo.track.reset(); mViewInfo.vpos = longVpos; mbInitializingScrollbar = true; } diff --git a/src/Project.h b/src/Project.h index ad24a97db..3683bb928 100644 --- a/src/Project.h +++ b/src/Project.h @@ -192,7 +192,6 @@ class AUDACITY_DLL_API AudacityProject final : public wxFrame, ViewInfo &GetViewInfo() { return mViewInfo; } std::shared_ptr GetFirstVisible(); - void InvalidateFirstVisible(); void GetPlayRegion(double* playRegionStart, double *playRegionEnd); bool IsPlayRegionLocked() { return mLockPlayRegion; } @@ -357,7 +356,6 @@ public: void OnOpenAudioFile(wxCommandEvent & event); void OnODTaskUpdate(wxCommandEvent & event); void OnODTaskComplete(wxCommandEvent & event); - void OnTrackListUpdate(wxCommandEvent & event); void HandleResize(); void UpdateLayout(); diff --git a/src/ViewInfo.h b/src/ViewInfo.h index 797bafd15..52b272fee 100644 --- a/src/ViewInfo.h +++ b/src/ViewInfo.h @@ -158,8 +158,6 @@ public: // Scroll info - std::weak_ptr track; // first visible track - double total; // total width in secs // Current horizontal scroll bar positions, in pixels wxInt64 sbarH;