22 std::optional<TimeInterval> effectTimeInterval,
bool allSyncLockSelected,
23 bool stretchSyncLocked)
25 , mEffectType { effectType }
28 !effectTimeInterval.has_value() ||
29 effectTimeInterval->first <= effectTimeInterval->second);
36 [&] (
const Track *pTrack) {
37 return allSyncLockSelected
42 for (
auto aTrack : trackRange) {
43 auto pTrack = aTrack->Duplicate();
44 mIMap.push_back(aTrack);
45 mOMap.push_back(pTrack.get());
50 effectTimeInterval.has_value() &&
51 effectTimeInterval->second > effectTimeInterval->first)
56 const auto tracksToUnstretch =
62 *pTrack, effectTimeInterval->first,
63 effectTimeInterval->second);
66 tracksToUnstretch.begin(), tracksToUnstretch.end(),
68 aTrack->ApplyPitchAndSpeed(effectTimeInterval, child);
83 mIMap.push_back(
nullptr);
84 mOMap.push_back(t.get());
94 const auto it = std::find(
mOMap.begin(),
mOMap.end(), &outTrack);
95 if (it ==
mOMap.end())
97 const auto index = it -
mOMap.begin();
112 size_t cnt =
mOMap.size();
120 while (i < cnt &&
mOMap[i] != pOutputTrack) {
121 const auto t =
mIMap[i];
150 const auto t =
mIMap[i];
Toolkit-neutral facade for basic user interface services.
std::function< void(double)> ProgressReporter
An AudacityException with no visible message.
const Track * GetMatchingInput(const Track &outTrack) const
Gets the matching input track for the given output track if it finds its match, else nullptr.
Track * AddToOutputTracks(const std::shared_ptr< Track > &t)
Use this to add an output track, not corresponding to an input.
const EffectType mEffectType
EffectOutputTracks(TrackList &tracks, EffectType effectType, std::optional< TimeInterval > effectTimeInterval, bool allSyncLockSelected=false, bool stretchSyncLocked=false)
std::vector< Track * > mOMap
std::vector< Track * > mIMap
std::shared_ptr< TrackList > mOutputTracks
void Commit()
Replace input tracks with temporaries only on commit.
static bool IsSelectedOrSyncLockSelected(const Track &track)
Abstract base class for an object holding data associated with points on a time axis.
bool GetSelected() const
Selectedness is always the same for all channels of a group.
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
static TrackListHolder Create(AudacityProject *pOwner)
void AppendOne(TrackList &&list)
Remove first track (if any) from list and put it at the end of this
auto Any() -> TrackIterRange< TrackType >
Track::Holder ReplaceOne(Track &t, TrackList &&with)
Track::Holder Remove(Track &track)
Remove a track and return it.
AudacityProject * GetOwner()
A Track that contains audio waveform data.
void SplitProgress(ItType first, ItType last, FnType action, ProgressReporter parent)
Helper for the update of a task's progress bar when this task is made of a range's subtasks.
WAVE_TRACK_API void WithClipRenderingProgress(std::function< void(const ProgressReporter &)> action, TranslatableString title=defaultStretchRenderingTitle)
WAVE_TRACK_API bool HasPitchOrSpeed(const WaveTrack &track, double t0, double t1)