Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
NoteTrackView Class Referencefinal

#include <NoteTrackView.h>

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

Public Member Functions

 NoteTrackView (const std::shared_ptr< Track > &pTrack)
 
 ~NoteTrackView () 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
 Copy state, for undo/redo purposes. More...
 
bool GetMinimized () const
 
void SetMinimized (bool minimized)
 
int GetCumulativeHeightBefore () const
 
int GetExpandedHeight () const
 
virtual int GetMinimizedHeight () const =0
 
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
 Serialize persistent attributes. More...
 
bool HandleXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView) override
 Deserialize an attribute, returning true if recognized. More...
 
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
 
void Reparent (const std::shared_ptr< Track > &parent) override
 Object may be shared among tracks but hold a special back-pointer to one of them; reassign it. More...
 
- 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 HitTestPreview DefaultPreview (const TrackPanelMouseState &state, const AudacityProject *pProject)
 
virtual std::vector< UIHandlePtrHitTest (const TrackPanelMouseState &state, const AudacityProject *pProject)=0
 
virtual unsigned HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject)
 
virtual std::shared_ptr< TrackPanelCellContextMenuDelegate ()
 
virtual unsigned DoContextMenu (const wxRect &rect, wxWindow *pParent, const 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)
 
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 void Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
 
virtual wxRect DrawingArea (TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass)
 
- Public Member Functions inherited from TrackAttachment
virtual ~TrackAttachment ()
 
virtual void CopyTo (Track &track) const
 Copy state, for undo/redo purposes. More...
 
virtual void Reparent (const std::shared_ptr< Track > &parent)
 Object may be shared among tracks but hold a special back-pointer to one of them; reassign it. More...
 
virtual void WriteXMLAttributes (XMLWriter &) const
 Serialize persistent attributes. More...
 
virtual bool HandleXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView)
 Deserialize an attribute, returning true if recognized. More...
 
- Public Member Functions inherited from ClientData::Base
virtual ~Base ()
 

Private Member Functions

 NoteTrackView (const NoteTrackView &)=delete
 
NoteTrackViewoperator= (const NoteTrackView &)=delete
 
std::shared_ptr< TrackVRulerControlsDoGetVRulerControls () override
 
std::shared_ptr< CommonTrackCellGetAffordanceControls () override
 
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::shared_ptr< CommonTrackCellmpAffordanceCellControl
 

Additional Inherited Members

- Public Types inherited from TrackView
enum  : unsigned { DefaultHeight = 150 }
 
using Refinement = std::vector< std::pair< wxCoord, std::shared_ptr< TrackView > > >
 
- Static Public Member Functions inherited from CommonTrackView
static void GetEnvelopeValues (const Envelope &env, double aligned_time, double sampleDur, double *buffer, int bufferLen, int leftOffset, const ZoomInfo &zoomInfo)
 Get many envelope points for pixel columns at once, but don't assume uniform time per pixel. More...
 
- 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 TrackViewFind (Track *)
 
static const TrackViewFind (const Track *)
 
- 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
 
virtual std::vector< UIHandlePtrDetailedHitTest (const TrackPanelMouseState &, const AudacityProject *pProject, int currentTool, bool bMultiTool)=0
 
virtual std::shared_ptr< TrackVRulerControlsDoGetVRulerControls ()=0
 
- Protected Member Functions inherited from CommonTrackPanelCell
virtual std::shared_ptr< TrackDoFindTrack ()=0
 
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 16 of file NoteTrackView.h.

Constructor & Destructor Documentation

◆ NoteTrackView() [1/2]

NoteTrackView::NoteTrackView ( const NoteTrackView )
privatedelete

◆ NoteTrackView() [2/2]

NoteTrackView::NoteTrackView ( const std::shared_ptr< Track > &  pTrack)
explicit

Definition at line 35 of file NoteTrackView.cpp.

36 : CommonTrackView{ pTrack }
37{
38}

◆ ~NoteTrackView()

NoteTrackView::~NoteTrackView ( )
override

Definition at line 40 of file NoteTrackView.cpp.

41{
42}

Member Function Documentation

◆ DetailedHitTest()

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

Implements CommonTrackView.

Definition at line 44 of file NoteTrackView.cpp.

47{
48 // Eligible for stretch?
49 UIHandlePtr result;
50 std::vector<UIHandlePtr> results;
51#ifdef USE_MIDI
52#ifdef EXPERIMENTAL_MIDI_STRETCHING
54 mStretchHandle, state, pProject, Pointer<NoteTrack>(this) );
55 if (result)
56 results.push_back(result);
57#endif
58#endif
59
60 return results;
61}
std::shared_ptr< UIHandle > UIHandlePtr
Definition: CellularPanel.h:28
static UIHandlePtr HitTest(std::weak_ptr< StretchHandle > &holder, const TrackPanelMouseState &state, const AudacityProject *pProject, const std::shared_ptr< NoteTrack > &pTrack)

References StretchHandle::HitTest().

Here is the call graph for this function:

◆ DoGetVRulerControls()

std::shared_ptr< TrackVRulerControls > NoteTrackView::DoGetVRulerControls ( )
overrideprivatevirtual

Implements TrackView.

Definition at line 70 of file NoteTrackView.cpp.

71{
72 return
73 std::make_shared<NoteTrackVRulerControls>( shared_from_this() );
74}

◆ Draw()

void NoteTrackView::Draw ( TrackPanelDrawingContext context,
const wxRect &  rect,
unsigned  iPass 
)
overrideprivatevirtual

Reimplemented from TrackPanelDrawable.

Definition at line 727 of file NoteTrackView.cpp.

730{
731 if ( iPass == TrackArtist::PassTracks ) {
732 const auto nt = std::static_pointer_cast<const NoteTrack>(
733 FindTrack()->SubstitutePendingChangedTrack());
734 bool muted = false;
735#ifdef EXPERIMENTAL_MIDI_OUT
736 const auto artist = TrackArtist::Get( context );
737 const auto hasSolo = artist->hasSolo;
738 muted = (hasSolo || nt->GetMute()) && !nt->GetSolo();
739#endif
740
741#ifdef EXPERIMENTAL_NOTETRACK_OVERLAY
743#endif
744 bool selected{ false };
745 if (auto affordance = std::dynamic_pointer_cast<NoteTrackAffordanceControls>(GetAffordanceControls()))
746 {
747 selected = affordance->IsSelected();
748 }
749
750 DrawNoteTrack(context, nt.get(), rect, muted, selected);
751 }
752 CommonTrackView::Draw( context, rect, iPass );
753}
static wxBrush labelSelectedBrush
Definition: AColor.h:122
static wxBrush labelUnselectedBrush
Definition: AColor.h:121
std::shared_ptr< Track > FindTrack()
std::shared_ptr< CommonTrackCell > GetAffordanceControls() override
static TrackArtist * Get(TrackPanelDrawingContext &)
Definition: TrackArtist.cpp:69
virtual void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
AUDACITY_DLL_API void DrawBackgroundWithSelection(TrackPanelDrawingContext &context, const wxRect &rect, const Track *track, const wxBrush &selBrush, const wxBrush &unselBrush, bool useSelection=true)
Definition: TrackArt.cpp:422
void DrawNoteTrack(TrackPanelDrawingContext &context, const NoteTrack *track, const wxRect &rect, bool muted, bool selected)

References TrackPanelDrawable::Draw(), TrackArt::DrawBackgroundWithSelection(), anonymous_namespace{NoteTrackView.cpp}::DrawNoteTrack(), CommonTrackPanelCell::FindTrack(), TrackArtist::Get(), GetAffordanceControls(), AColor::labelSelectedBrush, AColor::labelUnselectedBrush, and TrackArtist::PassTracks.

Here is the call graph for this function:

◆ GetAffordanceControls()

std::shared_ptr< CommonTrackCell > NoteTrackView::GetAffordanceControls ( )
overrideprivatevirtual

Reimplemented from TrackView.

Definition at line 79 of file NoteTrackView.cpp.

80{
81 if (mpAffordanceCellControl == nullptr)
82 {
83 mpAffordanceCellControl = std::make_shared<NoteTrackAffordanceControls>(DoFindTrack());
84 }
86}
std::shared_ptr< Track > DoFindTrack() override
std::shared_ptr< CommonTrackCell > mpAffordanceCellControl
Definition: NoteTrackView.h:40

References CommonTrackCell::DoFindTrack(), and mpAffordanceCellControl.

Referenced by Draw().

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

◆ operator=()

NoteTrackView & NoteTrackView::operator= ( const NoteTrackView )
privatedelete

Member Data Documentation

◆ mpAffordanceCellControl

std::shared_ptr<CommonTrackCell> NoteTrackView::mpAffordanceCellControl
private

Definition at line 40 of file NoteTrackView.h.

Referenced by GetAffordanceControls().


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