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

1267 : mpTrack{ pTrack }
1268 , mRefinement{ std::move( refinement ) }
1269 , mLeftOffset{ leftOffset } {}

Member Function Documentation

◆ Children()

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

Implements TrackPanelGroup.

Definition at line 1270 of file TrackPanel.cpp.

1271 {
1272 Refinement refinement;
1273 auto y1 = rect.GetTop();
1274 for ( const auto &subView : mRefinement ) {
1275 y1 = std::max( y1, subView.first );
1276 refinement.emplace_back( y1,
1277 std::make_shared< VRulerAndChannel >(
1278 subView.second, mLeftOffset ) );
1279 }
1280 return { Axis::Y, std::move( refinement ) };
1281 }
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 1284 of file TrackPanel.cpp.

1287 {
1288 // This overpaints the track area, but sometimes too the stereo channel
1289 // separator, so draw at least later than that
1290 if ( iPass == TrackArtist::PassBorders ) {
1292 context, mpTrack->SubstitutePendingChangedTrack().get(), rect );
1293 }
1294 if ( iPass == TrackArtist::PassControls ) {
1295 if (mRefinement.size() > 1) {
1296 // Draw lines separating sub-views
1297 auto &dc = context.dc;
1298 AColor::CursorColor( &dc );
1299 auto iter = mRefinement.begin() + 1, end = mRefinement.end();
1300 for ( ; iter != end; ++iter ) {
1301 auto yy = iter->first;
1302 AColor::Line( dc, mLeftOffset, yy, rect.GetRight(), yy );
1303 }
1304 }
1305 }
1306 }
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:440
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for, if Traits<Type>::iterated_type is defined.
Definition: PackedArray.h:126
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 1308 of file TrackPanel.cpp.

1311 {
1312 auto result = rect;
1313 if ( iPass == TrackArtist::PassBorders ) {
1314 if ( true ) {
1315 wxCoord textWidth, textHeight;
1316 GetTrackNameExtent( context.dc, mpTrack.get(),
1317 &textWidth, &textHeight );
1318 result =
1319 GetTrackNameRect( mLeftOffset, rect, textWidth, textHeight );
1320 }
1321 }
1322 return result;
1323 }
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 1327 of file TrackPanel.cpp.

◆ mpTrack

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

Definition at line 1325 of file TrackPanel.cpp.

◆ mRefinement

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

Definition at line 1326 of file TrackPanel.cpp.


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