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

1237 : mpChannel{ pChannel }
1238 , mRefinement{ std::move( refinement ) }
1239 , mLeftOffset{ leftOffset } {}

Member Function Documentation

◆ Children()

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

Implements TrackPanelGroup.

Definition at line 1240 of file TrackPanel.cpp.

1241 {
1242 Refinement refinement;
1243 auto y1 = rect.GetTop();
1244 for ( const auto &subView : mRefinement ) {
1245 y1 = std::max( y1, subView.first );
1246 refinement.emplace_back( y1,
1247 std::make_shared< VRulerAndChannel >(
1248 subView.second, mLeftOffset ) );
1249 }
1250 return { Axis::Y, std::move( refinement ) };
1251 }
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 1254 of file TrackPanel.cpp.

1257 {
1258 // This overpaints the track area, but sometimes too the stereo channel
1259 // separator, so draw at least later than that
1260 if ( iPass == TrackArtist::PassBorders ) {
1261 DrawTrackName(mLeftOffset, context, *mpChannel, rect);
1262 }
1263 if ( iPass == TrackArtist::PassControls ) {
1264 if (mRefinement.size() > 1) {
1265 // Draw lines separating sub-views
1266 auto &dc = context.dc;
1267 AColor::CursorColor( &dc );
1268 auto iter = mRefinement.begin() + 1, end = mRefinement.end();
1269 for ( ; iter != end; ++iter ) {
1270 auto yy = iter->first;
1271 AColor::Line( dc, mLeftOffset, yy, rect.GetRight(), yy );
1272 }
1273 }
1274 }
1275 }
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 Channel &channel, 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 1277 of file TrackPanel.cpp.

1280 {
1281 auto result = rect;
1282 if ( iPass == TrackArtist::PassBorders ) {
1283 if ( true ) {
1284 wxCoord textWidth, textHeight;
1285 GetTrackNameExtent(context.dc, *mpChannel, &textWidth, &textHeight);
1286 result =
1287 GetTrackNameRect( mLeftOffset, rect, textWidth, textHeight );
1288 }
1289 }
1290 return result;
1291 }
void GetTrackNameExtent(wxDC &dc, const Channel &channel, wxCoord *pW, wxCoord *pH)
wxRect GetTrackNameRect(int leftOffset, const wxRect &trackRect, wxCoord textWidth, wxCoord textHeight)

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

◆ mpChannel

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

Definition at line 1293 of file TrackPanel.cpp.

◆ mRefinement

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

Definition at line 1294 of file TrackPanel.cpp.


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