mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-19 09:01:15 +02:00
All tracks allocated with make_shared, no more make_unique...
... so that we can use Track::SharedPointer without undefined behavior even on tracks that don't yet belong to any TrackList. Also fix the return type of function template TrackList::Add and remove some casts.
This commit is contained in:
@@ -41,10 +41,8 @@ int DoAddLabel(
|
||||
auto lt = * iter.Filter< LabelTrack >();
|
||||
|
||||
// If none found, start a NEW label track and use it
|
||||
if (!lt) {
|
||||
lt = static_cast<LabelTrack*>
|
||||
(tracks->Add(trackFactory->NewLabelTrack()));
|
||||
}
|
||||
if (!lt)
|
||||
lt = tracks->Add(trackFactory->NewLabelTrack());
|
||||
|
||||
// LLL: Commented as it seemed a little forceful to remove users
|
||||
// selection when adding the label. This does not happen if
|
||||
@@ -158,7 +156,7 @@ void EditByLabel(
|
||||
}
|
||||
}
|
||||
|
||||
using EditDestFunction = std::unique_ptr<Track> (WaveTrack::*)(double, double);
|
||||
using EditDestFunction = std::shared_ptr<Track> (WaveTrack::*)(double, double);
|
||||
|
||||
//Executes the edit function on all selected wave tracks with
|
||||
//regions specified by selected labels
|
||||
|
Reference in New Issue
Block a user