Bug 1686 - Equalization effects ignore and remove any amplitude envelope

This commit is contained in:
Leland Lucius 2020-08-09 03:07:41 -05:00
parent 238bb952ef
commit 58adb94747
1 changed files with 15 additions and 0 deletions

View File

@ -1373,6 +1373,8 @@ bool EffectEqualization::ProcessOne(int count, WaveTrack * t,
output->Append((samplePtr)buffer.get(), floatSample, mM - 1);
output->Flush();
std::vector<EnvPoint> envPoints;
// now move the appropriate bit of the output back to the track
// (this could be enhanced in the future to use the tails)
double offsetT0 = t->LongSamplesToTime(offset);
@ -1412,7 +1414,14 @@ bool EffectEqualization::ProcessOne(int count, WaveTrack * t,
//save them
clipStartEndTimes.push_back(std::pair<double,double>(clipStartT,clipEndT));
// Save the envelope points
const auto &env = *clip->GetEnvelope();
for (size_t i = 0, numPoints = env.GetNumberOfPoints(); i < numPoints; ++i) {
envPoints.push_back(env[i]);
}
}
//now go thru and replace the old clips with NEW
for(unsigned int i = 0; i < clipStartEndTimes.size(); i++)
{
@ -1429,6 +1438,12 @@ bool EffectEqualization::ProcessOne(int count, WaveTrack * t,
clipRealStartEndTimes[i].second >= startT+lenT) )
t->Join(clipRealStartEndTimes[i].first,clipRealStartEndTimes[i].second);
}
// Restore the envelope points
for (auto point : envPoints) {
WaveClip *clip = t->GetClipAtTime(point.GetT());
clip->GetEnvelope()->Insert(point.GetT(), point.GetVal());
}
}
return bLoopSuccess;