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

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_RackInstance.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 RackInstance : public Plugin
15{
16public:
18 ~RackInstance() override;
19
20 static juce::ValueTree create (RackType&);
21
22 //==============================================================================
23 static const char* xmlTypeName;
24
25 juce::String getName() const override;
26 juce::String getPluginType() override { return xmlTypeName; }
27 juce::String getTooltip() override;
28
29 void initialise (const PluginInitialisationInfo&) override;
30 void deinitialise() override;
31
32 bool takesAudioInput() override { return true; }
33 bool takesMidiInput() override { return true; }
34 bool producesAudioWhenNoAudioInput() override { return true; }
35 bool isSynth() override { return true; }
36 bool canBeAddedToRack() override { return false; }
37 int getNumOutputChannelsGivenInputs (int) override { return 2; }
38 double getLatencySeconds() override;
39 bool needsConstantBufferSize() override { return true; }
40
41 void prepareForNextBlock (TimePosition) override;
42 void applyToBuffer (const PluginRenderContext&) override;
44
46
47 void replaceRackWithPluginSequence (SelectionManager*);
48
49 //==============================================================================
50 enum Channel { left, right };
51
52 juce::StringArray getInputChoices (bool includeNumberPrefix);
53 juce::StringArray getOutputChoices (bool includeNumberPrefix);
54 juce::String getNoPinName();
55
56 void setInputName (Channel, const juce::String& inputName);
57 void setOutputName (Channel, const juce::String& outputName);
58
59 //==============================================================================
60 const EditItemID rackTypeID;
61 const RackType::Ptr type;
62
63 bool linkInputs = true, linkOutputs = true;
64 juce::CachedValue<int> leftInputGoesTo, rightInputGoesTo, leftOutputComesFrom, rightOutputComesFrom;
65 juce::CachedValue<float> dryValue, wetValue, leftInValue, rightInValue, leftOutValue, rightOutValue;
66
67 AutomatableParameter::Ptr dryGain, wetGain;
68 AutomatableParameter::Ptr leftInDb, rightInDb, leftOutDb, rightOutDb;
69
70 void setInputLevel (Channel, float);
71 void setOutputLevel (Channel, float);
72
73 juce::String getInputName (Channel);
74 juce::String getOutputName (Channel);
75
76 static constexpr double rackMinDb = -100.0;
77 static constexpr double rackMaxDb = 12.0;
78
79private:
81};
82
83}} // namespace tracktion { inline namespace engine
juce::String getSelectableDescription() override
Subclasses must return a description of what they are.
void applyToBuffer(const PluginRenderContext &) override
Process the next block of data.
juce::String getTooltip() override
default returns the name, others can return special stuff if needed
void prepareForNextBlock(TimePosition) override
Called between successive rendering blocks.
juce::String getName() const override
The name of the type, e.g.
void initialise(const PluginInitialisationInfo &) override
Gives the plugin a chance to set itself up before being played.
void deinitialise() override
Called after play stops to release resources.
void updateAutomatableParamPosition(TimePosition) override
Updates all the auto params to their positions at this time.
int getNumOutputChannelsGivenInputs(int) override
This must return the number of output channels that the plugin will produce, given a number of input ...
Manages a list of items that are currently selected.
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
Passed into Plugins when they are being initialised, to give them useful contextual information that ...
Represents a position in real-life time.
The context passed to plugin render methods to provide it with buffers to fill.