mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 16:10:06 +02:00
Replace uses of TrackPanel::Cells() with CellularPanel::VisitCells()
This commit is contained in:
parent
01551913f0
commit
005abb06d6
@ -33,7 +33,6 @@
|
||||
#include "RefreshCode.h"
|
||||
#include "Snap.h"
|
||||
#include "TrackPanel.h"
|
||||
#include "TrackPanelCellIterator.h"
|
||||
#include "TrackPanelMouseEvent.h"
|
||||
#include "UIHandle.h"
|
||||
#include "prefs/TracksBehaviorsPrefs.h"
|
||||
@ -328,12 +327,11 @@ void AdornedRulerPanel::QuickPlayIndicatorOverlay::Draw(
|
||||
;
|
||||
|
||||
// Draw indicator in all visible tracks
|
||||
for ( const auto &data : static_cast<TrackPanel&>(panel).Cells() )
|
||||
{
|
||||
Track *const pTrack = dynamic_cast<Track*>(data.first.get());
|
||||
static_cast<TrackPanel&>(panel)
|
||||
.VisitCells( [&]( const wxRect &rect, TrackPanelCell &cell ) {
|
||||
const auto pTrack = dynamic_cast<Track*>(&cell);
|
||||
if (!pTrack)
|
||||
continue;
|
||||
const wxRect &rect = data.second;
|
||||
return;
|
||||
|
||||
// Draw the NEW indicator in its NEW location
|
||||
AColor::Line(dc,
|
||||
@ -341,7 +339,7 @@ void AdornedRulerPanel::QuickPlayIndicatorOverlay::Draw(
|
||||
rect.GetTop(),
|
||||
mOldQPIndicatorPos,
|
||||
rect.GetBottom());
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,6 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "UIHandle.h"
|
||||
|
||||
class Track;
|
||||
class TrackPanelCellIterator;
|
||||
|
||||
class TrackPanelResizeHandle final : public UIHandle
|
||||
{
|
||||
|
@ -29,7 +29,6 @@ public:
|
||||
|
||||
std::shared_ptr<Track> FindTrack() override { return mpTrack.lock(); };
|
||||
private:
|
||||
friend class TrackPanelCellIterator;
|
||||
std::weak_ptr<Track> mpTrack;
|
||||
|
||||
std::weak_ptr<TrackPanelResizeHandle> mResizeHandle;
|
||||
|
@ -15,8 +15,6 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../AColor.h"
|
||||
#include "../../AdornedRulerPanel.h"
|
||||
#include "../../Project.h"
|
||||
#include "../../TrackPanelCell.h"
|
||||
#include "../../TrackPanelCellIterator.h"
|
||||
#include "../../TrackPanelAx.h"
|
||||
#include "../../ViewInfo.h"
|
||||
|
||||
@ -100,21 +98,19 @@ void EditCursorOverlay::Draw(OverlayPanel &panel, wxDC &dc)
|
||||
AColor::CursorColor(&dc);
|
||||
|
||||
// Draw cursor in all selected tracks
|
||||
for ( const auto &data : tp->Cells() )
|
||||
{
|
||||
Track *const pTrack = dynamic_cast<Track*>(data.first.get());
|
||||
tp->VisitCells( [&]( const wxRect &rect, TrackPanelCell &cell ) {
|
||||
const auto pTrack = dynamic_cast<Track*>(&cell);
|
||||
if (!pTrack)
|
||||
continue;
|
||||
return;
|
||||
if (pTrack->GetSelected() ||
|
||||
mProject->GetTrackPanel()->GetAx().IsFocused(pTrack))
|
||||
{
|
||||
const wxRect &rect = data.second;
|
||||
// AColor::Line includes both endpoints so use GetBottom()
|
||||
AColor::Line(dc, mLastCursorX, rect.GetTop(), mLastCursorX, rect.GetBottom());
|
||||
// ^^^ The whole point of this routine.
|
||||
|
||||
}
|
||||
}
|
||||
} );
|
||||
}
|
||||
else if (auto ruler = dynamic_cast<AdornedRulerPanel*>(&panel)) {
|
||||
wxASSERT(!mIsMaster);
|
||||
|
@ -16,8 +16,6 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../AudioIO.h"
|
||||
#include "../../Project.h"
|
||||
#include "../../TrackPanel.h"
|
||||
#include "../../TrackPanelCell.h"
|
||||
#include "../../TrackPanelCellIterator.h"
|
||||
#include "Scrubbing.h"
|
||||
|
||||
#include <wx/dc.h>
|
||||
@ -82,9 +80,8 @@ void PlayIndicatorOverlayBase::Draw(OverlayPanel &panel, wxDC &dc)
|
||||
wxASSERT(mIsMaster);
|
||||
|
||||
// Draw indicator in all visible tracks
|
||||
for ( const auto &data : tp->Cells() )
|
||||
{
|
||||
Track *const pTrack = dynamic_cast<Track*>(data.first.get());
|
||||
tp->VisitCells( [&]( const wxRect &rect, TrackPanelCell &cell ) {
|
||||
const auto pTrack = dynamic_cast<Track*>(&cell);
|
||||
if (pTrack) pTrack->TypeSwitch(
|
||||
[](LabelTrack *) {
|
||||
// Don't draw the indicator in label tracks
|
||||
@ -92,7 +89,6 @@ void PlayIndicatorOverlayBase::Draw(OverlayPanel &panel, wxDC &dc)
|
||||
[&](Track *) {
|
||||
// Draw the NEW indicator in its NEW location
|
||||
// AColor::Line includes both endpoints so use GetBottom()
|
||||
const wxRect &rect = data.second;
|
||||
AColor::Line(dc,
|
||||
mLastIndicatorX,
|
||||
rect.GetTop(),
|
||||
@ -100,7 +96,7 @@ void PlayIndicatorOverlayBase::Draw(OverlayPanel &panel, wxDC &dc)
|
||||
rect.GetBottom());
|
||||
}
|
||||
);
|
||||
}
|
||||
} );
|
||||
}
|
||||
else if(auto ruler = dynamic_cast<AdornedRulerPanel*>(&panel)) {
|
||||
wxASSERT(!mIsMaster);
|
||||
|
Loading…
x
Reference in New Issue
Block a user