diff --git a/src/Project.h b/src/Project.h index 5d637582a..a049567af 100644 --- a/src/Project.h +++ b/src/Project.h @@ -24,6 +24,7 @@ #include "widgets/OverlayPanel.h" #include "DirManager.h" +#include "SelectionState.h" #include "ViewInfo.h" #include "TrackPanelListener.h" #include "AudioIOListener.h" @@ -281,6 +282,7 @@ public: wxPanel *GetTopPanel() { return mTopPanel; } TrackPanel * GetTrackPanel() {return mTrackPanel;} const TrackPanel * GetTrackPanel() const {return mTrackPanel;} + SelectionState &GetSelectionState() { return mSelectionState; } bool GetIsEmpty(); @@ -635,6 +637,7 @@ private: AdornedRulerPanel *mRuler{}; wxPanel *mTopPanel{}; TrackPanel *mTrackPanel{}; + SelectionState mSelectionState{}; std::unique_ptr mTrackFactory{}; wxPanel * mMainPanel; wxScrollBar *mHsbar; diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index 09a592dbc..cb0ddc32e 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -571,6 +571,11 @@ TrackPanel::~TrackPanel() DeleteMenus(); } +SelectionState &TrackPanel::GetSelectionState() +{ + return GetProject()->GetSelectionState(); +} + void TrackPanel::BuildMenusIfNeeded(void) { if (!mRateMenu) diff --git a/src/TrackPanel.h b/src/TrackPanel.h index e948c8ab2..628fd8441 100644 --- a/src/TrackPanel.h +++ b/src/TrackPanel.h @@ -639,8 +639,7 @@ protected: bool mRefreshBacking; SelectedRegion mInitialSelection; - SelectionState mSelectionState{}; - SelectionState &GetSelectionState() { return mSelectionState; } + SelectionState &GetSelectionState(); std::unique_ptr mSelectionStateChanger{}; bool mSelStartValid;