mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 16:10:06 +02:00
Bug 208 - Some effects (including equalization effects) delete Envelope Control Points, or do not move them when timeline change
This commit is contained in:
parent
f09f03e44b
commit
c13a074cb2
@ -736,6 +736,7 @@ void WaveTrack::ClearAndPaste(double t0, // Start of time to clear
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<EnvPoint> envPoints;
|
||||||
std::vector<double> splits;
|
std::vector<double> splits;
|
||||||
WaveClipHolders cuts;
|
WaveClipHolders cuts;
|
||||||
|
|
||||||
@ -783,6 +784,12 @@ void WaveTrack::ClearAndPaste(double t0, // Start of time to clear
|
|||||||
else
|
else
|
||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto tolerance = 2.0 / GetRate();
|
const auto tolerance = 2.0 / GetRate();
|
||||||
@ -790,7 +797,6 @@ void WaveTrack::ClearAndPaste(double t0, // Start of time to clear
|
|||||||
// Now, clear the selection
|
// Now, clear the selection
|
||||||
HandleClear(t0, t1, false, false);
|
HandleClear(t0, t1, false, false);
|
||||||
{
|
{
|
||||||
|
|
||||||
// And paste in the NEW data
|
// And paste in the NEW data
|
||||||
Paste(t0, src);
|
Paste(t0, src);
|
||||||
{
|
{
|
||||||
@ -878,6 +884,13 @@ void WaveTrack::ClearAndPaste(double t0, // Start of time to clear
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Restore the envelope points
|
||||||
|
for (auto point : envPoints) {
|
||||||
|
auto t = warper->Warp(point.GetT());
|
||||||
|
WaveClip *clip = GetClipAtTime(t);
|
||||||
|
clip->GetEnvelope()->Insert(t, point.GetVal());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user