Audacity  3.0.3
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
CommonTrackPanelCell Class Referenceabstract

#include <CommonTrackPanelCell.h>

Inheritance diagram for CommonTrackPanelCell:
[legend]
Collaboration diagram for CommonTrackPanelCell:
[legend]

Public Types

using Hook = std::function< unsigned(const TrackPanelMouseEvent &evt, AudacityProject *pProject) >
 

Public Member Functions

 CommonTrackPanelCell ()
 
virtual ~CommonTrackPanelCell ()=0
 
HitTestPreview DefaultPreview (const TrackPanelMouseState &, const AudacityProject *) override
 
std::shared_ptr< TrackFindTrack ()
 
std::shared_ptr< const TrackFindTrack () const
 
- Public Member Functions inherited from TrackPanelCell
 TrackPanelCell ()=default
 
 TrackPanelCell (const TrackPanelCell &) PROHIBITED
 
TrackPanelCelloperator= (const TrackPanelCell &) PROHIBITED
 
virtual ~TrackPanelCell ()=0
 
virtual std::vector< UIHandlePtrHitTest (const TrackPanelMouseState &state, const AudacityProject *pProject)=0
 
virtual std::shared_ptr< TrackPanelCellContextMenuDelegate ()
 
virtual unsigned DoContextMenu (const wxRect &rect, wxWindow *pParent, wxPoint *pPosition, AudacityProject *pProject)
 
virtual unsigned CaptureKey (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project)
 
virtual unsigned KeyDown (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project)
 
virtual unsigned KeyUp (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project)
 
virtual unsigned Char (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project)
 
- Public Member Functions inherited from TrackPanelNode
 TrackPanelNode ()
 
virtual ~TrackPanelNode ()=0
 
- Public Member Functions inherited from TrackPanelDrawable
virtual ~TrackPanelDrawable ()=0
 
virtual void Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
 
virtual wxRect DrawingArea (TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass)
 

Static Public Member Functions

static Hook InstallMouseWheelHook (const Hook &hook)
 
- Static Public Member Functions inherited from TrackPanelDrawable
static wxRect MaximizeWidth (const wxRect &rect, const wxRect &panelRect)
 
static wxRect MaximizeHeight (const wxRect &rect, const wxRect &panelRect)
 

Protected Member Functions

virtual std::shared_ptr< TrackDoFindTrack ()=0
 
unsigned HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
 

Detailed Description

Definition at line 24 of file CommonTrackPanelCell.h.

Member Typedef Documentation

◆ Hook

using CommonTrackPanelCell::Hook = std::function< unsigned(const TrackPanelMouseEvent &evt, AudacityProject *pProject) >

Definition at line 29 of file CommonTrackPanelCell.h.

Constructor & Destructor Documentation

◆ CommonTrackPanelCell()

CommonTrackPanelCell::CommonTrackPanelCell ( )
inline

Definition at line 35 of file CommonTrackPanelCell.h.

36  {}

◆ ~CommonTrackPanelCell()

CommonTrackPanelCell::~CommonTrackPanelCell ( )
pure virtual

Definition at line 36 of file CommonTrackPanelCell.cpp.

37 {
38 }

Member Function Documentation

◆ DefaultPreview()

HitTestPreview CommonTrackPanelCell::DefaultPreview ( const TrackPanelMouseState ,
const AudacityProject  
)
overridevirtual

Reimplemented from TrackPanelCell.

Definition at line 40 of file CommonTrackPanelCell.cpp.

42 {
43  static wxCursor defaultCursor{ wxCURSOR_ARROW };
44  return { {}, &defaultCursor, {} };
45 }

◆ DoFindTrack()

virtual std::shared_ptr<Track> CommonTrackPanelCell::DoFindTrack ( )
protectedpure virtual

◆ FindTrack() [1/2]

std::shared_ptr<Track> CommonTrackPanelCell::FindTrack ( )
inline

Definition at line 44 of file CommonTrackPanelCell.h.

44 { return DoFindTrack(); }

Referenced by anonymous_namespace{SelectHandle.cpp}::ChooseBoundary(), CommonTrackView::ContextMenuDelegate(), SpectrumView::DetailedHitTest(), TimeTrackView::DetailedHitTest(), CommonTrackControls::DoContextMenu(), WaveTrackVRulerControls::DoDraw(), SpectrumView::DoSetMinimized(), WaveformView::DoSetMinimized(), SelectHandle::Drag(), TimeShiftHandle::Drag(), EditCursorOverlay::Draw(), PlayIndicatorOverlayBase::Draw(), LabelTrackView::Draw(), TrackPanelResizerCell::Draw(), NoteTrackView::Draw(), NoteTrackVRulerControls::Draw(), SpectrumView::Draw(), WaveformView::Draw(), TimeTrackView::Draw(), TimeTrackVRulerControls::Draw(), CommonTrackControls::Draw(), TrackVRulerControls::Draw(), LabelTrackView::FindLabelTrack(), CommonTrackView::GetMinimizedHeight(), NoteTrackVRulerControls::HandleWheelRotation(), SpectrumVRulerControls::HandleWheelRotation(), WaveformVRulerControls::HandleWheelRotation(), TrackPanelResizerCell::HitTest(), CommonTrackView::HitTest(), SpectrumVRulerControls::HitTest(), WaveformVRulerControls::HitTest(), TimeTrackVRulerControls::HitTest(), CommonTrackControls::HitTest(), NoteTrackControls::HitTest(), NoteTrackVRulerControls::HitTest(), WaveTrackControls::HitTest(), SelectHandle::HitTest(), anonymous_namespace{WaveTrackView.cpp}::SubViewCloseHandle::HitTest(), anonymous_namespace{SelectHandle.cpp}::isSpectralSelectionView(), SelectHandle::MoveSnappingFreqSelection(), LabelTrackView::OnLabelAdded(), LabelTrackView::OnLabelDeleted(), LabelTrackView::OnLabelPermuted(), LabelTrackView::OnSelectionChange(), TrackView::SetHeight(), TrackView::SetMinimized(), SelectHandle::StartFreqSelection(), NoteTrackVRulerControls::UpdateRuler(), SpectrumVRulerControls::UpdateRuler(), WaveformVRulerControls::UpdateRuler(), and TimeTrackVRulerControls::UpdateRuler().

◆ FindTrack() [2/2]

std::shared_ptr<const Track> CommonTrackPanelCell::FindTrack ( ) const
inline

Definition at line 45 of file CommonTrackPanelCell.h.

46  { return const_cast<CommonTrackPanelCell*>(this)->DoFindTrack(); }

◆ HandleWheelRotation()

unsigned CommonTrackPanelCell::HandleWheelRotation ( const TrackPanelMouseEvent event,
AudacityProject pProject 
)
overrideprotectedvirtual

Reimplemented from TrackPanelCell.

Definition at line 47 of file CommonTrackPanelCell.cpp.

49 {
50  auto hook = GetHook();
51  return hook ? hook( evt, pProject ) : RefreshCode::Cancelled;
52 }

References RefreshCode::Cancelled, and anonymous_namespace{CommonTrackPanelCell.cpp}::GetHook().

Here is the call graph for this function:

◆ InstallMouseWheelHook()

auto CommonTrackPanelCell::InstallMouseWheelHook ( const Hook hook)
static

Definition at line 27 of file CommonTrackPanelCell.cpp.

29 {
30  auto &theHook = GetHook();
31  auto result = theHook;
32  theHook = hook;
33  return result;
34 }

References anonymous_namespace{CommonTrackPanelCell.cpp}::GetHook().

Referenced by anonymous_namespace{ProjectWindow.cpp}::MouseWheelHandler::MouseWheelHandler().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files:
ProgressResult::Cancelled
@ Cancelled
CommonTrackPanelCell::DoFindTrack
virtual std::shared_ptr< Track > DoFindTrack()=0
anonymous_namespace{CommonTrackPanelCell.cpp}::GetHook
CommonTrackPanelCell::Hook & GetHook()
Definition: CommonTrackPanelCell.cpp:20
CommonTrackPanelCell
Definition: CommonTrackPanelCell.h:26
RefreshCode
Namespace containing an enum 'what to do on a refresh?'.
Definition: RefreshCode.h:16