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 1205 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 1206 of file TrackPanel.cpp.

1209  : mpTrack{ pTrack }
1210  , mRefinement{ std::move( refinement ) }
1211  , mLeftOffset{ leftOffset } {}

Member Function Documentation

◆ Children()

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

Implements TrackPanelGroup.

Definition at line 1212 of file TrackPanel.cpp.

1213  {
1214  Refinement refinement;
1215  auto y1 = rect.GetTop();
1216  for ( const auto &subView : mRefinement ) {
1217  y1 = std::max( y1, subView.first );
1218  refinement.emplace_back( y1,
1219  std::make_shared< VRulerAndChannel >(
1220  subView.second, mLeftOffset ) );
1221  }
1222  return { Axis::Y, std::move( refinement ) };
1223  }

◆ Draw()

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

Reimplemented from TrackPanelDrawable.

Definition at line 1226 of file TrackPanel.cpp.

1229  {
1230  // This overpaints the track area, but sometimes too the stereo channel
1231  // separator, so draw at least later than that
1232  if ( iPass == TrackArtist::PassBorders ) {
1234  context, mpTrack->SubstitutePendingChangedTrack().get(), rect );
1235  }
1236  if ( iPass == TrackArtist::PassControls ) {
1237  if (mRefinement.size() > 1) {
1238  // Draw lines separating sub-views
1239  auto &dc = context.dc;
1240  AColor::CursorColor( &dc );
1241  auto iter = mRefinement.begin() + 1, end = mRefinement.end();
1242  for ( ; iter != end; ++iter ) {
1243  auto yy = iter->first;
1244  AColor::Line( dc, mLeftOffset, yy, rect.GetRight(), yy );
1245  }
1246  }
1247  }
1248  }

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 1250 of file TrackPanel.cpp.

1253  {
1254  auto result = rect;
1255  if ( iPass == TrackArtist::PassBorders ) {
1256  if ( true ) {
1257  wxCoord textWidth, textHeight;
1258  GetTrackNameExtent( context.dc, mpTrack.get(),
1259  &textWidth, &textHeight );
1260  result =
1261  GetTrackNameRect( mLeftOffset, rect, textWidth, textHeight );
1262  }
1263  }
1264  return result;
1265  }

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 1269 of file TrackPanel.cpp.

◆ mpTrack

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

Definition at line 1267 of file TrackPanel.cpp.

◆ mRefinement

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

Definition at line 1268 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:374
anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::mRefinement
TrackView::Refinement mRefinement
Definition: TrackPanel.cpp:1268
TrackArtist::PassBorders
@ PassBorders
Definition: TrackArtist.h:77
AColor::Line
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
Definition: AColor.cpp:112
TrackPanelDrawingContext::dc
wxDC & dc
Definition: TrackPanelDrawingContext.h:23
TrackArtist::PassControls
@ PassControls
Definition: TrackArtist.h:78
anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::mpTrack
std::shared_ptr< Track > mpTrack
Definition: TrackPanel.cpp:1267
anonymous_namespace{TrackPanel.cpp}::GetTrackNameExtent
void GetTrackNameExtent(wxDC &dc, const Track *t, wxCoord *pW, wxCoord *pH)
Definition: TrackPanel.cpp:1029
TrackPanelGroup::Axis::Y
@ Y
anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::mLeftOffset
wxCoord mLeftOffset
Definition: TrackPanel.cpp:1269
anonymous_namespace{TrackPanel.cpp}::DrawTrackName
void DrawTrackName(int leftOffset, TrackPanelDrawingContext &context, const Track *t, const wxRect &rect)
Definition: TrackPanel.cpp:1050
anonymous_namespace{TrackPanel.cpp}::GetTrackNameRect
wxRect GetTrackNameRect(int leftOffset, const wxRect &trackRect, wxCoord textWidth, wxCoord textHeight)
Definition: TrackPanel.cpp:1037