Audacity 3.2.0
AnalysisTracks.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 AnalysisTracks.h
6
7 Dominic Mazzoni
8 Vaughan Johnson
9
10 Paul Licameli split from Effect.h
11
12**********************************************************************/
13#ifndef __AUDACITY_ANALYSIS_TRACKS__
14#define __AUDACITY_ANALYSIS_TRACKS__
15
16#include <wx/string.h>
17#include <memory>
18
19class Effect;
20class LabelTrack;
21class Track;
22class TrackList;
23
24// For the use of analyzers, which don't need to make output wave tracks,
25// but may need to add label tracks.
26class AUDACITY_DLL_API AddedAnalysisTrack {
28
29public:
30 AddedAnalysisTrack(Effect *pEffect, const wxString &name);
32
33 // So you can have a vector of them
35
36 LabelTrack *get() const { return mpTrack; }
37
38 // Call this to indicate successful completion of the analyzer.
39 void Commit();
40
41 // Destructor undoes the addition of the analysis track if not committed.
43
44private:
45 Effect *mpEffect{};
46 LabelTrack *mpTrack{};
47};
48
49// Set name to given value if that is not empty, else use default name
50std::shared_ptr<AddedAnalysisTrack> AddAnalysisTrack(Effect &effect,
51 const wxString &name = wxString());
52
53// For the use of analyzers, which don't need to make output wave tracks,
54// but may need to modify label tracks.
55class AUDACITY_DLL_API ModifiedAnalysisTrack {
57
58public:
60 Effect *pEffect, const LabelTrack &origTrack, const wxString &name);
62
63 // So you can have a vector of them
65
66 LabelTrack *get() const { return mpTrack; }
67
68 // Call this to indicate successful completion of the analyzer.
69 void Commit();
70
71 // Destructor undoes the modification of the analysis track if not committed.
73
74private:
75 Effect *mpEffect{};
76 LabelTrack *mpTrack{};
77 std::shared_ptr<Track> mpOrigTrack{};
78};
79
80// Set name to given value if that is not empty, else use default name
82 const LabelTrack &origTrack, const wxString &name = wxString());
83
84#endif
ModifiedAnalysisTrack ModifyAnalysisTrack(Effect &effect, const LabelTrack &origTrack, const wxString &name=wxString())
std::shared_ptr< AddedAnalysisTrack > AddAnalysisTrack(Effect &effect, const wxString &name=wxString())
const TranslatableString name
Definition: Distortion.cpp:76
LabelTrack * get() const
AddedAnalysisTrack(const AddedAnalysisTrack &)=delete
Base class for many of the effects in Audacity.
Definition: Effect.h:26
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:95
LabelTrack * get() const
ModifiedAnalysisTrack(const ModifiedAnalysisTrack &)=delete
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