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

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_AuxSend.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 AuxSendPlugin : public Plugin
15{
16public:
18 ~AuxSendPlugin() override;
19
20 //==============================================================================
21 void setGainDb (float newDb);
22 float getGainDb() const { return volumeFaderPositionToDB (gain->getCurrentValue()); }
23
24 void setMute (bool m);
25 bool isMute();
26
27 int getBusNumber() const { return busNumber; }
28 juce::String getBusName();
29
30 static juce::StringArray getBusNames (Edit&, int maxNumBusses);
31 static juce::String getDefaultBusName (int busIndex);
32
33 //==============================================================================
34 static const char* getPluginName() { return NEEDS_TRANS("Aux Send"); }
35 static const char* xmlTypeName;
36
37 juce::String getName() const override;
38 juce::String getShortName (int suggestedMaxLength) override;
39 juce::String getPluginType() override { return xmlTypeName; }
40
41 int getNumOutputChannelsGivenInputs (int numInputChannels) override { return juce::jmin (numInputChannels, 2); }
42 void initialise (const PluginInitialisationInfo&) override;
44 void deinitialise() override;
45 void applyToBuffer (const PluginRenderContext&) override;
46
47 juce::String getSelectableDescription() override { return TRANS("Aux Send Plugin"); }
48
49 bool takesAudioInput() override { return true; }
50 bool canBeAddedToClip() override { return false; }
51 bool canBeAddedToRack() override { return false; }
52 bool needsConstantBufferSize() override { return true; }
53
54 void restorePluginStateFromValueTree (const juce::ValueTree&) override;
55
56 juce::CachedValue<int> busNumber;
58 juce::CachedValue<bool> invertPhase;
59
60 AutomatableParameter::Ptr gain;
61
62private:
63 bool shouldProcess();
64 //==============================================================================
65 juce::CachedValue<float> lastVolumeBeforeMute;
66 float lastGain = 1.0f;
67
68 juce::CriticalSection ownerTrackLock;
69 Track* ownerTrack = nullptr;
70
71 //==============================================================================
73};
74
75}} // namespace tracktion { inline namespace engine
void deinitialise() override
Called after play stops to release resources.
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 applyToBuffer(const PluginRenderContext &) override
Process the next block of data.
int getNumOutputChannelsGivenInputs(int numInputChannels) override
This must return the number of output channels that the plugin will produce, given a number of input ...
juce::String getName() const override
The name of the type, e.g.
The Tracktion Edit class!
#define TRANS(stringLiteral)
#define NEEDS_TRANS(stringLiteral)
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
constexpr Type jmin(Type a, Type b)
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.