Audacity  3.0.3
Public Member Functions | Public Attributes | List of all members
IsVisibleTrack Struct Reference

#include <TrackPanel.h>

Public Member Functions

 IsVisibleTrack (AudacityProject *project)
 
bool operator() (const Track *pTrack) const
 

Public Attributes

wxRect mPanelRect
 

Detailed Description

Definition at line 216 of file TrackPanel.h.

Constructor & Destructor Documentation

◆ IsVisibleTrack()

IsVisibleTrack::IsVisibleTrack ( AudacityProject project)

Definition at line 1626 of file TrackPanel.cpp.

1627  : mPanelRect {
1628  wxPoint{ 0, ViewInfo::Get( *project ).vpos },
1629  wxSize{
1630  ViewInfo::Get( *project ).GetTracksUsableWidth(),
1631  ViewInfo::Get( *project ).GetHeight()
1632  }
1633  }
1634 {}

References ViewInfo::Get(), ViewInfo::GetHeight(), ZoomInfo::GetTracksUsableWidth(), and ZoomInfo::vpos.

Here is the call graph for this function:

Member Function Documentation

◆ operator()()

bool IsVisibleTrack::operator() ( const Track pTrack) const

Definition at line 1636 of file TrackPanel.cpp.

1637 {
1638  // Need to return true if this track or a later channel intersects
1639  // the view
1640  return
1641  TrackList::Channels(pTrack).StartingWith(pTrack).any_of(
1642  [this]( const Track *pT ) {
1643  auto &view = TrackView::Get( *pT );
1644  wxRect r(0, view.GetY(), 1, view.GetHeight());
1645  return r.Intersects(mPanelRect);
1646  }
1647  );
1648 }

References TrackList::Channels(), TrackView::Get(), and mPanelRect.

Here is the call graph for this function:

Member Data Documentation

◆ mPanelRect

wxRect IsVisibleTrack::mPanelRect

Definition at line 222 of file TrackPanel.h.

Referenced by operator()().


The documentation for this struct was generated from the following files:
ZoomInfo::vpos
int vpos
Definition: ZoomInfo.h:58
ViewInfo::Get
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:156
TrackView::Get
static TrackView & Get(Track &)
Definition: TrackView.cpp:63
TrackList::Channels
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1468
IsVisibleTrack::mPanelRect
wxRect mPanelRect
Definition: TrackPanel.h:222
Track
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:239
ZoomInfo::GetTracksUsableWidth
int GetTracksUsableWidth() const
Definition: ZoomInfo.h:104
ViewInfo::GetHeight
int GetHeight() const
Definition: ViewInfo.h:182