Audacity  3.0.3
Public Types | Public Member Functions | Static Protected Member Functions | Private Attributes | List of all members
WaveTrackSubView Class Referenceabstract

#include <WaveTrackView.h>

Inheritance diagram for WaveTrackSubView:
Collaboration diagram for WaveTrackSubView:

Public Types

using Display = WaveTrackViewConstants::Display
using Type = WaveTrackSubViewType
- 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) >

Public Member Functions

 WaveTrackSubView (WaveTrackView &waveTrackView)
virtual const TypeSubViewType () const =0
std::pair< bool, std::vector< UIHandlePtr > > DoDetailedHitTest (const TrackPanelMouseState &state, const AudacityProject *pProject, int currentTool, bool bMultiTool, const std::shared_ptr< WaveTrack > &wt)
- 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 GetY () const
int GetActualHeight () const
int GetHeight () const
void SetY (int y)
void SetHeight (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
- Public Member Functions inherited from TrackPanelCell
 TrackPanelCell ()=default
 TrackPanelCell (const TrackPanelCell &) PROHIBITED
TrackPanelCelloperator= (const TrackPanelCell &) PROHIBITED
virtual ~TrackPanelCell ()=0
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 Protected Member Functions

static void DrawBoldBoundaries (TrackPanelDrawingContext &context, const WaveTrack *track, const wxRect &rect)

Private Attributes

std::weak_ptr< UIHandlemCloseHandle
std::weak_ptr< UIHandlemAdjustHandle
std::weak_ptr< UIHandlemRearrangeHandle
std::weak_ptr< CutlineHandlemCutlineHandle
std::weak_ptr< WaveTrackViewmwWaveTrackView

Additional Inherited Members

- 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 CommonTrackView
virtual std::vector< UIHandlePtrDetailedHitTest (const TrackPanelMouseState &, const AudacityProject *pProject, int currentTool, bool bMultiTool)=0
- Protected Member Functions inherited from TrackView
void DoSetY (int y)
void DoSetHeight (int h)
virtual std::shared_ptr< TrackVRulerControlsDoGetVRulerControls ()=0
- Protected Member Functions inherited from CommonTrackPanelCell
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 25 of file WaveTrackView.h.

Member Typedef Documentation

◆ Display

Definition at line 29 of file WaveTrackView.h.

◆ Type

Definition at line 30 of file WaveTrackView.h.

Constructor & Destructor Documentation

◆ WaveTrackSubView()

WaveTrackSubView::WaveTrackSubView ( WaveTrackView waveTrackView)

Definition at line 778 of file WaveTrackView.cpp.

779  : CommonTrackView( waveTrackView.FindTrack() )
780 {
781  mwWaveTrackView = std::static_pointer_cast<WaveTrackView>(
782  waveTrackView.shared_from_this() );
783 }

References mwWaveTrackView.

Member Function Documentation

◆ DoDetailedHitTest()

std::pair< bool, std::vector<UIHandlePtr> > WaveTrackSubView::DoDetailedHitTest ( const TrackPanelMouseState state,
const AudacityProject pProject,
int  currentTool,
bool  bMultiTool,
const std::shared_ptr< WaveTrack > &  wt 

Referenced by SpectrumView::DetailedHitTest(), and WaveformView::DetailedHitTest().

Here is the caller graph for this function:

◆ DrawBoldBoundaries()

void WaveTrackSubView::DrawBoldBoundaries ( TrackPanelDrawingContext context,
const WaveTrack track,
const wxRect &  rect 

Definition at line 722 of file WaveTrackView.cpp.

725 {
726  auto &dc = context.dc;
727  const auto artist = TrackArtist::Get( context );
729  const auto &zoomInfo = *artist->pZoomInfo;
732  auto target2 = dynamic_cast<CutlineHandle*>(;
733 #endif
734  for (const auto loc : track->GetCachedLocations()) {
735  bool highlightLoc = false;
737  highlightLoc =
738  target2 && target2->GetTrack().get() == track &&
739  target2->GetLocation() == loc;
740 #endif
741  const int xx = zoomInfo.TimeToPosition(loc.pos);
742  if (xx >= 0 && xx < rect.width) {
743  dc.SetPen( highlightLoc ? AColor::uglyPen : *wxGREY_PEN );
744  AColor::Line(dc, (int) (rect.x + xx - 1), rect.y, (int) (rect.x + xx - 1), rect.y + rect.height);
745  if (loc.typ == WaveTrackLocation::locationCutLine) {
746  dc.SetPen( highlightLoc ? AColor::uglyPen : *wxRED_PEN );
747  }
748  else {
750  // JKC Black does not show up enough.
751  dc.SetPen(highlightLoc ? AColor::uglyPen : *wxWHITE_PEN);
752 #else
753  dc.SetPen(highlightLoc ? AColor::uglyPen : *wxBLACK_PEN);
754 #endif
755  }
756  AColor::Line(dc, (int) (rect.x + xx), rect.y, (int) (rect.x + xx), rect.y + rect.height);
757  dc.SetPen( highlightLoc ? AColor::uglyPen : *wxGREY_PEN );
758  AColor::Line(dc, (int) (rect.x + xx + 1), rect.y, (int) (rect.x + xx + 1), rect.y + rect.height);
759  }
760  }
761 }

References TrackPanelDrawingContext::dc, TrackArtist::Get(), WaveTrack::GetCachedLocations(), CutlineHandle::GetTrack(), AColor::Line(), WaveTrackLocation::locationCutLine, TrackPanelDrawingContext::target, and AColor::uglyPen.

Referenced by SpectrumView::DoDraw(), and WaveformView::DoDraw().

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

◆ SubViewType()

virtual const Type& WaveTrackSubView::SubViewType ( ) const
pure virtual

Implemented in WaveformView, and SpectrumView.

Referenced by WaveTrackView::DoSetDisplay(), WaveTrackView::GetDisplays(), and WaveTrackView::ToggleSubView().

Here is the caller graph for this function:

Member Data Documentation

◆ mAdjustHandle

std::weak_ptr<UIHandle> WaveTrackSubView::mAdjustHandle

Definition at line 52 of file WaveTrackView.h.

◆ mCloseHandle

std::weak_ptr<UIHandle> WaveTrackSubView::mCloseHandle

Definition at line 51 of file WaveTrackView.h.

◆ mCutlineHandle

std::weak_ptr<CutlineHandle> WaveTrackSubView::mCutlineHandle

Definition at line 54 of file WaveTrackView.h.

◆ mRearrangeHandle

std::weak_ptr<UIHandle> WaveTrackSubView::mRearrangeHandle

Definition at line 53 of file WaveTrackView.h.

◆ mwWaveTrackView

std::weak_ptr<WaveTrackView> WaveTrackSubView::mwWaveTrackView

Definition at line 55 of file WaveTrackView.h.

Referenced by WaveTrackSubView().

The documentation for this class was generated from the following files:
Definition: CommonTrackView.h:20
Definition: CutlineHandle.h:22
std::shared_ptr< Track > FindTrack()
Definition: CommonTrackPanelCell.h:44
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
Definition: AColor.cpp:112
wxDC & dc
Definition: TrackPanelDrawingContext.h:23
const std::vector< Location > & GetCachedLocations() const
Definition: WaveTrack.h:524
std::shared_ptr< WaveTrack > GetTrack()
Definition: CutlineHandle.h:44
static TrackArtist * Get(TrackPanelDrawingContext &)
Definition: TrackArtist.cpp:75
static wxPen uglyPen
Definition: AColor.h:131
std::weak_ptr< WaveTrackView > mwWaveTrackView
Definition: WaveTrackView.h:55
UIHandlePtr target
Definition: TrackPanelDrawingContext.h:24
@ locationCutLine
Definition: WaveTrackLocation.h:17