Audacity  3.0.3
Public Member Functions | Public Attributes | List of all members
anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels Struct Referencefinal
Inheritance diagram for anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels:
[legend]
Collaboration diagram for anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels:
[legend]

Public Member Functions

 VRulersAndChannels (const std::shared_ptr< Track > &pTrack, TrackView::Refinement refinement, wxCoord leftOffset)
 
Subdivision Children (const wxRect &rect) override
 
void Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
 
wxRect DrawingArea (TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass) override
 
- Public Member Functions inherited from TrackPanelGroup
 TrackPanelGroup ()
 
virtual ~TrackPanelGroup ()
 
- Public Member Functions inherited from TrackPanelNode
 TrackPanelNode ()
 
virtual ~TrackPanelNode ()=0
 
- Public Member Functions inherited from TrackPanelDrawable
virtual ~TrackPanelDrawable ()=0
 

Public Attributes

std::shared_ptr< TrackmpTrack
 
TrackView::Refinement mRefinement
 
wxCoord mLeftOffset
 

Additional Inherited Members

- Public Types inherited from TrackPanelGroup
enum  Axis { Axis::X, Axis::Y }
 
using Child = std::pair< wxCoord, std::shared_ptr< TrackPanelNode > >
 
using Refinement = std::vector< Child >
 
using Subdivision = std::pair< Axis, Refinement >
 
- 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)
 

Detailed Description

Definition at line 1275 of file TrackPanel.cpp.

Constructor & Destructor Documentation

◆ VRulersAndChannels()

anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::VRulersAndChannels ( const std::shared_ptr< Track > &  pTrack,
TrackView::Refinement  refinement,
wxCoord  leftOffset 
)
inline

Definition at line 1276 of file TrackPanel.cpp.

1279  : mpTrack{ pTrack }
1280  , mRefinement{ std::move( refinement ) }
1281  , mLeftOffset{ leftOffset } {}

Member Function Documentation

◆ Children()

Subdivision anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::Children ( const wxRect &  rect)
inlineoverridevirtual

Implements TrackPanelGroup.

Definition at line 1282 of file TrackPanel.cpp.

1283  {
1284  Refinement refinement;
1285  auto y1 = rect.GetTop();
1286  for ( const auto &subView : mRefinement ) {
1287  y1 = std::max( y1, subView.first );
1288  refinement.emplace_back( y1,
1289  std::make_shared< VRulerAndChannel >(
1290  subView.second, mLeftOffset ) );
1291  }
1292  return { Axis::Y, std::move( refinement ) };
1293  }

◆ Draw()

void anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::Draw ( TrackPanelDrawingContext context,
const wxRect &  rect,
unsigned  iPass 
)
inlineoverridevirtual

Reimplemented from TrackPanelDrawable.

Definition at line 1296 of file TrackPanel.cpp.

1299  {
1300  // This overpaints the track area, but sometimes too the stereo channel
1301  // separator, so draw at least later than that
1302  if ( iPass == TrackArtist::PassBorders ) {
1304  context, mpTrack->SubstitutePendingChangedTrack().get(), rect );
1305  }
1306  if ( iPass == TrackArtist::PassControls ) {
1307  if (mRefinement.size() > 1) {
1308  // Draw lines separating sub-views
1309  auto &dc = context.dc;
1310  AColor::CursorColor( &dc );
1311  auto iter = mRefinement.begin() + 1, end = mRefinement.end();
1312  for ( ; iter != end; ++iter ) {
1313  auto yy = iter->first;
1314  AColor::Line( dc, mLeftOffset, yy, rect.GetRight(), yy );
1315  }
1316  }
1317  }
1318  }

References AColor::CursorColor(), TrackPanelDrawingContext::dc, anonymous_namespace{TrackPanel.cpp}::DrawTrackName(), AColor::Line(), TrackArtist::PassBorders, and TrackArtist::PassControls.

Here is the call graph for this function:

◆ DrawingArea()

wxRect anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::DrawingArea ( TrackPanelDrawingContext context,
const wxRect &  rect,
const wxRect &  panelRect,
unsigned  iPass 
)
inlineoverridevirtual

Reimplemented from TrackPanelDrawable.

Definition at line 1320 of file TrackPanel.cpp.

1323  {
1324  auto result = rect;
1325  if ( iPass == TrackArtist::PassBorders ) {
1326  if ( true ) {
1327  wxCoord textWidth, textHeight;
1328  GetTrackNameExtent( context.dc, mpTrack.get(),
1329  &textWidth, &textHeight );
1330  result =
1331  GetTrackNameRect( mLeftOffset, rect, textWidth, textHeight );
1332  }
1333  }
1334  return result;
1335  }

References TrackPanelDrawingContext::dc, anonymous_namespace{TrackPanel.cpp}::GetTrackNameExtent(), anonymous_namespace{TrackPanel.cpp}::GetTrackNameRect(), and TrackArtist::PassBorders.

Here is the call graph for this function:

Member Data Documentation

◆ mLeftOffset

wxCoord anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::mLeftOffset

Definition at line 1339 of file TrackPanel.cpp.

◆ mpTrack

std::shared_ptr< Track > anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::mpTrack

Definition at line 1337 of file TrackPanel.cpp.

◆ mRefinement

TrackView::Refinement anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::mRefinement

Definition at line 1338 of file TrackPanel.cpp.


The documentation for this struct was generated from the following file:
TrackPanelGroup::Refinement
std::vector< Child > Refinement
Definition: TrackPanelCell.h:64
AColor::CursorColor
static void CursorColor(wxDC *dc)
Definition: AColor.cpp:371
anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::mRefinement
TrackView::Refinement mRefinement
Definition: TrackPanel.cpp:1338
TrackArtist::PassBorders
@ PassBorders
Definition: TrackArtist.h:83
AColor::Line
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
Definition: AColor.cpp:109
TrackPanelDrawingContext::dc
wxDC & dc
Definition: TrackPanelDrawingContext.h:23
TrackArtist::PassControls
@ PassControls
Definition: TrackArtist.h:84
anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::mpTrack
std::shared_ptr< Track > mpTrack
Definition: TrackPanel.cpp:1337
anonymous_namespace{TrackPanel.cpp}::GetTrackNameExtent
void GetTrackNameExtent(wxDC &dc, const Track *t, wxCoord *pW, wxCoord *pH)
Definition: TrackPanel.cpp:1095
TrackPanelGroup::Axis::Y
@ Y
anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::mLeftOffset
wxCoord mLeftOffset
Definition: TrackPanel.cpp:1339
anonymous_namespace{TrackPanel.cpp}::DrawTrackName
void DrawTrackName(int leftOffset, TrackPanelDrawingContext &context, const Track *t, const wxRect &rect)
Definition: TrackPanel.cpp:1116
anonymous_namespace{TrackPanel.cpp}::GetTrackNameRect
wxRect GetTrackNameRect(int leftOffset, const wxRect &trackRect, wxCoord textWidth, wxCoord textHeight)
Definition: TrackPanel.cpp:1103