1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-03 17:39:25 +02:00

Bug 367 (P2) followup - fix another crash case. Rewrite of MoveClipToTrack will need to be done as a lot of the code does not take into account sync locked tracks.

This commit is contained in:
mchinen 2011-04-17 23:54:30 +00:00
parent 78a537ee48
commit 68a2c2514a
3 changed files with 17 additions and 0 deletions

View File

@ -831,6 +831,7 @@ Track *TrackList::GetLink(Track * t) const
return NULL;
}
/// Return a track in the list that comes after Track t
Track *TrackList::GetNext(Track * t, bool linked) const
{
if (t) {

View File

@ -354,6 +354,11 @@ class AUDACITY_DLL_API TrackList:public wxEvtHandler
Track *GetLink(Track * t) const;
Track *GetPrev(Track * t, bool linked = false) const;
/** Return a track in the list that comes after Track t
* @param t a track in the list
* @param linked if true, skips over linked tracks, if false returns the next track even if it is a linked track
**/
Track *GetNext(Track * t, bool linked = false) const;
int GetGroupHeight(Track * t) const;

View File

@ -7555,7 +7555,18 @@ bool TrackPanel::MoveClipToTrack(WaveClip *clip,
// Get the second track of two stereo tracks
src2 = (WaveTrack*)mTracks->GetLink(src);
if (clip2 && !src2) {
// if we are copying two mono linked tracks we have to ask for it differently
src2 = (WaveTrack*)mTracks->GetNext(src, false);
if (src2 && src2->GetKind() != Track::Wave)
src2 = NULL;
}
dst2 = (WaveTrack*)mTracks->GetLink(dst);
if (clip2 && !dst2) {
dst2 = (WaveTrack*)mTracks->GetNext(dst, false);
if (dst2 && dst2->GetKind() != Track::Wave)
dst2 = NULL;
}
if ((src2 && !dst2) || (dst2 && !src2))
return false; // cannot move stereo- to mono track or other way around