mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-14 17:14:07 +01:00
Bug2346: Complete fix...
... without making undesirable dependency cycles.
Eliminate calls to NewWaveTrack in effects, but in Edit>Copy too, which was
not mentioned in the bug report. (Copying a track, deselecting all, and pasting
preserved CLIP colors, but not the TRACK color setting which applies to newly
generated clips.)
Instead, always use the new function WaveTrack::EmptyCopy from the track to be
later replaced, getting color information.
NewWaveTrack is still used in benchmark test, import, the Track menu
commands that make new tracks, recording to new tracks, and generators without
a selection, where there is no track to copy from.
Also when deserializing tracks from the .aup file, in which case the saved
color is later retrieved from the file.
Also, in mix-and-render, where other logic decides whether to copy colors
afterward.
See commit a9658e6ef7
This commit is contained in:
@@ -101,8 +101,7 @@ bool DoPasteNothingSelected(AudacityProject &project)
|
||||
// Cause duplication of block files on disk, when copy is
|
||||
// between projects
|
||||
locker.emplace(wc);
|
||||
uNewTrack = trackFactory.NewWaveTrack(
|
||||
wc->GetSampleFormat(), wc->GetRate()),
|
||||
uNewTrack = wc->EmptyCopy();
|
||||
pNewTrack = uNewTrack.get();
|
||||
},
|
||||
#ifdef USE_MIDI
|
||||
@@ -597,8 +596,7 @@ void OnPaste(const CommandContext &context)
|
||||
wt->ClearAndPaste(t0, t1, wc, true, true);
|
||||
}
|
||||
else {
|
||||
auto tmp = trackFactory.NewWaveTrack(
|
||||
wt->GetSampleFormat(), wt->GetRate());
|
||||
auto tmp = wt->EmptyCopy();
|
||||
tmp->InsertSilence( 0.0,
|
||||
// MJS: Is this correct?
|
||||
clipboard.Duration() );
|
||||
|
||||
Reference in New Issue
Block a user