Audacity  3.0.3
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
 
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
 
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

 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 > > >
 
- 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 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 34 of file NoteTrackView.cpp.

35  : CommonTrackView{ pTrack }
36 {
37 }

◆ ~NoteTrackView()

NoteTrackView::~NoteTrackView ( )
override

Definition at line 39 of file NoteTrackView.cpp.

40 {
41 }

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 43 of file NoteTrackView.cpp.

46 {
47  // Eligible for stretch?
48  UIHandlePtr result;
49  std::vector<UIHandlePtr> results;
50 #ifdef USE_MIDI
51 #ifdef EXPERIMENTAL_MIDI_STRETCHING
52  result = StretchHandle::HitTest(
53  mStretchHandle, state, pProject, Pointer<NoteTrack>(this) );
54  if (result)
55  results.push_back(result);
56 #endif
57 #endif
58 
59  return results;
60 }

References StretchHandle::HitTest().

Here is the call graph for this function:

◆ DoGetVRulerControls()

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

Implements TrackView.

Definition at line 69 of file NoteTrackView.cpp.

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

◆ Draw()

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

Reimplemented from TrackPanelDrawable.

Definition at line 726 of file NoteTrackView.cpp.

729 {
730  if ( iPass == TrackArtist::PassTracks ) {
731  const auto nt = std::static_pointer_cast<const NoteTrack>(
732  FindTrack()->SubstitutePendingChangedTrack());
733  bool muted = false;
734 #ifdef EXPERIMENTAL_MIDI_OUT
735  const auto artist = TrackArtist::Get( context );
736  const auto hasSolo = artist->hasSolo;
737  muted = (hasSolo || nt->GetMute()) && !nt->GetSolo();
738 #endif
739 
740 #ifdef EXPERIMENTAL_NOTETRACK_OVERLAY
742 #endif
743  bool selected{ false };
744  if (auto affordance = std::dynamic_pointer_cast<NoteTrackAffordanceControls>(GetAffordanceControls()))
745  {
746  selected = affordance->IsSelected();
747  }
748 
749  DrawNoteTrack(context, nt.get(), rect, muted, selected);
750  }
751  CommonTrackView::Draw( context, rect, iPass );
752 }

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 78 of file NoteTrackView.cpp.

79 {
80  if (mpAffordanceCellControl == nullptr)
81  {
82  mpAffordanceCellControl = std::make_shared<NoteTrackAffordanceControls>(DoFindTrack());
83  }
85 }

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:
CommonTrackView
Definition: CommonTrackView.h:20
AColor::labelUnselectedBrush
static wxBrush labelUnselectedBrush
Definition: AColor.h:110
CommonTrackPanelCell::FindTrack
std::shared_ptr< Track > FindTrack()
Definition: CommonTrackPanelCell.h:46
NoteTrackView::GetAffordanceControls
std::shared_ptr< CommonTrackCell > GetAffordanceControls() override
Definition: NoteTrackView.cpp:78
CommonTrackCell::DoFindTrack
std::shared_ptr< Track > DoFindTrack() override
Definition: CommonTrackPanelCell.cpp:147
TrackArtist::Get
static TrackArtist * Get(TrackPanelDrawingContext &)
Definition: TrackArtist.cpp:79
NoteTrackView::mpAffordanceCellControl
std::shared_ptr< CommonTrackCell > mpAffordanceCellControl
Definition: NoteTrackView.h:40
AColor::labelSelectedBrush
static wxBrush labelSelectedBrush
Definition: AColor.h:111
UIHandlePtr
std::shared_ptr< UIHandle > UIHandlePtr
Definition: CellularPanel.h:28
StretchHandle::HitTest
static UIHandlePtr HitTest(std::weak_ptr< StretchHandle > &holder, const TrackPanelMouseState &state, const AudacityProject *pProject, const std::shared_ptr< NoteTrack > &pTrack)
Definition: StretchHandle.cpp:72
TrackArt::DrawBackgroundWithSelection
AUDACITY_DLL_API void DrawBackgroundWithSelection(TrackPanelDrawingContext &context, const wxRect &rect, const Track *track, const wxBrush &selBrush, const wxBrush &unselBrush, bool useSelection=true)
Definition: TrackArtist.cpp:528
anonymous_namespace{NoteTrackView.cpp}::DrawNoteTrack
void DrawNoteTrack(TrackPanelDrawingContext &context, const NoteTrack *track, const wxRect &rect, bool muted, bool selected)
Definition: NoteTrackView.cpp:361
TrackArtist::PassTracks
@ PassTracks
Definition: TrackArtist.h:81
TrackPanelDrawable::Draw
virtual void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
Definition: TrackPanelDrawable.cpp:17