1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-15 09:01:12 +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

@@ -1983,7 +1983,7 @@ void Effect::CopyInputTracks(bool allSyncLockSelected)
mIMap.clear();
mOMap.clear();
mOutputTracks = TrackList::Create();
mOutputTracks = TrackList::Create( nullptr );
auto trackRange = mTracks->Any() +
[&] (const Track *pTrack) {
@@ -2271,7 +2271,9 @@ void Effect::Preview(bool dryOnly)
} );
// Build NEW tracklist from rendering tracks
auto uTracks = TrackList::Create();
// Set the same owning project, so FindProject() can see it within Process()
const auto pProject = saveTracks->GetOwner();
auto uTracks = TrackList::Create( pProject );
mTracks = uTracks.get();
// Linear Effect preview optimised by pre-mixing to one track.

View File

@@ -339,7 +339,7 @@ bool EffectEqualization48x::TrackCompare()
SecondIMap.clear();
SecondOMap.clear();
auto pSecondOutputTracks = TrackList::Create();
auto pSecondOutputTracks = TrackList::Create( nullptr );
auto &SecondOutputTracks = *pSecondOutputTracks;
for (auto aTrack :