tracktion-engine
3.0-10-g034fdde4aa5
Tracktion Engine — High level data model for audio applications
« « « Anklang Documentation
Loading...
Searching...
No Matches
tracktion_engine
plugins
effects
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
11
namespace
tracktion
{
inline
namespace
engine
12
{
13
14
class
LowPassPlugin
:
public
Plugin
15
{
16
public
:
17
LowPassPlugin
(
PluginCreationInfo
);
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;
39
juce::CachedValue<juce::String>
mode;
40
AutomatableParameter::Ptr frequency;
41
42
private
:
43
juce::IIRFilter
filter[2];
44
float
currentFilterFreq = 0;
45
bool
isCurrentlyLowPass =
false
;
46
47
void
updateFilters();
48
49
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
(
LowPassPlugin
)
50
};
51
52
}}
// namespace tracktion { inline namespace engine
juce::CachedValue
juce::CachedValue::get
Type get() const noexcept
juce::IIRFilter
juce::String
tracktion::engine::LowPassPlugin
Definition
tracktion_LowPass.h:15
tracktion::engine::LowPassPlugin::applyToBuffer
void applyToBuffer(const PluginRenderContext &) override
Process the next block of data.
Definition
tracktion_LowPass.cpp:70
tracktion::engine::LowPassPlugin::getSelectableDescription
juce::String getSelectableDescription() override
Subclasses must return a description of what they are.
Definition
tracktion_LowPass.h:27
tracktion::engine::LowPassPlugin::getName
juce::String getName() const override
The name of the type, e.g.
Definition
tracktion_LowPass.h:24
tracktion::engine::LowPassPlugin::getNumOutputChannelsGivenInputs
int getNumOutputChannelsGivenInputs(int numInputChannels) override
This must return the number of output channels that the plugin will produce, given a number of input ...
Definition
tracktion_LowPass.h:33
tracktion::engine::LowPassPlugin::deinitialise
void deinitialise() override
Called after play stops to release resources.
Definition
tracktion_LowPass.cpp:66
tracktion::engine::Plugin
Definition
tracktion_Plugin.h:114
TRANS
#define TRANS(stringLiteral)
NEEDS_TRANS
#define NEEDS_TRANS(stringLiteral)
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
juce::jmin
constexpr Type jmin(Type a, Type b)
tracktion::PluginInitialisationInfo
Passed into Plugins when they are being initialised, to give them useful contextual information that ...
Definition
tracktion_Plugin.h:36
tracktion
Definition
tracktion_AudioReader.h:23
tracktion::engine::PluginCreationInfo
Definition
tracktion_Plugin.h:15
tracktion::engine::PluginRenderContext
The context passed to plugin render methods to provide it with buffers to fill.
Definition
tracktion_Plugin.h:48
« « « Anklang Documentation