Audacity  3.0.3
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TimeTrackView Class Referencefinal

#include <TimeTrackView.h>

Inheritance diagram for TimeTrackView:
Collaboration diagram for TimeTrackView:

Public Member Functions

 TimeTrackView (const std::shared_ptr< Track > &pTrack)
 ~TimeTrackView () override
std::shared_ptr< TrackVRulerControlsDoGetVRulerControls () override
- Public Member Functions inherited from CommonTrackView
std::shared_ptr< TrackPanelCellContextMenuDelegate () override
std::vector< UIHandlePtrHitTest (const TrackPanelMouseState &, const AudacityProject *pProject) final override
void TimeShiftHitTest ()
virtual int GetMinimizedHeight () const override
 TrackView (const std::shared_ptr< Track > &pTrack)
- Public Member Functions inherited from TrackView
 TrackView (const std::shared_ptr< Track > &pTrack)
virtual ~TrackView ()=0
void CopyTo (Track &track) const override
bool GetMinimized () const
void SetMinimized (bool minimized)
int GetCumulativeHeightBefore () const
int GetExpandedHeight () const
int GetHeight () const
void SetCumulativeHeightBefore (int y)
 Set cached value dependent on position within the track list. More...
void SetExpandedHeight (int height)
std::shared_ptr< TrackVRulerControlsGetVRulerControls ()
std::shared_ptr< const TrackVRulerControlsGetVRulerControls () const
virtual std::shared_ptr< CommonTrackCellGetAffordanceControls ()
void WriteXMLAttributes (XMLWriter &) const override
bool HandleXMLAttribute (const wxChar *attr, const wxChar *value) override
virtual Refinement GetSubViews (const wxRect &rect)
virtual bool IsSpectral () const
virtual void DoSetMinimized (bool isMinimized)
- Public Member Functions inherited from CommonTrackCell
 CommonTrackCell (const std::shared_ptr< Track > &pTrack)
 ~CommonTrackCell ()
std::shared_ptr< TrackDoFindTrack () override
virtual void Reparent (const std::shared_ptr< Track > &parent)
- Public Member Functions inherited from CommonTrackPanelCell
 CommonTrackPanelCell ()
virtual ~CommonTrackPanelCell ()=0
HitTestPreview DefaultPreview (const TrackPanelMouseState &, const AudacityProject *) override
std::shared_ptr< TrackFindTrack ()
std::shared_ptr< const TrackFindTrack () const
virtual std::vector< MenuItemGetMenuItems (const wxRect &rect, const wxPoint *pPosition, AudacityProject *pProject)
 Return a list of items for DoContextMenu() (empties for separators) More...
- Public Member Functions inherited from TrackPanelCell
 TrackPanelCell ()=default
 TrackPanelCell (const TrackPanelCell &) PROHIBITED
TrackPanelCelloperator= (const TrackPanelCell &) PROHIBITED
virtual ~TrackPanelCell ()=0
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)
virtual unsigned LoseFocus (AudacityProject *project)
- Public Member Functions inherited from TrackPanelNode
 TrackPanelNode ()
virtual ~TrackPanelNode ()=0
- Public Member Functions inherited from TrackPanelDrawable
virtual ~TrackPanelDrawable ()=0
virtual wxRect DrawingArea (TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass)

Private Member Functions

 TimeTrackView (const TimeTrackView &)=delete
TimeTrackViewoperator= (const TimeTrackView &)=delete
std::vector< UIHandlePtrDetailedHitTest (const TrackPanelMouseState &state, const AudacityProject *pProject, int currentTool, bool bMultiTool) override
void Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override

Private Attributes

std::weak_ptr< EnvelopeHandlemEnvelopeHandle

Additional Inherited Members

- Public Types inherited from TrackView
enum  : unsigned { DefaultHeight = 150 }
using Refinement = std::vector< std::pair< wxCoord, std::shared_ptr< TrackView > > >
- Public Types inherited from CommonTrackPanelCell
using Hook = std::function< unsigned(const TrackPanelMouseEvent &evt, AudacityProject *pProject) >
- Static Public Member Functions inherited from TrackView
static int GetTrackHeight (const Track *pTrack)
static int GetChannelGroupHeight (const Track *pTrack)
static int GetCumulativeHeight (const Track *pTrack)
static int GetTotalHeight (const TrackList &list)
static TrackViewGet (Track &)
static const TrackViewGet (const Track &)
- Static Public Member Functions inherited from CommonTrackPanelCell
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)
- Public Attributes inherited from CommonTrackView
std::weak_ptr< TimeShiftHandlemTimeShiftHandle
- Protected Member Functions inherited from CommonTrackPanelCell
unsigned DoContextMenu (const wxRect &rect, wxWindow *pParent, const wxPoint *pPosition, AudacityProject *pProject) override
unsigned HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
- Protected Attributes inherited from CommonTrackView
std::weak_ptr< SelectHandlemSelectHandle
- Protected Attributes inherited from TrackView
std::shared_ptr< TrackVRulerControlsmpVRulerControls

Detailed Description

Definition at line 18 of file TimeTrackView.h.

Constructor & Destructor Documentation

◆ TimeTrackView() [1/2]

TimeTrackView::TimeTrackView ( const TimeTrackView )

◆ TimeTrackView() [2/2]

TimeTrackView::TimeTrackView ( const std::shared_ptr< Track > &  pTrack)

Definition at line 33 of file TimeTrackView.cpp.

34  : CommonTrackView{ pTrack }
35 {
36 }

◆ ~TimeTrackView()

TimeTrackView::~TimeTrackView ( )

Definition at line 38 of file TimeTrackView.cpp.

39 {
40 }

Member Function Documentation

◆ DetailedHitTest()

std::vector< UIHandlePtr > TimeTrackView::DetailedHitTest ( const TrackPanelMouseState state,
const AudacityProject pProject,
int  currentTool,
bool  bMultiTool 

Implements CommonTrackView.

Definition at line 42 of file TimeTrackView.cpp.

45 {
46  std::vector<UIHandlePtr> results;
48  ( mEnvelopeHandle, st.state, st.rect, pProject,
49  std::static_pointer_cast< TimeTrack >( FindTrack() ) );
50  if (result)
51  results.push_back(result);
52  return results;
53 }

References CommonTrackPanelCell::FindTrack(), mEnvelopeHandle, TrackPanelMouseState::rect, TrackPanelMouseState::state, and EnvelopeHandle::TimeTrackHitTest().

Here is the call graph for this function:

◆ DoGetVRulerControls()

std::shared_ptr< TrackVRulerControls > TimeTrackView::DoGetVRulerControls ( )

Implements TrackView.

Definition at line 62 of file TimeTrackView.cpp.

63 {
64  return
65  std::make_shared<TimeTrackVRulerControls>( shared_from_this() );
66 }

◆ Draw()

void TimeTrackView::Draw ( TrackPanelDrawingContext context,
const wxRect &  rect,
unsigned  iPass 

Reimplemented from TrackPanelDrawable.

Definition at line 152 of file TimeTrackView.cpp.

155 {
156  if ( iPass == TrackArtist::PassTracks ) {
157  const auto tt = std::static_pointer_cast<const TimeTrack>(
158  FindTrack()->SubstitutePendingChangedTrack());
159  DrawTimeTrack( context, *tt, tt->GetRuler(), rect );
160  }
161  CommonTrackView::Draw( context, rect, iPass );
162 }

References TrackPanelDrawable::Draw(), anonymous_namespace{TimeTrackView.cpp}::DrawTimeTrack(), CommonTrackPanelCell::FindTrack(), and TrackArtist::PassTracks.

Here is the call graph for this function:

◆ operator=()

TimeTrackView& TimeTrackView::operator= ( const TimeTrackView )

Member Data Documentation

◆ mEnvelopeHandle

std::weak_ptr<EnvelopeHandle> TimeTrackView::mEnvelopeHandle

Definition at line 36 of file TimeTrackView.h.

Referenced by DetailedHitTest().

The documentation for this class was generated from the following files:
Definition: CommonTrackView.h:20
std::shared_ptr< Track > FindTrack()
Definition: CommonTrackPanelCell.h:46
void DrawTimeTrack(TrackPanelDrawingContext &context, const TimeTrack &track, Ruler &ruler, const wxRect &rect)
Definition: TimeTrackView.cpp:128
static UIHandlePtr TimeTrackHitTest(std::weak_ptr< EnvelopeHandle > &holder, const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject, const std::shared_ptr< TimeTrack > &tt)
Definition: EnvelopeHandle.cpp:71
@ PassTracks
Definition: TrackArtist.h:81
std::weak_ptr< EnvelopeHandle > mEnvelopeHandle
Definition: TimeTrackView.h:36
virtual void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
Definition: TrackPanelDrawable.cpp:17