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

« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_LowPass.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 LowPassPlugin : public Plugin
15{
16public:
18 ~LowPassPlugin() override;
19
20 //==============================================================================
21 static const char* getPluginName() { return NEEDS_TRANS("Low/High-Pass Filter"); }
22 static const char* xmlTypeName;
23
24 juce::String getName() const override { return "LPF/HPF"; }
25 juce::String getPluginType() override { return xmlTypeName; }
26 juce::String getShortName (int) override { return "HP/LP"; }
27 juce::String getSelectableDescription() override { return TRANS("Low/High-Pass Filter"); }
28 bool needsConstantBufferSize() override { return false; }
29
30 void initialise (const PluginInitialisationInfo&) override;
31 void deinitialise() override;
32
33 int getNumOutputChannelsGivenInputs (int numInputChannels) override { return juce::jmin (numInputChannels, 2); }
34 void applyToBuffer (const PluginRenderContext&) override;
35
36 bool isLowPass() const noexcept { return mode.get() != "highpass"; }
37
38 juce::CachedValue<float> frequencyValue;
40 AutomatableParameter::Ptr frequency;
41
42private:
43 juce::IIRFilter filter[2];
44 float currentFilterFreq = 0;
45 bool isCurrentlyLowPass = false;
46
47 void updateFilters();
48
50};
51
52}} // namespace tracktion { inline namespace engine
Type get() const noexcept
void applyToBuffer(const PluginRenderContext &) override
Process the next block of data.
juce::String getSelectableDescription() override
Subclasses must return a description of what they are.
juce::String getName() const override
The name of the type, e.g.
int getNumOutputChannelsGivenInputs(int numInputChannels) override
This must return the number of output channels that the plugin will produce, given a number of input ...
void deinitialise() override
Called after play stops to release resources.
#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.