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< Channel > &pChannel, ChannelView::Refinement refinement, wxCoord leftOffset)
 
Subdivision Children (const wxRect &rect) override
 
void Draw (TrackPanelDrawingContext &context, const wxRect &rect, 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< ChannelmpChannel
 
ChannelView::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 1151 of file TrackPanel.cpp.

Constructor & Destructor Documentation

◆ VRulersAndChannels()

anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::VRulersAndChannels ( const std::shared_ptr< Channel > &  pChannel,
ChannelView::Refinement  refinement,
wxCoord  leftOffset 
)
inline

Definition at line 1152 of file TrackPanel.cpp.

1155 : mpChannel{ pChannel }
1156 , mRefinement{ std::move( refinement ) }
1157 , mLeftOffset{ leftOffset } {}

Member Function Documentation

◆ Children()

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

Implements TrackPanelGroup.

Definition at line 1158 of file TrackPanel.cpp.

1159 {
1160 Refinement refinement;
1161 auto y1 = rect.GetTop();
1162 for ( const auto &subView : mRefinement ) {
1163 y1 = std::max( y1, subView.first );
1164 refinement.emplace_back( y1,
1165 std::make_shared< VRulerAndChannel >(
1166 subView.second, mLeftOffset ) );
1167 }
1168 return { Axis::Y, std::move( refinement ) };
1169 }
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 1172 of file TrackPanel.cpp.

1175 {
1176 // This overpaints the track area, but sometimes too the stereo channel
1177 // separator, so draw at least later than that
1178
1179 if ( iPass == TrackArtist::PassBorders ) {
1180 if (mRefinement.size() > 1) {
1181 // Draw lines separating sub-views
1182 auto &dc = context.dc;
1183 AColor::CursorColor( &dc );
1184 auto iter = mRefinement.begin() + 1, end = mRefinement.end();
1185 for ( ; iter != end; ++iter ) {
1186 auto yy = iter->first;
1187 AColor::Line(dc, rect.x, yy, mLeftOffset - 1, yy);
1188 AColor::Line( dc, mLeftOffset, yy, rect.GetRight(), yy );
1189 }
1190 }
1191 }
1192 }
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
Definition: AColor.cpp:194
static void CursorColor(wxDC *dc)
Definition: AColor.cpp:437
const char * end(const char *str) noexcept
Definition: StringUtils.h:106

References AColor::CursorColor(), TrackPanelDrawingContext::dc, details::end(), AColor::Line(), 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 1196 of file TrackPanel.cpp.

◆ mpChannel

std::shared_ptr<Channel> anonymous_namespace{TrackPanel.cpp}::VRulersAndChannels::mpChannel

Definition at line 1194 of file TrackPanel.cpp.

◆ mRefinement

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

Definition at line 1195 of file TrackPanel.cpp.


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