1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-13 14:13:32 +02:00

Performance improvements for track spectrum display and PCM

import submitted by Sami Liedes.
This commit is contained in:
BusinessmanProgrammerSteve
2010-09-13 01:31:54 +00:00
parent 1d6e1593ee
commit c0b5fb01da
6 changed files with 101 additions and 67 deletions

View File

@@ -253,7 +253,8 @@ int PCMImportFileHandle::Import(TrackFactory *trackFactory,
// lets use OD only if the file is longer than 30 seconds. Otherwise, why wake up extra threads.
//todo: make this a user pref.
bool useOD =fileTotalFrames>kMinimumODFileSampleSize;
int updateCounter = 0;
for (sampleCount i = 0; i < fileTotalFrames; i += maxBlockSize) {
sampleCount blockLen = maxBlockSize;
@@ -263,10 +264,14 @@ int PCMImportFileHandle::Import(TrackFactory *trackFactory,
for (c = 0; c < mInfo.channels; c++)
channels[c]->AppendAlias(mFilename, i, blockLen, c,useOD);
updateResult = mProgress->Update(i, fileTotalFrames);
if (updateResult != eProgressSuccess)
break;
if (++updateCounter == 50) {
updateResult = mProgress->Update(i, fileTotalFrames);
updateCounter = 0;
if (updateResult != eProgressSuccess)
break;
}
}
updateResult = mProgress->Update(fileTotalFrames, fileTotalFrames);
//now go over the wavetrack/waveclip/sequence and load all the blockfiles into a ComputeSummaryTask.
//Add this task to the ODManager and the Track itself.