mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-08 16:11:14 +02:00
Envelope::Paste takes a time tolerance argument
This commit is contained in:
parent
02fe963d23
commit
58e7a94264
@ -734,7 +734,7 @@ void Envelope::CollapseRegion( double t0, double t1, double sampleDur )
|
||||
// envelope point applies to the first sample, but the t=tracklen
|
||||
// envelope point applies one-past the last actual sample.
|
||||
// Rather than going to a .5-offset-index, we special case the framing.
|
||||
void Envelope::Paste(double t0, const Envelope *e)
|
||||
void Envelope::Paste(double t0, const Envelope *e, double sampleDur)
|
||||
// NOFAIL-GUARANTEE
|
||||
{
|
||||
const bool wasEmpty = (this->mEnv.size() == 0);
|
||||
|
@ -125,7 +125,11 @@ public:
|
||||
// sampleDur determines when the endpoint of the collapse is near enough
|
||||
// to an endpoint of the domain, that an extra control point is not needed.
|
||||
void CollapseRegion(double t0, double t1, double sampleDur);
|
||||
void Paste(double t0, const Envelope *e);
|
||||
|
||||
// Envelope has no notion of rate and control point times are not quantized;
|
||||
// but a tolerance is needed in the Paste routine, and better to inform it
|
||||
// of an appropriate number, than use hidden arbitrary constants.
|
||||
void Paste(double t0, const Envelope *e, double sampleDur);
|
||||
|
||||
void InsertSpace(double t0, double tlen);
|
||||
void RemoveUnneededPoints(double time = -1, double tolerence = 0.001);
|
||||
|
@ -122,7 +122,9 @@ void TimeTrack::Paste(double t, const Track * src)
|
||||
// THROW_INCONSISTENCY_EXCEPTION; // ?
|
||||
return;
|
||||
|
||||
mEnvelope->Paste(t, static_cast<const TimeTrack*>(src)->mEnvelope.get());
|
||||
auto sampleTime = 1.0 / GetActiveProject()->GetRate();
|
||||
mEnvelope->Paste
|
||||
(t, static_cast<const TimeTrack*>(src)->mEnvelope.get(), sampleTime);
|
||||
}
|
||||
|
||||
void TimeTrack::Silence(double t0, double t1)
|
||||
|
@ -1600,7 +1600,9 @@ void WaveClip::Paste(double t0, const WaveClip* other)
|
||||
|
||||
// Assume NOFAIL-GUARANTEE in the remaining
|
||||
MarkChanged();
|
||||
mEnvelope->Paste(s0.as_double()/mRate + mOffset, pastedClip->mEnvelope.get());
|
||||
auto sampleTime = 1.0 / GetRate();
|
||||
mEnvelope->Paste
|
||||
(s0.as_double()/mRate + mOffset, pastedClip->mEnvelope.get(), sampleTime);
|
||||
mEnvelope->RemoveUnneededPoints();
|
||||
OffsetCutLines(t0, pastedClip->GetEndTime() - pastedClip->GetStartTime());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user