1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-01 16:19:43 +02:00

Define WaveTrackView::GetAllSubViews

This commit is contained in:
Paul Licameli 2019-07-10 11:00:32 -04:00
parent d6317ae6af
commit dd369da6a0
2 changed files with 16 additions and 0 deletions

View File

@ -181,6 +181,17 @@ auto WaveTrackView::GetSubViews( const wxRect &rect ) -> Refinement
return results;
}
std::vector< std::shared_ptr< WaveTrackSubView > >
WaveTrackView::GetAllSubViews()
{
std::vector< std::shared_ptr< WaveTrackSubView > > results;
WaveTrackSubViews::ForEach( [&]( WaveTrackSubView &subView ){
results.push_back( std::static_pointer_cast<WaveTrackSubView>(
subView.shared_from_this() ) );
} );
return results;
}
void WaveTrackView::DoSetMinimized( bool minimized )
{
// May come here. Invoke also on sub-views.

View File

@ -77,6 +77,10 @@ public:
void RestorePlacements( const WaveTrackSubViewPlacements &placements )
{ mPlacements = placements; }
// Get all the sub-views, in a sequence that is unspecified but in
// correspondence with the result of SavePlacements
std::vector< std::shared_ptr< WaveTrackSubView > > GetAllSubViews();
private:
// TrackPanelDrawable implementation
void Draw(
@ -89,6 +93,7 @@ private:
override;
// TrackView implementation
// Get the visible sub-views with top y coordinates
Refinement GetSubViews( const wxRect &rect ) override;
protected: