1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-17 16:11:11 +02:00

Rewrite many iterations over tracks and channels in various places

This commit is contained in:
Paul Licameli
2018-09-18 12:03:37 -04:00
parent fee0f284fe
commit 968d63d5fd
14 changed files with 137 additions and 267 deletions

View File

@@ -173,29 +173,21 @@ void ODTask::DoSome(float amountWork)
bool ODTask::IsTaskAssociatedWithProject(AudacityProject* proj)
{
TrackList *tracks = proj->GetTracks();
TrackListIterator iter1(tracks);
Track *tr = iter1.First();
while (tr)
for (auto tr : proj->GetTracks()->Any<const WaveTrack>())
{
//go over all tracks in the project
if (tr->GetKind() == Track::Wave)
//look inside our task's track list for one that matches this projects one.
mWaveTrackMutex.Lock();
for(int i=0;i<(int)mWaveTracks.size();i++)
{
//look inside our task's track list for one that matches this projects one.
mWaveTrackMutex.Lock();
for(int i=0;i<(int)mWaveTracks.size();i++)
if(mWaveTracks[i]==tr)
{
if(mWaveTracks[i]==tr)
{
//if we find one, then the project is associated with us;return true
mWaveTrackMutex.Unlock();
return true;
}
//if we find one, then the project is associated with us;return true
mWaveTrackMutex.Unlock();
return true;
}
mWaveTrackMutex.Unlock();
}
tr = iter1.Next();
mWaveTrackMutex.Unlock();
}
return false;