mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-08 08:01:19 +02:00
Turns out the failsafe I added yesterday in r11929 was the correct solution to bug 367. This commit just adjusts the comments.
This also has the fix for bug 232, derived from the patch by Gaurav Agarwal. Also changed several lingering "linking" comments to "sync-lock", the agreed on current terminology.
This commit is contained in:
parent
7668084315
commit
0e287db4c9
@ -3830,7 +3830,7 @@ void AudacityProject::OnPaste()
|
||||
((LabelTrack *)n)->Clear(t0, t1);
|
||||
|
||||
// To be (sort of) consistent with Clear behavior, we'll only shift
|
||||
// them if linking is on
|
||||
// them if sync-lock is on.
|
||||
if (IsSyncLocked())
|
||||
((LabelTrack *)n)->ShiftLabelsOnInsert(msClipT1 - msClipT0, t0);
|
||||
|
||||
@ -3908,7 +3908,7 @@ void AudacityProject::OnPaste()
|
||||
{
|
||||
((LabelTrack *)n)->Clear(t0, t1);
|
||||
|
||||
// As above, only shift labels if linking is on
|
||||
// As above, only shift labels if sync-lock is on.
|
||||
if (IsSyncLocked())
|
||||
((LabelTrack *)n)->ShiftLabelsOnInsert(msClipT1 - msClipT0, t0);
|
||||
}
|
||||
@ -5330,6 +5330,9 @@ void AudacityProject::OnSelectionSave()
|
||||
|
||||
void AudacityProject::OnSelectionRestore()
|
||||
{
|
||||
if ((mSel0save == 0.0) && (mSel1save == 0.0))
|
||||
return;
|
||||
|
||||
mViewInfo.sel0 = mSel0save;
|
||||
mViewInfo.sel1 = mSel1save;
|
||||
|
||||
|
@ -184,7 +184,7 @@ class AUDACITY_DLL_API Track: public XMLTagHandler
|
||||
virtual double GetStartTime() { return 0.0; }
|
||||
virtual double GetEndTime() { return 0.0; }
|
||||
|
||||
// Checks if linking is on and any track in its sync-lock group is selected.
|
||||
// Checks if sync-lock is on and any track in its sync-lock group is selected.
|
||||
bool IsSyncLockSelected();
|
||||
};
|
||||
|
||||
|
@ -2565,20 +2565,18 @@ void TrackPanel::HandleSlide(wxMouseEvent & 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.
|
||||
// make sure the sample rate matches the destination track (mCapturedTrack).
|
||||
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;
|
||||
WaveClip* pWaveClip = mCapturedClipArray[i].clip;
|
||||
//vvvvv FIX-ME: I think that at this point, mCapturedClipArray has
|
||||
// the wrong clips if we're dragging a clip to another track, per bug 367.
|
||||
// Probably, mCapturedClipArray does not match mCapturedTrack.
|
||||
// Then if the mCapturedClipArray.GetCount() is wrong, pWaveClip can be NULL.
|
||||
// This conditional is just a failsafe against crash on NULL deref.
|
||||
// Note that per TrackPanel::AddClipsToCaptured(Track *t, double t0, double t1),
|
||||
// in the non-WaveTrack case, the code adds a NULL clip to mCapturedClipArray,
|
||||
// so we have to check for that any time we're going to deref it.
|
||||
// Previous code did not check it here, and that caused bug 367 crash.
|
||||
if (pWaveClip)
|
||||
{
|
||||
pWaveClip->Resample(pWaveTrack->GetRate());
|
||||
pWaveClip->Resample(((WaveTrack*)mCapturedTrack)->GetRate());
|
||||
pWaveClip->MarkChanged();
|
||||
}
|
||||
}
|
||||
@ -2700,12 +2698,12 @@ void TrackPanel::StartSlide(wxMouseEvent & event)
|
||||
}
|
||||
}
|
||||
|
||||
// Now, if linking is enabled, capture any clip that's linked to a
|
||||
// captured clip
|
||||
// Now, if sync-lock is enabled, capture any clip that's linked to a
|
||||
// captured clip.
|
||||
if (GetProject()->IsSyncLocked()) {
|
||||
// AWD: mCapturedClipArray expands as the loop runs, so newly-added
|
||||
// clips are considered (the effect is like recursion and terminates
|
||||
// because AddClipsToCapture doesn't add duplicate clips); to remove
|
||||
// because AddClipsToCaptured doesn't add duplicate clips); to remove
|
||||
// this behavior just store the array size beforehand.
|
||||
for (unsigned int i = 0; i < mCapturedClipArray.GetCount(); ++i) {
|
||||
// Capture based on tracks that have clips -- that means we
|
||||
|
@ -602,7 +602,7 @@ void ToolManager::ReadConfig()
|
||||
bar->Layout();
|
||||
}
|
||||
#else
|
||||
// note that this section is here because if you had been using linking and now you aren't,
|
||||
// note that this section is here because if you had been using sync-lock and now you aren't,
|
||||
// the space for the extra button is stored in audacity.cfg, and so you get an extra space
|
||||
// in the EditToolbar.
|
||||
// It is needed so that the meterToolbar size gets preserved.
|
||||
|
Loading…
x
Reference in New Issue
Block a user