1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-22 16:41:18 +01:00
v.audacity
2011-11-16 05:59:48 +00:00
parent 618df78900
commit 59db8d4ad4
21 changed files with 77 additions and 81 deletions

View File

@@ -576,7 +576,7 @@ bool WaveTrack::ClearAndPaste(double t0, // Start of time to clear
// falls within it and this isn't the first clip in the track.
if (fabs(t1 - clip->GetStartTime()) < WAVETRACK_MERGE_POINT_TOLERANCE) {
if (i > 0) {
MergeClips(GetClipIndex(clips[i - 1]), GetClipIndex(clip));
wxASSERT(MergeClips(GetClipIndex(clips[i - 1]), GetClipIndex(clip)));
}
break;
}
@@ -594,7 +594,7 @@ bool WaveTrack::ClearAndPaste(double t0, // Start of time to clear
// falls within it and this isn't the last clip in the track.
if (fabs(t0 - clip->GetEndTime()) < WAVETRACK_MERGE_POINT_TOLERANCE) {
if (i < clips.GetCount() - 1) {
MergeClips(GetClipIndex(clip), GetClipIndex(clips[i + 1]));
wxASSERT(MergeClips(GetClipIndex(clip), GetClipIndex(clips[i + 1])));
}
break;
}
@@ -638,8 +638,7 @@ bool WaveTrack::ClearAndPaste(double t0, // Start of time to clear
}
// If we created a default time warper, we need to delete it
if (effectWarper == NULL)
delete warper;
delete warper;
return true;
}
@@ -814,6 +813,7 @@ bool WaveTrack::SyncLockAdjust(double oldT1, double newT1)
if (!ret) return false;
ret = Paste(newT1, tmp);
wxASSERT(ret);
delete tmp;
}
@@ -828,9 +828,9 @@ bool WaveTrack::SyncLockAdjust(double oldT1, double newT1)
if (!f) return false;
WaveTrack *tmp = f->NewWaveTrack(GetSampleFormat(), GetRate());
tmp->InsertSilence(0.0, newT1 - oldT1);
wxASSERT(tmp->InsertSilence(0.0, newT1 - oldT1));
tmp->Flush();
Paste(oldT1, tmp);
wxASSERT(Paste(oldT1, tmp));
delete tmp;
}
}
@@ -846,18 +846,13 @@ bool WaveTrack::Paste(double t0, Track *src)
{
bool editClipCanMove = true;
gPrefs->Read(wxT("/GUI/EditClipCanMove"), &editClipCanMove);
//printf("paste: entering WaveTrack::Paste\n");
// JKC Added...
if( src == NULL )
return false;
if (src->GetKind() != Track::Wave)
return false;
//printf("paste: we have a wave track\n");
WaveTrack* other = (WaveTrack*)src;
//
@@ -902,7 +897,7 @@ bool WaveTrack::Paste(double t0, Track *src)
if (!IsEmpty(t0, GetEndTime())) {
Track *tmp = NULL;
Cut(t0, GetEndTime()+1.0/mRate, &tmp);
Paste(t0 + insertDuration, tmp);
wxASSERT(Paste(t0 + insertDuration, tmp));
delete tmp;
}
} else
@@ -1206,12 +1201,12 @@ bool WaveTrack::Join(double t0, double t1)
if (clip->GetOffset() - t > (1.0 / mRate)) {
double addedSilence = (clip->GetOffset() - t);
//printf("Adding %.6f seconds of silence\n");
newClip->InsertSilence(t, addedSilence);
wxASSERT(newClip->InsertSilence(t, addedSilence));
t += addedSilence;
}
//printf("Pasting at %.6f\n", t);
newClip->Paste(t, clip);
wxASSERT(newClip->Paste(t, clip));
t = newClip->GetEndTime();
mClips.DeleteObject(clip);
@@ -2114,6 +2109,7 @@ bool WaveTrack::MergeClips(int clipidx1, int clipidx2)
WaveClip* clip1 = GetClipByIndex(clipidx1);
WaveClip* clip2 = GetClipByIndex(clipidx2);
wxASSERT(clip2);
if(clip2 == NULL) // could happen if one track of a linked pair had a split and the other didn't
return false;