Audacity 3.2.0
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 ()
 
virtual Subdivision Children (const wxRect &rect)=0
 
- 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 Attributes

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

Additional Inherited Members

- Public Types inherited from TrackPanelGroup
enum class  Axis { X , 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 1268 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 1269 of file TrackPanel.cpp.

1272 : mpTrack{ pTrack }
1273 , mRefinement{ std::move( refinement ) }
1274 , mLeftOffset{ leftOffset } {}

Member Function Documentation

◆ Children()

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

Implements TrackPanelGroup.

Definition at line 1275 of file TrackPanel.cpp.

1276 {
1277 Refinement refinement;
1278 auto y1 = rect.GetTop();
1279 for ( const auto &subView : mRefinement ) {
1280 y1 = std::max( y1, subView.first );
1281 refinement.emplace_back( y1,
1282 std::make_shared< VRulerAndChannel >(
1283 subView.second, mLeftOffset ) );
1284 }
1285 return { Axis::Y, std::move( refinement ) };
1286 }
std::vector< Child > Refinement

◆ Draw()

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

Reimplemented from TrackPanelDrawable.

Definition at line 1289 of file TrackPanel.cpp.

1292 {
1293 // This overpaints the track area, but sometimes too the stereo channel
1294 // separator, so draw at least later than that
1295 if ( iPass == TrackArtist::PassBorders ) {
1297 context, mpTrack->SubstitutePendingChangedTrack().get(), rect );
1298 }
1299 if ( iPass == TrackArtist::PassControls ) {
1300 if (mRefinement.size() > 1) {
1301 // Draw lines separating sub-views
1302 auto &dc = context.dc;
1303 AColor::CursorColor( &dc );
1304 auto iter = mRefinement.begin() + 1, end = mRefinement.end();
1305 for ( ; iter != end; ++iter ) {
1306 auto yy = iter->first;
1307 AColor::Line( dc, mLeftOffset, yy, rect.GetRight(), yy );
1308 }
1309 }
1310 }
1311 }
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
Definition: AColor.cpp:187
static void CursorColor(wxDC *dc)
Definition: AColor.cpp:463
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.
Definition: PackedArray.h:159
void DrawTrackName(int leftOffset, TrackPanelDrawingContext &context, const Track *t, const wxRect &rect)

References AColor::CursorColor(), TrackPanelDrawingContext::dc, anonymous_namespace{TrackPanel.cpp}::DrawTrackName(), PackedArray::end(), 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 1313 of file TrackPanel.cpp.

1316 {
1317 auto result = rect;
1318 if ( iPass == TrackArtist::PassBorders ) {
1319 if ( true ) {
1320 wxCoord textWidth, textHeight;
1321 GetTrackNameExtent( context.dc, mpTrack.get(),
1322 &textWidth, &textHeight );
1323 result =
1324 GetTrackNameRect( mLeftOffset, rect, textWidth, textHeight );
1325 }
1326 }
1327 return result;
1328 }
wxRect GetTrackNameRect(int leftOffset, const wxRect &trackRect, wxCoord textWidth, wxCoord textHeight)
void GetTrackNameExtent(wxDC &dc, const Track *t, wxCoord *pW, wxCoord *pH)

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

◆ mpTrack

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

Definition at line 1330 of file TrackPanel.cpp.

◆ mRefinement

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

Definition at line 1331 of file TrackPanel.cpp.


The documentation for this struct was generated from the following file: