Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
anonymous_namespace{TrackPanel.cpp}::ChannelGroup Struct Referencefinal
Inheritance diagram for anonymous_namespace{TrackPanel.cpp}::ChannelGroup:
[legend]
Collaboration diagram for anonymous_namespace{TrackPanel.cpp}::ChannelGroup:
[legend]

Public Member Functions

 ChannelGroup (const std::shared_ptr< Track > &pTrack, 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< TrackmpTrack
 
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 1395 of file TrackPanel.cpp.

Constructor & Destructor Documentation

◆ ChannelGroup()

anonymous_namespace{TrackPanel.cpp}::ChannelGroup::ChannelGroup ( const std::shared_ptr< Track > &  pTrack,
wxCoord  leftOffset 
)
inline

Definition at line 1396 of file TrackPanel.cpp.

Member Function Documentation

◆ Children()

Subdivision anonymous_namespace{TrackPanel.cpp}::ChannelGroup::Children ( const wxRect &  rect_)
inlineoverridevirtual

Implements TrackPanelGroup.

Definition at line 1398 of file TrackPanel.cpp.

1399 {
1400 auto rect = rect_;
1401 Refinement refinement;
1402
1403 const auto channels = TrackList::Channels( mpTrack.get() );
1404 const auto pLast = *channels.rbegin();
1405 wxCoord yy = rect.GetTop();
1406 auto heights = FindAdjustedChannelHeights(*mpTrack);
1407 auto pHeight = heights.begin();
1408 for ( auto channel : channels )
1409 {
1410 auto &view = TrackView::Get( *channel );
1411 if (auto affordance = view.GetAffordanceControls())
1412 {
1413 auto panelRect = std::make_shared<EmptyPanelRect>(
1414 channel->shared_from_this(),
1415 channel->GetSelected() ? clrTrackInfoSelected : clrTrackInfo);
1416 Refinement hgroup {
1417 std::make_pair(rect.GetLeft() + 1, panelRect),
1418 std::make_pair(mLeftOffset, affordance)
1419 };
1420 refinement.emplace_back(yy, std::make_shared<HorizontalGroup>(hgroup));
1422 }
1423
1424 auto height = *pHeight++;
1425 rect.SetTop( yy );
1426 rect.SetHeight( height - kChannelSeparatorThickness );
1427 refinement.emplace_back( yy,
1428 std::make_shared< VRulersAndChannels >(
1429 channel->shared_from_this(),
1430 TrackView::Get( *channel ).GetSubViews( rect ),
1431 mLeftOffset ) );
1432 if ( channel != pLast ) {
1433 yy += height;
1434 refinement.emplace_back(
1436 TrackPanelResizerCell::Get( *channel ).shared_from_this() );
1437 }
1438 }
1439
1440 return { Axis::Y, std::move( refinement ) };
1441 }
@ kChannelSeparatorThickness
@ kAffordancesAreaHeight
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1541
std::vector< Child > Refinement
static TrackPanelResizerCell & Get(Track &track)
virtual Refinement GetSubViews(const wxRect &rect)
Definition: TrackView.cpp:131
static TrackView & Get(Track &)
Definition: TrackView.cpp:69
std::vector< int > FindAdjustedChannelHeights(Track &t)
Definition: TrackPanel.cpp:876

References TrackList::Channels(), anonymous_namespace{TrackPanel.cpp}::FindAdjustedChannelHeights(), TrackView::Get(), TrackPanelResizerCell::Get(), TrackView::GetSubViews(), kAffordancesAreaHeight, and kChannelSeparatorThickness.

Here is the call graph for this function:

◆ Draw()

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

Reimplemented from TrackPanelDrawable.

Definition at line 1443 of file TrackPanel.cpp.

1444 {
1445 TrackPanelGroup::Draw(context, rect, iPass);
1446 if (iPass == TrackArtist::PassFocus && mpTrack->IsSelected())
1447 {
1448 const auto channels = TrackList::Channels(mpTrack.get());
1449 const auto pLast = *channels.rbegin();
1450 wxCoord yy = rect.GetTop();
1451 auto heights = FindAdjustedChannelHeights(*mpTrack);
1452 auto pHeight = heights.begin();
1453 for (auto channel : channels)
1454 {
1455 auto& view = TrackView::Get(*channel);
1456 auto height = *pHeight++;
1457 if (auto affordance = view.GetAffordanceControls())
1458 {
1459 height += kAffordancesAreaHeight;
1460 }
1461 auto trackRect = wxRect(
1463 yy,
1464 rect.GetRight() - mLeftOffset,
1466 TrackArt::DrawCursor(context, trackRect, mpTrack.get());
1467 yy += height;
1468 }
1469 }
1470 }
virtual void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
AUDACITY_DLL_API void DrawCursor(TrackPanelDrawingContext &context, const wxRect &rect, const Track *track)
Definition: TrackArt.cpp:498

References TrackList::Channels(), TrackPanelDrawable::Draw(), TrackArt::DrawCursor(), anonymous_namespace{TrackPanel.cpp}::FindAdjustedChannelHeights(), TrackView::Get(), kAffordancesAreaHeight, kChannelSeparatorThickness, and TrackArtist::PassFocus.

Here is the call graph for this function:

Member Data Documentation

◆ mLeftOffset

wxCoord anonymous_namespace{TrackPanel.cpp}::ChannelGroup::mLeftOffset

Definition at line 1473 of file TrackPanel.cpp.

◆ mpTrack

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

Definition at line 1472 of file TrackPanel.cpp.


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