FahlGrahn Audio v1.0.0
Loading...
Searching...
No Matches
PluginProcessor.h
1#pragma once
2
3#include <juce_audio_processors/juce_audio_processors.h>
4
5#include <Biquad.h>
6#include <Filter.h>
7//==============================================================================
8class AudioPluginAudioProcessor final : public juce::AudioProcessor, juce::AudioProcessorValueTreeState::Listener
9{
10 public:
11 using FilterTuple =
12 std::tuple<std::shared_ptr<Filter>, juce::RangedAudioParameter *, juce::RangedAudioParameter *,
13 std::optional<juce::RangedAudioParameter *>, std::optional<juce::RangedAudioParameter *>,
14 std::optional<juce::RangedAudioParameter *>>;
15
16 //==============================================================================
19
20 //==============================================================================
21 void prepareToPlay(double sampleRate, int samplesPerBlock) override;
22 void releaseResources() override;
23
24 bool isBusesLayoutSupported(const BusesLayout &layouts) const override;
25
26 void processBlock(juce::AudioBuffer<float> &, juce::MidiBuffer &) override;
27 using AudioProcessor::processBlock;
28
29 //==============================================================================
30 juce::AudioProcessorEditor *createEditor() override;
31 bool hasEditor() const override;
32
33 //==============================================================================
34 const juce::String getName() const override;
35
36 bool acceptsMidi() const override;
37 bool producesMidi() const override;
38 bool isMidiEffect() const override;
39 double getTailLengthSeconds() const override;
40
41 //==============================================================================
42 int getNumPrograms() override;
43 int getCurrentProgram() override;
44 void setCurrentProgram(int index) override;
45 const juce::String getProgramName(int index) override;
46 void changeProgramName(int index, const juce::String &newName) override;
47
48 //==============================================================================
49 void getStateInformation(juce::MemoryBlock &destData) override;
50 void setStateInformation(const void *data, int sizeInBytes) override;
51
52 juce::AudioProcessorValueTreeState::ParameterLayout createParameters();
53
54 void parameterChanged(const juce::String &parameter, float newValue) override;
55 void update();
56
57 juce::AudioProcessorValueTreeState &getVTSParameters()
58 {
59 return mParameters;
60 }
61
62 juce::AudioBuffer<float> mAudioBuffer;
63 juce::AbstractFifo mRingBuffer{1};
64 std::atomic<bool> nextFFTBlockReady{false};
65
66 private:
67 juce::AudioProcessorValueTreeState mParameters;
68 std::vector<FilterTuple> mFilters;
69 std::atomic<bool> requiresUpdate{true};
70 //==============================================================================
71 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AudioPluginAudioProcessor)
72};
Definition PluginProcessor.h:9