-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSimpleEQProcessor.h
79 lines (64 loc) · 2.66 KB
/
SimpleEQProcessor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/** Use this processor to apply a basic EQ to all incoming audio channels.
By default this contains 5 bands, in this order:
- High-pass
- 3 centred band-passes
- Low-pass
*/
class SimpleEQProcessor final : public InternalProcessor
{
public:
/** Constructor. */
SimpleEQProcessor();
/** Destructor. */
~SimpleEQProcessor() override;
//==============================================================================
/** @internal */
const String getName() const override { return NEEDS_TRANS ("Simple Equaliser"); }
/** @internal */
Identifier getIdentifier() const override { return "equaliser"; }
/** @internal */
bool supportsDoublePrecisionProcessing() const override { return true; }
/** @internal */
void prepareToPlay (double, int) override;
/** @internal */
void processBlock (juce::AudioBuffer<float>&, MidiBuffer&) override;
/** @internal */
void processBlock (juce::AudioBuffer<double>&, MidiBuffer&) override;
/** @internal */
int getNumPrograms() override;
/** @internal */
int getCurrentProgram() override;
/** @internal */
void setCurrentProgram (int) override;
/** @internal */
const String getProgramName (int) override;
/** @internal */
CurveData getResponseCurve (CurveData::Type) const override;
private:
//==============================================================================
using FilterType = dsp::StateVariableTPTFilterType;
template<typename SampleType>
using Context = dsp::ProcessContextReplacing<SampleType>;
template<typename SampleType>
using Filter = dsp::IIR::Filter<SampleType>;
template<typename SampleType>
using Coefficients = dsp::IIR::Coefficients<SampleType>;
template<typename SampleType>
using ProcessorDuplicator = dsp::ProcessorDuplicator<Filter<SampleType>, Coefficients<SampleType>>;
class FilterBypassParameter;
class InternalFilter;
OwnedArray<InternalFilter> filters;
class Program;
friend class Program;
OwnedArray<Program> programs;
int currentProgramIndex = 0;
static inline const auto maxDecibels = 18.0f;
static inline const auto maxGain = Decibels::decibelsToGain (maxDecibels);
//==============================================================================
AudioProcessorValueTreeState::ParameterLayout createParameterLayout();
template<typename SampleType>
void process (juce::AudioBuffer<SampleType>& buffer);
//==============================================================================
JUCE_DECLARE_WEAK_REFERENCEABLE (SimpleEQProcessor)
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SimpleEQProcessor)
};