Audacity 3.2.0
EffectOutputTracks.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 EffectOutputTracks.h
6
7 Paul Licameli split from EffectBase.h
8
9**********************************************************************/
10#ifndef __AUDACITY_EFFECT_OUTPUT_TRACKS__
11#define __AUDACITY_EFFECT_OUTPUT_TRACKS__
12
13class Track;
14class TrackList;
15
16#include "EffectInterface.h"
17
18#include <memory>
19#include <optional>
20#include <vector>
21
23/*
24 Do the processing on temporaries, and then the originals are replaced only on
25 Commit().
26 If not all sync-locked selected, then only selected wave tracks.
27*/
28class EFFECTS_API EffectOutputTracks
29{
30public:
31 // A global counter of all the successful Effect invocations.
32 static int nEffectsDone;
33 static void IncEffectCounter() { ++nEffectsDone; }
34
35 using TimeInterval = std::pair<double, double>;
50 TrackList& tracks, EffectType effectType,
51 std::optional<TimeInterval> effectTimeInterval,
52 bool allSyncLockSelected = false, bool stretchSyncLocked = false);
54
56
58
62 Track *AddToOutputTracks(const std::shared_ptr<Track> &t);
63
66
70 Track *AddToOutputTracks(TrackList &&list);
71
76 const Track* GetMatchingInput(const Track& outTrack) const;
77
79 /*
80 @pre `Commit()` was not previously called
81 */
82 void Commit();
83
85 /*
86 @pre `Commit()` was not previously called
87 */
88 TrackList &Get() { return *mOutputTracks; }
89
90private:
98 std::vector<Track*> mIMap;
99 std::vector<Track*> mOMap;
100 std::shared_ptr<TrackList> mOutputTracks;
101};
102
103#endif
EffectType
const auto tracks
Use this object to copy the input tracks to tentative outputTracks.
const EffectType mEffectType
EffectOutputTracks(const EffectOutputTracks &)=delete
std::pair< double, double > TimeInterval
TrackList & Get()
Expose the output track list for iterations or even erasures.
std::vector< Track * > mOMap
std::vector< Track * > mIMap
static void IncEffectCounter()
std::shared_ptr< TrackList > mOutputTracks
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:122
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Definition: Track.h:975