1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-28 14:18:41 +02:00

WaveTrack::SplitAt no longer needs to insert envelope points...

... because partial-copy construction of the new WaveClip, and CollapseRegion
within WaveClip::Clear, handle it.
This commit is contained in:
Paul Licameli 2017-05-04 14:07:23 -04:00
parent aba52bc79e
commit 8c4dc38047

View File

@ -2379,12 +2379,6 @@ void WaveTrack::SplitAt(double t)
{
double val;
t = LongSamplesToTime(TimeToLongSamples(t)); // put t on a sample
val = c->GetEnvelope()->GetValue(t);
//make two envelope points to preserve the value.
//handle the case where we split on the 1st sample (without this we hit an assert)
if(t - 1.0/c->GetRate() >= c->GetOffset())
c->GetEnvelope()->InsertOrReplace(t - 1.0 / c->GetRate(), val); // frame end points
c->GetEnvelope()->InsertOrReplace(t, val);
auto newClip = make_movable<WaveClip>( *c, mDirManager, true );
c->Clear(t, c->GetEndTime());
newClip->Clear(c->GetStartTime(), t);