mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-27 06:07:59 +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:
parent
b3a6a8215e
commit
e47349a6f4
@ -2553,6 +2553,17 @@ void TrackPanel::HandleSlide(wxMouseEvent & event)
|
|||||||
DoSlide(event);
|
DoSlide(event);
|
||||||
|
|
||||||
if (event.LeftUp()) {
|
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 );
|
SetCapturedTrack( NULL );
|
||||||
|
|
||||||
if (mSnapManager) {
|
if (mSnapManager) {
|
||||||
|
@ -1852,11 +1852,9 @@ void WaveTrack::MoveClipToTrack(WaveClip *clip, WaveTrack* dest)
|
|||||||
{
|
{
|
||||||
for (WaveClipList::compatibility_iterator it=GetClipIterator(); it; it=it->GetNext()) {
|
for (WaveClipList::compatibility_iterator it=GetClipIterator(); it; it=it->GetNext()) {
|
||||||
if (it->GetData() == clip) {
|
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);
|
mClips.DeleteNode(it);
|
||||||
dest->mClips.Append(clip);
|
dest->mClips.Append(clip);
|
||||||
clip->Resample(dest->GetRate());
|
|
||||||
clip->MarkChanged();
|
|
||||||
return; // JKC iterator is now 'defunct' so better return straight away.
|
return; // JKC iterator is now 'defunct' so better return straight away.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user