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

Track factory cleanup (#646)

* Don't need TrackFactory to make LabelTrack

* Don't need TrackFactory to make NoteTrack

* Don't need TrackFactory to make TimeTrack, or ZoomInfo in the factory

* Remove some forward declarations

* Rename TrackFactory as WaveTrackFactory, move it out of Track.cpp
This commit is contained in:
Paul Licameli
2020-08-22 19:44:49 -04:00
committed by GitHub
parent 0f98522b5c
commit 4ca3e7096f
42 changed files with 158 additions and 198 deletions

View File

@@ -95,7 +95,6 @@ END_EVENT_TABLE()
LabelDialog::LabelDialog(wxWindow *parent,
AudacityProject &project,
TrackFactory &factory,
TrackList *tracks,
LabelTrack *selectedTrack,
int index,
@@ -110,7 +109,6 @@ LabelDialog::LabelDialog(wxWindow *parent,
wxSize(800, 600),
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
, mProject{ project }
, mFactory(factory)
, mTracks(tracks)
, mSelectedTrack(selectedTrack)
, mIndex(index)
@@ -402,7 +400,7 @@ bool LabelDialog::TransferDataFromWindow()
wxString name = mTrackNames[tndx + 1].AfterFirst(wxT('-')).Mid(1);
// Create the NEW track and add to track list
auto newTrack = mFactory.NewLabelTrack();
auto newTrack = std::make_shared<LabelTrack>();
newTrack->SetName(name);
mTracks->Add( newTrack );
tndx++;
@@ -654,7 +652,7 @@ void LabelDialog::OnImport(wxCommandEvent & WXUNUSED(event))
else {
// Create a temporary label track and load the labels
// into it
auto lt = mFactory.NewLabelTrack();
auto lt = std::make_shared<LabelTrack>();
lt->Import(f);
// Add the labels to our collection
@@ -723,7 +721,7 @@ void LabelDialog::OnExport(wxCommandEvent & WXUNUSED(event))
}
// Transfer our collection to a temporary label track
auto lt = mFactory.NewLabelTrack();
auto lt = std::make_shared<LabelTrack>();
int i;
for (i = 0; i < cnt; i++) {