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

Free TrackControls and TrackSelectHandle from cycles, to high levels

This commit is contained in:
Paul Licameli 2019-06-05 09:50:45 -04:00
parent d4b44d16f1
commit e969315c90
9 changed files with 7 additions and 14 deletions

View File

@ -287,8 +287,8 @@ class AUDACITY_DLL_API Track /* not final */
// Return another, associated TrackPanelCell object that implements the
// drop-down, close and minimize buttons, etc.
std::shared_ptr<TrackControls> GetTrackControl();
std::shared_ptr<const TrackControls> GetTrackControl() const;
std::shared_ptr<TrackPanelCell> GetTrackControl();
std::shared_ptr<const TrackPanelCell> GetTrackControl() const;
// Return another, associated TrackPanelCell object that implements the
// mouse actions for the vertical ruler

View File

@ -99,7 +99,6 @@ is time to refresh some aspect of the screen.
#include "toolbars/ControlToolBar.h"
#include "toolbars/ToolsToolBar.h"
#include "tracks/ui/TrackControls.h" // for inheritance relation
#include "tracks/ui/TrackVRulerControls.h" // for inheritance relation
//This loads the appropriate set of cursors, depending on platform.
@ -1283,9 +1282,6 @@ void TrackPanel::DrawEverythingElse(TrackPanelDrawingContext &context,
target->DrawExtras(UIHandle::Panel, dc, region, clip);
}
// Make this #include go away!
#include "tracks/ui/TrackControls.h"
void TrackInfo::DrawItems
( TrackPanelDrawingContext &context,
const wxRect &rect, const Track &track )

View File

@ -19,7 +19,6 @@ Paul Licameli split from TrackPanel.cpp
#include "RefreshCode.h"
#include "Track.h"
#include "TrackPanelMouseEvent.h"
#include "tracks/ui/TrackControls.h"
HitTestPreview TrackPanelResizeHandle::HitPreview(bool bLinked)
{

View File

@ -15,7 +15,6 @@ Paul Licameli
#include "../../RefreshCode.h"
#include "../../Track.h"
#include "../../TrackPanelMouseEvent.h"
#include "../ui/TrackControls.h"
ButtonHandle::ButtonHandle
( const std::shared_ptr<Track> &pTrack, const wxRect &rect )

View File

@ -14,7 +14,6 @@ Paul Licameli split from TrackPanel.cpp
#include "../../Experimental.h"
#include "Scrubbing.h"
#include "TrackControls.h"
#include "../../AColor.h"
#include "../../FreqWindow.h"

View File

@ -13,7 +13,6 @@ Paul Licameli split from TrackPanel.cpp
#include "../../Experimental.h"
#include "TrackControls.h"
#include "../../AColor.h"
#include "../../HitTestResult.h"
#include "../../NoteTrack.h"

View File

@ -55,7 +55,9 @@ std::vector<UIHandlePtr> TrackControls::HitTest
auto pTrack = FindTrack();
// shared pointer to this:
auto sThis = pTrack->GetTrackControl();
auto sThis =
std::static_pointer_cast<TrackControls>( pTrack->GetTrackControl() );
wxASSERT( this == sThis.get() );
if (NULL != (result = CloseButtonHandle::HitTest(
mCloseHandle, state, rect, this)))

View File

@ -11,7 +11,6 @@ Paul Licameli split from TrackPanel.cpp
#include "../../Audacity.h"
#include "TrackSelectHandle.h"
#include "TrackControls.h"
#include "../../Menus.h"
#include "../../Project.h"
#include "../../ProjectAudioIO.h"

View File

@ -83,7 +83,7 @@ std::shared_ptr<TrackPanelCell> Track::ContextMenuDelegate()
return FindTrack()->GetTrackControl();
}
std::shared_ptr<TrackControls> Track::GetTrackControl()
std::shared_ptr<TrackPanelCell> Track::GetTrackControl()
{
if (!mpControls)
// create on demand
@ -91,7 +91,7 @@ std::shared_ptr<TrackControls> Track::GetTrackControl()
return mpControls;
}
std::shared_ptr<const TrackControls> Track::GetTrackControl() const
std::shared_ptr<const TrackPanelCell> Track::GetTrackControl() const
{
return const_cast< Track* >( this )->GetTrackControl();
}