tracktion-engine
3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications
« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_engine
utilities
tracktion_PluginComponent.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
11
namespace
tracktion
{
inline
namespace
engine
12
{
13
18
struct
PluginComponent
19
{
20
PluginComponent
(
Plugin
& p) : plugin (p)
21
{
22
getActiveComps().add (
this
);
23
}
24
25
virtual
~PluginComponent
()
26
{
27
getActiveComps().removeFirstMatchingValue (
this
);
28
}
29
30
virtual
void
updateColour() = 0;
31
32
Plugin
& plugin;
33
34
static
PluginComponent
* getComponentFor (
const
Plugin
& p)
noexcept
35
{
36
for
(
auto
fc : getActiveComps())
37
if
(&fc->plugin == &p)
38
return
fc;
39
40
return
{};
41
}
42
43
static
juce::Array<PluginComponent*>
getComponentsFor (
const
Plugin
& p)
noexcept
44
{
45
juce::Array<PluginComponent*>
comps;
46
47
for
(
auto
fc : getActiveComps())
48
if
(&fc->plugin == &p)
49
comps.
add
(fc);
50
51
return
comps;
52
}
53
54
private
:
55
static
juce::Array<PluginComponent*>
& getActiveComps()
56
{
57
static
juce::Array<PluginComponent*>
comps;
58
return
comps;
59
}
60
61
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
(
PluginComponent
)
62
};
63
64
}}
// namespace tracktion { inline namespace engine
juce::Array
juce::Array::add
void add(const ElementType &newElement)
tracktion::engine::Plugin
Definition
tracktion_Plugin.h:114
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
tracktion
Definition
tracktion_AudioReader.h:23
tracktion::engine::PluginComponent
Components that represent a Plugin should inherit from this to ensure they are correctly notified whe...
Definition
tracktion_PluginComponent.h:19
« « « Anklang Documentation