1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-14 17:14:07 +01:00

Simplify iterations over TrackPanelCells with range-for

This commit is contained in:
Paul Licameli
2017-06-16 22:57:08 -04:00
parent f94ac4dc43
commit ffbc4d5f90
6 changed files with 14 additions and 16 deletions

View File

@@ -102,13 +102,10 @@ void EditCursorOverlay::Draw(OverlayPanel &panel, wxDC &dc)
if (auto tp = dynamic_cast<TrackPanel*>(&panel)) {
wxASSERT(mIsMaster);
AColor::CursorColor(&dc);
TrackPanelCellIterator begin(tp, true);
TrackPanelCellIterator end(tp, false);
// Draw cursor in all selected tracks
for (; begin != end; ++begin)
for ( const auto &data : tp->Cells() )
{
TrackPanelCellIterator::value_type data(*begin);
Track *const pTrack = dynamic_cast<Track*>(data.first);
if (!pTrack)
continue;

View File

@@ -69,13 +69,9 @@ void PlayIndicatorOverlayBase::Draw(OverlayPanel &panel, wxDC &dc)
if(auto tp = dynamic_cast<TrackPanel*>(&panel)) {
wxASSERT(mIsMaster);
TrackPanelCellIterator begin(tp, true);
TrackPanelCellIterator end(tp, false);
// Draw indicator in all visible tracks
for (; begin != end; ++begin)
for ( const auto &data : tp->Cells() )
{
TrackPanelCellIterator::value_type data(*begin);
Track *const pTrack = dynamic_cast<Track*>(data.first);
if (!pTrack)
continue;

View File

@@ -17,7 +17,6 @@ Paul Licameli split from TrackPanel.cpp
#include "../../Project.h"
#include "../../TrackPanel.h"
#include "../../TrackPanelCell.h"
#include "../../TrackPanelCellIterator.h"
#include "../../commands/CommandFunctors.h"
#include "../../prefs/TracksPrefs.h"
#include "../../toolbars/ControlToolBar.h"