1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-07 20:22:13 +01:00

TrackList has back-pointer to project...

... and Track::GetOwner() is publicized, so that now you can find the
the AudacityProject, if any, that owns a given Track; this will help eliminate
some uses of GetActiveProject
This commit is contained in:
Paul Licameli
2019-05-21 11:22:19 -04:00
parent c7984a2c83
commit a93c4472f5
10 changed files with 35 additions and 24 deletions

View File

@@ -204,7 +204,7 @@ auto ProjectFileManager::ReadProjectFile( const FilePath &fileName )
// the version saved on disk will be preserved until the
// user selects Save().
mLastSavedTracks = TrackList::Create();
mLastSavedTracks = TrackList::Create( nullptr );
auto &tracks = TrackList::Get( project );
for (auto t : tracks.Any()) {
@@ -589,7 +589,7 @@ bool ProjectFileManager::DoSave (const bool fromSaveAs,
if (mLastSavedTracks)
mLastSavedTracks->Clear();
mLastSavedTracks = TrackList::Create();
mLastSavedTracks = TrackList::Create( nullptr );
auto &tracks = TrackList::Get( proj );
for ( auto t : tracks.Any() ) {
@@ -643,7 +643,7 @@ bool ProjectFileManager::SaveCopyWaveTracks(const FilePath & strProjectPathName,
// Copy the tracks because we're going to do some state changes before exporting.
unsigned int numWaveTracks = 0;
auto ppSavedTrackList = TrackList::Create();
auto ppSavedTrackList = TrackList::Create( nullptr );
auto &pSavedTrackList = *ppSavedTrackList;
auto trackRange = tracks.Any< WaveTrack >();