Audacity  2.2.0
SelectHandle Class Reference

#include <SelectHandle.h>

Inheritance diagram for SelectHandle:
UIHandle

Classes

class  TimerHandler
 

Public Member Functions

 SelectHandle (const std::shared_ptr< Track > &pTrack, bool useSnap, const TrackList &trackList, const TrackPanelMouseState &st, const ViewInfo &viewInfo)
 
SelectHandleoperator= (const SelectHandle &)=default
 
virtual ~SelectHandle ()
 
bool IsClicked () const
 
void SetUseSnap (bool use)
 
void Enter (bool forward) override
 
bool HasSnap () const
 
bool HasEscape () const override
 
bool Escape () override
 
Result Click (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
 
Result Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
 
HitTestPreview Preview (const TrackPanelMouseState &state, const AudacityProject *pProject) override
 
Result Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
 
Result Cancel (AudacityProject *) override
 
void DrawExtras (DrawingPass pass, wxDC *dc, const wxRegion &updateRegion, const wxRect &panelRect) override
 
- Public Member Functions inherited from UIHandle
virtual ~UIHandle ()=0
 
virtual bool HasRotation () const
 
virtual bool Rotate (bool forward)
 
virtual bool StopsOnKeystroke ()
 
virtual void OnProjectChange (AudacityProject *pProject)
 
Result GetChangeHighlight () const
 
void SetChangeHighlight (Result val)
 

Static Public Member Functions

static UIHandlePtr HitTest (std::weak_ptr< SelectHandle > &holder, const TrackPanelMouseState &state, const AudacityProject *pProject, const std::shared_ptr< Track > &pTrack)
 
static UIHandle::Result NeedChangeHighlight (const SelectHandle &oldState, const SelectHandle &newState)
 
static void SnapCenterOnce (SpectrumAnalyst &analyst, ViewInfo &viewInfo, const WaveTrack *pTrack, bool up)
 
- Static Public Member Functions inherited from UIHandle
static UIHandle::Result NeedChangeHighlight (const UIHandle &, const UIHandle &)
 

Private Types

enum  eFreqSelMode {
  FREQ_SEL_INVALID, FREQ_SEL_SNAPPING_CENTER, FREQ_SEL_PINNED_CENTER, FREQ_SEL_DRAG_CENTER,
  FREQ_SEL_FREE, FREQ_SEL_TOP_FREE, FREQ_SEL_BOTTOM_FREE
}
 

Private Member Functions

 SelectHandle (const SelectHandle &)
 
void Connect (AudacityProject *pProject)
 
void StartSelection (AudacityProject *pProject)
 Reset our selection markers. More...
 
void AdjustSelection (AudacityProject *pProject, ViewInfo &viewInfo, int mouseXCoordinate, int trackLeftEdge, Track *pTrack)
 Extend or contract the existing selection. More...
 
void AssignSelection (ViewInfo &viewInfo, double selend, Track *pTrack)
 
void StartFreqSelection (ViewInfo &viewInfo, int mouseYCoordinate, int trackTopEdge, int trackHeight, Track *pTrack)
 
void AdjustFreqSelection (const WaveTrack *wt, ViewInfo &viewInfo, int mouseYCoordinate, int trackTopEdge, int trackHeight)
 
void HandleCenterFrequencyClick (const ViewInfo &viewInfo, bool shiftDown, const WaveTrack *pTrack, double value)
 
void MoveSnappingFreqSelection (AudacityProject *pProject, ViewInfo &viewInfo, int mouseYCoordinate, int trackTopEdge, int trackHeight, Track *pTrack)
 

Static Private Member Functions

static void StartSnappingFreqSelection (SpectrumAnalyst &analyst, const ViewInfo &viewInfo, const WaveTrack *pTrack)
 

Private Attributes

std::weak_ptr< TrackmpTrack
 
wxRect mRect {}
 
SelectedRegion mInitialSelection {}
 
std::shared_ptr< SnapManagermSnapManager
 
SnapResults mSnapStart
 
SnapResults mSnapEnd
 
bool mUseSnap { true }
 
bool mSelStartValid {}
 
double mSelStart { 0.0 }
 
int mSelectionBoundary { 0 }
 
enum SelectHandle::eFreqSelMode FREQ_SEL_INVALID
 
std::weak_ptr< const WaveTrackmFreqSelTrack
 
double mFreqSelPin { -1.0 }
 
std::shared_ptr< SpectrumAnalystmFrequencySnapper
 
int mMostRecentX { -1 }
 
int mMostRecentY { -1 }
 
bool mAutoScrolling {}
 
std::shared_ptr
< SelectionStateChanger
mSelectionStateChanger
 
friend TimerHandler
 
std::shared_ptr< TimerHandlermTimerHandler
 

Additional Inherited Members

- Public Types inherited from UIHandle
enum  DrawingPass { Cells, Panel }
 
using Result = unsigned
 
using Cell = TrackPanelCell
 
- Protected Attributes inherited from UIHandle
Result mChangeHighlight { 0 }
 

Member Enumeration Documentation

Enumerator
FREQ_SEL_INVALID 
FREQ_SEL_SNAPPING_CENTER 
FREQ_SEL_PINNED_CENTER 
FREQ_SEL_DRAG_CENTER 
FREQ_SEL_FREE 
FREQ_SEL_TOP_FREE 
FREQ_SEL_BOTTOM_FREE 

Constructor & Destructor Documentation

SelectHandle::SelectHandle ( const SelectHandle )
private
SelectHandle::SelectHandle ( const std::shared_ptr< Track > &  pTrack,
bool  useSnap,
const TrackList trackList,
const TrackPanelMouseState st,
const ViewInfo viewInfo 
)
explicit
SelectHandle::~SelectHandle ( )
virtual

Member Function Documentation

void SelectHandle::AdjustSelection ( AudacityProject pProject,
ViewInfo viewInfo,
int  mouseXCoordinate,
int  trackLeftEdge,
Track pTrack 
)
private
void SelectHandle::AssignSelection ( ViewInfo viewInfo,
double  selend,
Track pTrack 
)
private
void SelectHandle::Connect ( AudacityProject pProject)
private

References mTimerHandler.

void SelectHandle::DrawExtras ( DrawingPass  pass,
wxDC *  dc,
const wxRegion &  updateRegion,
const wxRect &  panelRect 
)
overridevirtual

Reimplemented from UIHandle.

void SelectHandle::Enter ( bool  forward)
overridevirtual

Reimplemented from UIHandle.

References SetUseSnap().

bool SelectHandle::Escape ( )
overridevirtual

Reimplemented from UIHandle.

References HasEscape(), and SetUseSnap().

void SelectHandle::HandleCenterFrequencyClick ( const ViewInfo viewInfo,
bool  shiftDown,
const WaveTrack pTrack,
double  value 
)
private
bool SelectHandle::HasEscape ( ) const
overridevirtual

Reimplemented from UIHandle.

References HasSnap(), and mUseSnap.

Referenced by Escape().

bool SelectHandle::HasSnap ( ) const

References IsClicked(), and mSnapEnd.

Referenced by HasEscape(), and SetUseSnap().

bool SelectHandle::IsClicked ( ) const

References mSelectionStateChanger.

Referenced by HasSnap(), and SetUseSnap().

void SelectHandle::MoveSnappingFreqSelection ( AudacityProject pProject,
ViewInfo viewInfo,
int  mouseYCoordinate,
int  trackTopEdge,
int  trackHeight,
Track pTrack 
)
private
UIHandle::Result SelectHandle::NeedChangeHighlight ( const SelectHandle oldState,
const SelectHandle newState 
)
static
SelectHandle& SelectHandle::operator= ( const SelectHandle )
default
UIHandle::Result SelectHandle::Release ( const TrackPanelMouseEvent event,
AudacityProject pProject,
wxWindow *  pParent 
)
overridevirtual
void SelectHandle::StartFreqSelection ( ViewInfo viewInfo,
int  mouseYCoordinate,
int  trackTopEdge,
int  trackHeight,
Track pTrack 
)
private
void SelectHandle::StartSelection ( AudacityProject pProject)
private

Member Data Documentation

enum SelectHandle::eFreqSelMode SelectHandle::FREQ_SEL_INVALID
private
bool SelectHandle::mAutoScrolling {}
private
double SelectHandle::mFreqSelPin { -1.0 }
private
std::weak_ptr<const WaveTrack> SelectHandle::mFreqSelTrack
private
std::shared_ptr<SpectrumAnalyst> SelectHandle::mFrequencySnapper
private
SelectedRegion SelectHandle::mInitialSelection {}
private

Referenced by Cancel().

int SelectHandle::mMostRecentX { -1 }
private
int SelectHandle::mMostRecentY { -1 }
private
std::weak_ptr<Track> SelectHandle::mpTrack
private
wxRect SelectHandle::mRect {}
private
int SelectHandle::mSelectionBoundary { 0 }
private
std::shared_ptr<SelectionStateChanger> SelectHandle::mSelectionStateChanger
private

Referenced by Cancel(), and IsClicked().

double SelectHandle::mSelStart { 0.0 }
private
bool SelectHandle::mSelStartValid {}
private
SnapResults SelectHandle::mSnapEnd
private
std::shared_ptr<SnapManager> SelectHandle::mSnapManager
private

Referenced by AdjustSelection().

SnapResults SelectHandle::mSnapStart
private

Referenced by NeedChangeHighlight().

std::shared_ptr<TimerHandler> SelectHandle::mTimerHandler
private

Referenced by Connect().

bool SelectHandle::mUseSnap { true }
private

The documentation for this class was generated from the following files: