Audacity  3.0.3
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 ()
 
- Public Member Functions inherited from TrackPanelNode
 TrackPanelNode ()
 
virtual ~TrackPanelNode ()=0
 
- Public Member Functions inherited from TrackPanelDrawable
virtual ~TrackPanelDrawable ()=0
 
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  Axis { Axis::X, Axis::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 1402 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 1403 of file TrackPanel.cpp.

1404  : mpTrack{ pTrack }, mLeftOffset{ leftOffset } {}

Member Function Documentation

◆ Children()

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

Implements TrackPanelGroup.

Definition at line 1405 of file TrackPanel.cpp.

1406  {
1407  auto rect = rect_;
1408  Refinement refinement;
1409 
1410  const auto channels = TrackList::Channels( mpTrack.get() );
1411  const auto pLast = *channels.rbegin();
1412  wxCoord yy = rect.GetTop();
1413  auto heights = FindAdjustedChannelHeights(*mpTrack);
1414  auto pHeight = heights.begin();
1415  for ( auto channel : channels )
1416  {
1417  auto &view = TrackView::Get( *channel );
1418  if (auto affordance = view.GetAffordanceControls())
1419  {
1420  auto panelRect = std::make_shared<EmptyPanelRect>(
1421  channel->shared_from_this(),
1422  channel->GetSelected() ? clrTrackInfoSelected : clrTrackInfo);
1423  Refinement hgroup {
1424  std::make_pair(rect.GetLeft() + 1, panelRect),
1425  std::make_pair(mLeftOffset, affordance)
1426  };
1427  refinement.emplace_back(yy, std::make_shared<HorizontalGroup>(hgroup));
1428  yy += kAffordancesAreaHeight;
1429  }
1430 
1431  auto height = *pHeight++;
1432  rect.SetTop( yy );
1433  rect.SetHeight( height - kChannelSeparatorThickness );
1434  refinement.emplace_back( yy,
1435  std::make_shared< VRulersAndChannels >(
1436  channel->shared_from_this(),
1437  TrackView::Get( *channel ).GetSubViews( rect ),
1438  mLeftOffset ) );
1439  if ( channel != pLast ) {
1440  yy += height;
1441  refinement.emplace_back(
1443  TrackPanelResizerCell::Get( *channel ).shared_from_this() );
1444  }
1445  }
1446 
1447  return { Axis::Y, std::move( refinement ) };
1448  }

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

1451  {
1452  TrackPanelGroup::Draw(context, rect, iPass);
1453  if (iPass == TrackArtist::PassFocus && mpTrack->IsSelected())
1454  {
1455  const auto channels = TrackList::Channels(mpTrack.get());
1456  const auto pLast = *channels.rbegin();
1457  wxCoord yy = rect.GetTop();
1458  auto heights = FindAdjustedChannelHeights(*mpTrack);
1459  auto pHeight = heights.begin();
1460  for (auto channel : channels)
1461  {
1462  auto& view = TrackView::Get(*channel);
1463  auto height = *pHeight++;
1464  if (auto affordance = view.GetAffordanceControls())
1465  {
1466  height += kAffordancesAreaHeight;
1467  }
1468  auto trackRect = wxRect(
1469  mLeftOffset,
1470  yy,
1471  rect.GetRight() - mLeftOffset,
1472  height - kChannelSeparatorThickness);
1473  TrackArt::DrawCursor(context, trackRect, mpTrack.get());
1474  yy += height;
1475  }
1476  }
1477  }

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

◆ mpTrack

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

Definition at line 1479 of file TrackPanel.cpp.


The documentation for this struct was generated from the following file:
TrackPanelGroup::Refinement
std::vector< Child > Refinement
Definition: TrackPanelCell.h:64
TrackView::Get
static TrackView & Get(Track &)
Definition: TrackView.cpp:63
TrackList::Channels
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1484
anonymous_namespace{TrackPanel.cpp}::FindAdjustedChannelHeights
std::vector< int > FindAdjustedChannelHeights(Track &t)
Definition: TrackPanel.cpp:882
TrackPanelGroup::Axis::Y
@ Y
TrackArt::DrawCursor
AUDACITY_DLL_API void DrawCursor(TrackPanelDrawingContext &context, const wxRect &rect, const Track *track)
Definition: TrackArtist.cpp:607
anonymous_namespace{TrackPanel.cpp}::ChannelGroup::mpTrack
std::shared_ptr< Track > mpTrack
Definition: TrackPanel.cpp:1479
kAffordancesAreaHeight
@ kAffordancesAreaHeight
Definition: TrackPanelConstants.h:19
TrackView::GetSubViews
virtual Refinement GetSubViews(const wxRect &rect)
Definition: TrackView.cpp:116
kChannelSeparatorThickness
@ kChannelSeparatorThickness
Definition: TrackPanelConstants.h:24
anonymous_namespace{TrackPanel.cpp}::ChannelGroup::mLeftOffset
wxCoord mLeftOffset
Definition: TrackPanel.cpp:1480
TrackArtist::PassFocus
@ PassFocus
Definition: TrackArtist.h:87
TrackPanelResizerCell::Get
static TrackPanelResizerCell & Get(Track &track)
Definition: TrackPanelResizerCell.cpp:119
TrackPanelDrawable::Draw
virtual void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
Definition: TrackPanelDrawable.cpp:17