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

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_InsertPlugin.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
14class InsertPlugin : public Plugin
15{
16public:
17 enum DeviceType
18 {
19 noDevice,
20 audioDevice,
21 midiDevice
22 };
23
25 ~InsertPlugin() override;
26
27 //==============================================================================
28 static const char* getPluginName() { return NEEDS_TRANS("Insert"); }
29 static const char* xmlTypeName;
30
31 juce::String getName() const override;
32 juce::String getPluginType() override;
33 juce::String getShortName (int) override;
34 double getLatencySeconds() override;
35 void getChannelNames (juce::StringArray*, juce::StringArray*) override;
36 bool takesAudioInput() override;
37 bool takesMidiInput() override;
38 bool canBeAddedToClip() override;
39 bool needsConstantBufferSize() override;
40
41 void initialise (const PluginInitialisationInfo&) override;
43 void deinitialise() override;
44 void applyToBuffer (const PluginRenderContext&) override;
46
47 void restorePluginStateFromValueTree (const juce::ValueTree&) override;
48
49 DeviceType getSendDeviceType() const { return sendDeviceType; }
50 DeviceType getReturnDeviceType() const { return returnDeviceType; }
51
52 juce::CachedValue<juce::String> name, inputDevice, outputDevice;
53 juce::CachedValue<double> manualAdjustMs;
54
55 void updateDeviceTypes();
56 void showLatencyTester();
57
59 bool hasAudio() const;
60
62 bool hasMidi() const;
63
64 static void getPossibleDeviceNames (Engine&,
65 juce::StringArray& devices,
66 juce::StringArray& aliases,
69 bool forInput);
70
72 int getLatencyNumSamples() const;
73
74private:
75 //==============================================================================
76 std::atomic<int> latencyNumSamples { 0 };
77 std::atomic<double> latencySeconds { 0.0 };
78 DeviceType sendDeviceType = noDevice, returnDeviceType = noDevice;
79
80 void valueTreePropertyChanged (juce::ValueTree&, const juce::Identifier&) override;
81
83};
84
85}} // namespace tracktion { inline namespace engine
The Engine is the central class for all tracktion sessions.
void applyToBuffer(const PluginRenderContext &) override
Process the next block of data.
void deinitialise() override
Called after play stops to release resources.
juce::String getName() const override
The name of the type, e.g.
void initialiseWithoutStopping(const PluginInitialisationInfo &) override
Tells the plugin that the audio graph has changed but the plugin isn't being re-initialised - i....
juce::String getSelectableDescription() override
Subclasses must return a description of what they are.
void initialise(const PluginInitialisationInfo &) override
Gives the plugin a chance to set itself up before being played.
bool hasMidi() const
Returns true if either the send or return types are MIDI.
bool hasAudio() const
Returns true if either the send or return types are audio.
#define NEEDS_TRANS(stringLiteral)
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Passed into Plugins when they are being initialised, to give them useful contextual information that ...
The context passed to plugin render methods to provide it with buffers to fill.