1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-03 22:19:07 +02:00

Fix Bug 489 (P2) - Read Directly uncompressed audio produces incorrect Normalize in Chains. Wait until OD is finished before starting analysis.

This commit is contained in:
mchinen 2012-05-23 23:02:25 +00:00
parent 5036316758
commit a6d9f24804

View File

@ -261,17 +261,27 @@ bool EffectNormalize::Process()
void EffectNormalize::AnalyseTrack(WaveTrack * track, wxString msg) void EffectNormalize::AnalyseTrack(WaveTrack * track, wxString msg)
{ {
if(mGain) if(mGain) {
track->GetMinMax(&mMin, &mMax, mCurT0, mCurT1); // set mMin, mMax. No progress bar here as it's fast. // Since we need complete summary data, we need to block until the OD tasks are done for this track
else // TODO: should we restrict the flags to just the relevant block files (for selections)
mMin = -1.0, mMax = 1.0; // sensible defaults? while (track->GetODFlags()) {
if(mDC) { // update the gui
AnalyseDC(track, msg); // sets mOffset mProgress->Update(0, wxT("Waiting for waveform to finish computing..."));
mMin += mOffset; wxMilliSleep(100);
mMax += mOffset; }
}
else track->GetMinMax(&mMin, &mMax, mCurT0, mCurT1); // set mMin, mMax. No progress bar here as it's fast.
mOffset = 0.0; } else {
mMin = -1.0, mMax = 1.0; // sensible defaults?
}
if(mDC) {
AnalyseDC(track, msg); // sets mOffset
mMin += mOffset;
mMax += mOffset;
} else {
mOffset = 0.0;
}
} }
//AnalyseDC() takes a track, transforms it to bunch of buffer-blocks, //AnalyseDC() takes a track, transforms it to bunch of buffer-blocks,