1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-02 08:39:46 +02:00

Remove the TrackPanelFactory...

... It was part of an attempt at decoupling that will be superseded by other
techniques
This commit is contained in:
Paul Licameli 2019-05-05 12:37:31 -04:00
parent ada9f2baad
commit 735860c856
3 changed files with 2 additions and 47 deletions

View File

@ -1281,9 +1281,8 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
}
bs->Layout();
// The right hand side translates to NEW TrackPanel(...) in normal
// Audacity without additional DLLs.
mTrackPanel = TrackPanel::FactoryFunction(pPage,
wxASSERT( pPage ); // to justify safenew
mTrackPanel = safenew TrackPanel(pPage,
TrackPanelID,
wxDefaultPosition,
wxDefaultSize,

View File

@ -2772,40 +2772,6 @@ void TrackInfo::UpdatePrefs( wxWindow *pParent )
} while (textWidth >= allowableWidth);
}
static TrackPanel * TrackPanelFactory(wxWindow * parent,
wxWindowID id,
const wxPoint & pos,
const wxSize & size,
const std::shared_ptr<TrackList> &tracks,
ViewInfo * viewInfo,
TrackPanelListener * listener,
AdornedRulerPanel * ruler)
{
wxASSERT(parent); // to justify safenew
return safenew TrackPanel(
parent,
id,
pos,
size,
tracks,
viewInfo,
listener,
ruler);
}
// Declare the static factory function.
// We defined it in the class.
TrackPanel *(*TrackPanel::FactoryFunction)(
wxWindow * parent,
wxWindowID id,
const wxPoint & pos,
const wxSize & size,
const std::shared_ptr<TrackList> &tracks,
ViewInfo * viewInfo,
TrackPanelListener * listener,
AdornedRulerPanel * ruler) = TrackPanelFactory;
TrackPanelNode::TrackPanelNode()
{
}

View File

@ -370,16 +370,6 @@ public:
ViewInfo * GetViewInfo(){ return mViewInfo;}
TrackPanelListener * GetListener(){ return mListener;}
AdornedRulerPanel * GetRuler(){ return mRuler;}
// JKC and here is a factory function which just does 'NEW' in standard Audacity.
// Precondition: parent != NULL
static TrackPanel *(*FactoryFunction)(wxWindow * parent,
wxWindowID id,
const wxPoint & pos,
const wxSize & size,
const std::shared_ptr<TrackList> &tracks,
ViewInfo * viewInfo,
TrackPanelListener * listener,
AdornedRulerPanel * ruler);
protected:
void DrawTracks(wxDC * dc);