mirror of
https://github.com/cookiengineer/audacity
synced 2026-02-04 10:43:08 +01:00
AdornedRulerPanel does not depend on TrackPanel...
... but it does assume that GetProjectPanel returns a CellularPanel
This commit is contained in:
@@ -29,6 +29,8 @@
|
|||||||
#include "AColor.h"
|
#include "AColor.h"
|
||||||
#include "AllThemeResources.h"
|
#include "AllThemeResources.h"
|
||||||
#include "AudioIO.h"
|
#include "AudioIO.h"
|
||||||
|
#include "CellularPanel.h"
|
||||||
|
#include "HitTestResult.h"
|
||||||
#include "Menus.h"
|
#include "Menus.h"
|
||||||
#include "Prefs.h"
|
#include "Prefs.h"
|
||||||
#include "Project.h"
|
#include "Project.h"
|
||||||
@@ -39,7 +41,6 @@
|
|||||||
#include "RefreshCode.h"
|
#include "RefreshCode.h"
|
||||||
#include "Snap.h"
|
#include "Snap.h"
|
||||||
#include "Track.h"
|
#include "Track.h"
|
||||||
#include "TrackPanel.h"
|
|
||||||
#include "TrackPanelMouseEvent.h"
|
#include "TrackPanelMouseEvent.h"
|
||||||
#include "UIHandle.h"
|
#include "UIHandle.h"
|
||||||
#include "ViewInfo.h"
|
#include "ViewInfo.h"
|
||||||
@@ -337,8 +338,13 @@ void AdornedRulerPanel::QuickPlayIndicatorOverlay::Draw(
|
|||||||
;
|
;
|
||||||
|
|
||||||
// Draw indicator in all visible tracks
|
// Draw indicator in all visible tracks
|
||||||
static_cast<TrackPanel&>(panel)
|
auto pCellularPanel = dynamic_cast<CellularPanel*>( &panel );
|
||||||
.VisitCells( [&]( const wxRect &rect, TrackPanelCell &cell ) {
|
if ( !pCellularPanel ) {
|
||||||
|
wxASSERT( false );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
pCellularPanel
|
||||||
|
->VisitCells( [&]( const wxRect &rect, TrackPanelCell &cell ) {
|
||||||
const auto pTrackView = dynamic_cast<TrackView*>(&cell);
|
const auto pTrackView = dynamic_cast<TrackView*>(&cell);
|
||||||
if (!pTrackView)
|
if (!pTrackView)
|
||||||
return;
|
return;
|
||||||
@@ -1663,7 +1669,13 @@ void AdornedRulerPanel::SetPanelSize()
|
|||||||
|
|
||||||
void AdornedRulerPanel::DrawBothOverlays()
|
void AdornedRulerPanel::DrawBothOverlays()
|
||||||
{
|
{
|
||||||
TrackPanel::Get( *mProject ).DrawOverlays( false );
|
auto pCellularPanel =
|
||||||
|
dynamic_cast<CellularPanel*>( &GetProjectPanel( *GetProject() ) );
|
||||||
|
if ( !pCellularPanel ) {
|
||||||
|
wxASSERT( false );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
pCellularPanel->DrawOverlays( false );
|
||||||
DrawOverlays( false );
|
DrawOverlays( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2214,7 +2226,13 @@ void AdornedRulerPanel::CreateOverlays()
|
|||||||
if (!mOverlay) {
|
if (!mOverlay) {
|
||||||
mOverlay =
|
mOverlay =
|
||||||
std::make_shared<QuickPlayIndicatorOverlay>( mProject );
|
std::make_shared<QuickPlayIndicatorOverlay>( mProject );
|
||||||
TrackPanel::Get( *mProject ).AddOverlay( mOverlay );
|
auto pCellularPanel =
|
||||||
|
dynamic_cast<CellularPanel*>( &GetProjectPanel( *GetProject() ) );
|
||||||
|
if ( !pCellularPanel ) {
|
||||||
|
wxASSERT( false );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
pCellularPanel->AddOverlay( mOverlay );
|
||||||
this->AddOverlay( mOverlay->mPartner );
|
this->AddOverlay( mOverlay->mPartner );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user