1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-09 14:16:28 +01:00

TrackList constructed only by factory function, to avoid more trouble

This commit is contained in:
Paul Licameli
2017-07-14 21:47:47 -04:00
parent 84a6bad8a0
commit 8bf3791edf
10 changed files with 42 additions and 42 deletions

View File

@@ -108,7 +108,6 @@ ControlToolBar::ControlToolBar()
mStrLocale = gPrefs->Read(wxT("/Locale/Language"), wxT(""));
mSizer = NULL;
mCutPreviewTracks = NULL;
/* i18n-hint: These are strings for the status bar, and indicate whether Audacity
is playing or recording or stopped, and whether it is paused. */
@@ -928,7 +927,8 @@ void ControlToolBar::OnRecord(wxCommandEvent &evt)
shifted = !shifted;
TrackList *trackList = p->GetTracks();
TrackList tracksCopy{};
auto pTracksCopy = TrackList::Create();
auto &tracksCopy = *pTracksCopy;
bool tracksCopied = false;
WaveTrackArray recordingTracks;
@@ -1280,7 +1280,7 @@ void ControlToolBar::SetupCutPreviewTracks(double WXUNUSED(playStart), double cu
// use NOTHROW-GUARANTEE:
mCutPreviewTracks = std::make_unique<TrackList>();
mCutPreviewTracks = TrackList::Create();
mCutPreviewTracks->Add(std::move(new1));
if (track2)
mCutPreviewTracks->Add(std::move(new2));

View File

@@ -161,7 +161,7 @@ class ControlToolBar final : public ToolBar {
wxBoxSizer *mSizer;
std::unique_ptr<TrackList> mCutPreviewTracks;
std::shared_ptr<TrackList> mCutPreviewTracks;
// strings for status bar
wxString mStatePlay;