11#ifndef __AUDACITY_SELECT_HANDLE__
12#define __AUDACITY_SELECT_HANDLE__
14#include "../../UIHandle.h"
16#include "../../Snap.h"
36 (
const std::shared_ptr<TrackView> &pTrackView,
bool useSnap,
43 (std::weak_ptr<SelectHandle> &holder,
45 const std::shared_ptr<TrackView> &pTrackView);
51 bool IsClicked()
const;
73 wxWindow *pParent)
override;
89 ViewInfo &viewInfo,
int mouseXCoordinate,
int trackLeftEdge,
91 void AssignSelection(
ViewInfo &viewInfo,
double selend,
Track *pTrack);
93 void StartFreqSelection
94 (
ViewInfo &viewInfo,
int mouseYCoordinate,
int trackTopEdge,
96 void AdjustFreqSelection
98 ViewInfo &viewInfo,
int mouseYCoordinate,
int trackTopEdge,
101 void HandleCenterFrequencyClick
102 (
const ViewInfo &viewInfo,
bool shiftDown,
104 static void StartSnappingFreqSelection
107 void MoveSnappingFreqSelection
113 static void SnapCenterOnce
121 const wxRect &rect,
unsigned iPass )
override;
125 const wxRect &rect,
const wxRect &panelRect,
unsigned iPass )
override;
137 bool mUseSnap{
true };
139 bool mSelStartValid{};
140 double mSelStart{ 0.0 };
142 int mSelectionBoundary{ 0 };
154 } mFreqSelMode{ FREQ_SEL_INVALID };
162 double mFreqSelPin{ -1.0 };
165 int mMostRecentX{ -1 }, mMostRecentY{ -1 };
167 bool mAutoScrolling{};
std::shared_ptr< UIHandle > UIHandlePtr
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
SelectHandle(const SelectHandle &)
std::weak_ptr< TrackView > mpView
std::weak_ptr< const WaveTrack > mFreqSelTrack
SelectHandle & operator=(const SelectHandle &)=default
std::shared_ptr< TimerHandler > mTimerHandler
std::shared_ptr< SelectionStateChanger > mSelectionStateChanger
std::shared_ptr< SpectrumAnalyst > mFrequencySnapper
std::shared_ptr< SnapManager > mSnapManager
@ FREQ_SEL_SNAPPING_CENTER
Defines a selected portion of a project.
Used for finding the peaks, for snapping to peaks.
Abstract base class for an object holding data associated with points on a time axis.
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
virtual void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
virtual wxRect DrawingArea(TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass)
Short-lived drawing and event-handling object associated with a TrackPanelCell.
virtual void Enter(bool forward, AudacityProject *pProject)
virtual Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject)=0
virtual Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)=0
static UIHandle::Result NeedChangeHighlight(const UIHandle &, const UIHandle &)
virtual HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject)=0
virtual bool HasEscape(AudacityProject *pProject) const
virtual bool Escape(AudacityProject *pProject)
virtual Result Cancel(AudacityProject *pProject)=0
virtual Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject)=0
A Track that contains audio waveform data.
std::shared_ptr< Track > FindTrack(TrackPanelCell *pCell)