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
61 Track *AddToOutputTracks(const std::shared_ptr<Track> &t);
62
63
68 const Track* GetMatchingInput(const Track& outTrack) const;
69
71 /*
72 @pre `Commit()` was not previously called
73 */
74 void Commit();
75
77 /*
78 @pre `Commit()` was not previously called
79 */
80 TrackList &Get() { return *mOutputTracks; }
81
82private:
89 std::vector<Track*> mIMap;
90 std::vector<Track*> mOMap;
91 std::shared_ptr<TrackList> mOutputTracks;
92};
93
94#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:110
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Definition: Track.h:850