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

Member Function Documentation

◆ Children()

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

Implements TrackPanelGroup.

Definition at line 1393 of file TrackPanel.cpp.

1394 {
1395 auto rect = rect_;
1396 Refinement refinement;
1397
1398 const auto channels = TrackList::Channels( mpTrack.get() );
1399 const auto pLast = *channels.rbegin();
1400 wxCoord yy = rect.GetTop();
1401 auto heights = FindAdjustedChannelHeights(*mpTrack);
1402 auto pHeight = heights.begin();
1403 for ( auto channel : channels )
1404 {
1405 auto &view = TrackView::Get( *channel );
1406 if (auto affordance = view.GetAffordanceControls())
1407 {
1408 auto panelRect = std::make_shared<EmptyPanelRect>(
1409 channel->shared_from_this(),
1410 channel->GetSelected() ? clrTrackInfoSelected : clrTrackInfo);
1411 Refinement hgroup {
1412 std::make_pair(rect.GetLeft() + 1, panelRect),
1413 std::make_pair(mLeftOffset, affordance)
1414 };
1415 refinement.emplace_back(yy, std::make_shared<HorizontalGroup>(hgroup));
1417 }
1418
1419 auto height = *pHeight++;
1420 rect.SetTop( yy );
1421 rect.SetHeight( height - kChannelSeparatorThickness );
1422 refinement.emplace_back( yy,
1423 std::make_shared< VRulersAndChannels >(
1424 channel->shared_from_this(),
1425 TrackView::Get( *channel ).GetSubViews( rect ),
1426 mLeftOffset ) );
1427 if ( channel != pLast ) {
1428 yy += height;
1429 refinement.emplace_back(
1431 TrackPanelResizerCell::Get( *channel ).shared_from_this() );
1432 }
1433 }
1434
1435 return { Axis::Y, std::move( refinement ) };
1436 }
@ kChannelSeparatorThickness
@ kAffordancesAreaHeight
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1533
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:871

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

1439 {
1440 TrackPanelGroup::Draw(context, rect, iPass);
1441 if (iPass == TrackArtist::PassFocus && mpTrack->IsSelected())
1442 {
1443 const auto channels = TrackList::Channels(mpTrack.get());
1444 const auto pLast = *channels.rbegin();
1445 wxCoord yy = rect.GetTop();
1446 auto heights = FindAdjustedChannelHeights(*mpTrack);
1447 auto pHeight = heights.begin();
1448 for (auto channel : channels)
1449 {
1450 auto& view = TrackView::Get(*channel);
1451 auto height = *pHeight++;
1452 if (auto affordance = view.GetAffordanceControls())
1453 {
1454 height += kAffordancesAreaHeight;
1455 }
1456 auto trackRect = wxRect(
1458 yy,
1459 rect.GetRight() - mLeftOffset,
1461 TrackArt::DrawCursor(context, trackRect, mpTrack.get());
1462 yy += height;
1463 }
1464 }
1465 }
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 1468 of file TrackPanel.cpp.

◆ mpTrack

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

Definition at line 1467 of file TrackPanel.cpp.


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