1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-24 08:28:04 +02:00

Further fix for P2 bug described by Bill Wharrie in "Problem dragging clips between tracks with different sample rates" thread on audacity-quality. Moved the resampling of dragged clips to (left-)mouse-up, rather than upon drag into the destination, but still dragging.

This commit is contained in:
v.audacity 2012-03-03 20:20:06 +00:00
parent b3a6a8215e
commit e47349a6f4
2 changed files with 12 additions and 3 deletions

View File

@ -2553,6 +2553,17 @@ void TrackPanel::HandleSlide(wxMouseEvent & event)
DoSlide(event);
if (event.LeftUp()) {
if (mDidSlideVertically && mCapturedTrack)
// Now that user has dropped the clip into a different track,
// make sure the sample rate matches the destination track.
for (size_t i = 0; i < mCapturedClipArray.GetCount(); i++)
if (mCapturedTrack->GetKind() == Track::Wave) // Should always be true here, but make sure.
{
WaveTrack* pWaveTrack = (WaveTrack*)mCapturedTrack;
mCapturedClipArray[i].clip->Resample(pWaveTrack->GetRate());
mCapturedClipArray[i].clip->MarkChanged();
}
SetCapturedTrack( NULL );
if (mSnapManager) {

View File

@ -1852,11 +1852,9 @@ void WaveTrack::MoveClipToTrack(WaveClip *clip, WaveTrack* dest)
{
for (WaveClipList::compatibility_iterator it=GetClipIterator(); it; it=it->GetNext()) {
if (it->GetData() == clip) {
WaveClip* clip = it->GetData(); // ANSWER-ME: Why declare and assign this to another variable, when we just verified the 'clip' parameter is the right value?!
WaveClip* clip = it->GetData(); //vvv ANSWER-ME: Why declare and assign this to another variable, when we just verified the 'clip' parameter is the right value?!
mClips.DeleteNode(it);
dest->mClips.Append(clip);
clip->Resample(dest->GetRate());
clip->MarkChanged();
return; // JKC iterator is now 'defunct' so better return straight away.
}
}