tracktion-engine 3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_PluginList.h
Go to the documentation of this file.
1 /*
2 ,--. ,--. ,--. ,--.
3 ,-' '-.,--.--.,--,--.,---.| |,-.,-' '-.`--' ,---. ,--,--, Copyright 2024
4 '-. .-'| .--' ,-. | .--'| /'-. .-',--.| .-. || \ Tracktion Software
5 | | | | \ '-' \ `--.| \ \ | | | |' '-' '| || | Corporation
6 `---' `--' `--`--'`---'`--'`--' `---' `--' `---' `--''--' www.tracktion.com
7
8 Tracktion Engine uses a GPL/commercial licence - see LICENCE.md for details.
9*/
10
11namespace tracktion { inline namespace engine
12{
13
18{
19public:
22
23 //==============================================================================
24 Edit& getEdit() const { return edit; }
25 Clip* getOwnerClip() const { return ownerClip; }
26 Track* getOwnerTrack() const { return ownerTrack; }
27
28 void initialise (const juce::ValueTree&);
29 void releaseObjects();
30
31 void setTrackAndClip (Track*, Clip*);
32 void updateTrackProperties();
33
34 //==============================================================================
35 Plugin** begin() const;
36 Plugin** end() const;
37 int size() const;
38
39 Plugin* operator[] (int index) const;
40 bool contains (const Plugin*) const;
41 int indexOf (const Plugin*) const;
42
43 Plugin::Array getPlugins() const;
44 void sendMirrorUpdateToAllPlugins (Plugin&) const;
45
46 void clear();
47 bool needsConstantBufferSize();
48 bool canInsertPlugin();
49
50 Plugin::Ptr insertPlugin (const juce::ValueTree&, int index);
51 void insertPlugin (const Plugin::Ptr&, int index, SelectionManager* selectionManagerToSelect);
52 void addDefaultTrackPlugins (bool useVCA);
53 void addPluginsFrom (const juce::ValueTree&, bool clearFirst, bool atStart);
54
55 template <typename PluginType>
56 PluginType* findFirstPluginOfType() const
57 {
58 for (auto af : *this)
59 if (auto f = dynamic_cast<PluginType*> (af))
60 return f;
61
62 return {};
63 }
64
65 template <typename PluginType>
66 juce::Array<PluginType*> getPluginsOfType() const
67 {
69
70 for (auto af : *this)
71 if (auto f = dynamic_cast<PluginType*> (af))
72 plugins.add (f);
73
74 return plugins;
75 }
76
77 //==============================================================================
78 juce::ValueTree state;
79
80private:
81 //==============================================================================
82 Edit& edit;
83 Track* ownerTrack = nullptr;
84 Clip* ownerClip = nullptr;
85
86 struct ObjectList;
88
89 juce::UndoManager* getUndoManager() const;
90
92};
93
94}} // namespace tracktion { inline namespace engine
void add(const ElementType &newElement)
A clip in an edit.
The Tracktion Edit class!
Holds a sequence of plugins.
Manages a list of items that are currently selected.
Base class for tracks which contain clips and plugins and can be added to Edit[s].
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)