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

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

Member Function Documentation

◆ Children()

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

Implements TrackPanelGroup.

Definition at line 1333 of file TrackPanel.cpp.

1334  {
1335  auto rect = rect_;
1336  Refinement refinement;
1337 
1338  const auto channels = TrackList::Channels( mpTrack.get() );
1339  const auto pLast = *channels.rbegin();
1340  wxCoord yy = rect.GetTop();
1341  for ( auto channel : channels )
1342  {
1343  auto &view = TrackView::Get( *channel );
1344  if (auto affordance = view.GetAffordanceControls())
1345  {
1346  auto panelRect = std::make_shared<EmptyPanelRect>(
1347  channel->shared_from_this(),
1348  channel->GetSelected() ? clrTrackInfoSelected : clrTrackInfo);
1349  Refinement hgroup {
1350  std::make_pair(rect.GetLeft() + 1, panelRect),
1351  std::make_pair(mLeftOffset, affordance)
1352  };
1353  refinement.emplace_back(yy, std::make_shared<HorizontalGroup>(hgroup));
1354  yy += kAffordancesAreaHeight;
1355  }
1356 
1357  auto height = view.GetHeight();
1358  rect.SetTop( yy );
1359  rect.SetHeight( height - kSeparatorThickness );
1360  refinement.emplace_back( yy,
1361  std::make_shared< VRulersAndChannels >(
1362  channel->shared_from_this(),
1363  TrackView::Get( *channel ).GetSubViews( rect ),
1364  mLeftOffset ) );
1365  if ( channel != pLast ) {
1366  yy += height;
1367  refinement.emplace_back(
1368  yy - kSeparatorThickness,
1369  TrackPanelResizerCell::Get( *channel ).shared_from_this() );
1370  }
1371  }
1372 
1373  return { Axis::Y, std::move( refinement ) };
1374  }

References TrackList::Channels(), TrackView::Get(), TrackPanelResizerCell::Get(), TrackView::GetSubViews(), kAffordancesAreaHeight, and kSeparatorThickness.

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

1377  {
1378  TrackPanelGroup::Draw(context, rect, iPass);
1379  if (iPass == TrackArtist::PassFocus && mpTrack->IsSelected())
1380  {
1381  const auto channels = TrackList::Channels(mpTrack.get());
1382  const auto pLast = *channels.rbegin();
1383  wxCoord yy = rect.GetTop();
1384  for (auto channel : channels)
1385  {
1386  auto& view = TrackView::Get(*channel);
1387  auto height = view.GetHeight();
1388  if (auto affordance = view.GetAffordanceControls())
1389  {
1390  height += kAffordancesAreaHeight;
1391  }
1392  auto trackRect = wxRect(
1393  mLeftOffset,
1394  yy,
1395  rect.GetRight() - mLeftOffset,
1396  height - kSeparatorThickness);
1397  TrackArt::DrawCursor(context, trackRect, mpTrack.get());
1398  yy += height;
1399  }
1400  }
1401  }

References TrackList::Channels(), TrackPanelDrawable::Draw(), TrackArt::DrawCursor(), TrackView::Get(), kAffordancesAreaHeight, kSeparatorThickness, 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 1404 of file TrackPanel.cpp.

◆ mpTrack

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

Definition at line 1403 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:1468
kAffordancesAreaHeight
@ kAffordancesAreaHeight
Definition: ViewInfo.h:104
kSeparatorThickness
@ kSeparatorThickness
Definition: ViewInfo.h:108
TrackPanelGroup::Axis::Y
@ Y
TrackArt::DrawCursor
AUDACITY_DLL_API void DrawCursor(TrackPanelDrawingContext &context, const wxRect &rect, const Track *track)
Definition: TrackArtist.cpp:522
anonymous_namespace{TrackPanel.cpp}::ChannelGroup::mpTrack
std::shared_ptr< Track > mpTrack
Definition: TrackPanel.cpp:1403
TrackView::GetSubViews
virtual Refinement GetSubViews(const wxRect &rect)
Definition: TrackView.cpp:116
anonymous_namespace{TrackPanel.cpp}::ChannelGroup::mLeftOffset
wxCoord mLeftOffset
Definition: TrackPanel.cpp:1404
TrackArtist::PassFocus
@ PassFocus
Definition: TrackArtist.h:81
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