FahlGrahn Audio v1.0.0
Loading...
Searching...
No Matches
PluginProcessor.h
1#pragma once
2
3#include <JuceHeader.h>
4#include <juce_audio_processors/juce_audio_processors.h>
5
6//==============================================================================
7class AudioPluginAudioProcessor final : public juce::AudioProcessor
8{
9 public:
10 //==============================================================================
13
14 //==============================================================================
15 void prepareToPlay(double sampleRate, int samplesPerBlock) override;
16 void releaseResources() override;
17
18 bool isBusesLayoutSupported(const BusesLayout &layouts) const override;
19
20 void processBlock(juce::AudioBuffer<float> &, juce::MidiBuffer &) override;
21 using AudioProcessor::processBlock;
22
23 //==============================================================================
24 juce::AudioProcessorEditor *createEditor() override;
25 bool hasEditor() const override;
26
27 //==============================================================================
28 const juce::String getName() const override;
29
30 bool acceptsMidi() const override;
31 bool producesMidi() const override;
32 bool isMidiEffect() const override;
33 double getTailLengthSeconds() const override;
34
35 //==============================================================================
36 int getNumPrograms() override;
37 int getCurrentProgram() override;
38 void setCurrentProgram(int index) override;
39 const juce::String getProgramName(int index) override;
40 void changeProgramName(int index, const juce::String &newName) override;
41
42 //==============================================================================
43 void getStateInformation(juce::MemoryBlock &destData) override;
44 void setStateInformation(const void *data, int sizeInBytes) override;
45
46 bool loadFile(juce::File &file);
47 juce::AudioTransportSource &getTransportSource()
48 {
49 return transportSource;
50 }
51 juce::AudioFormatReaderSource &getAudioFormatReaderSource()
52 {
53 return *audioFormatReaderSource;
54 }
55
56 private:
57 juce::AudioTransportSource transportSource;
58 juce::AudioFormatManager audioFormatManager;
59 std::unique_ptr<juce::AudioFormatReaderSource> audioFormatReaderSource;
60
61 float previousGain;
62 juce::AudioParameterFloat *gainParameter;
63 juce::AudioParameterBool *loopParameter;
64 juce::AudioParameterBool *playParameter;
65
66 juce::AudioProcessorValueTreeState parameters;
67 //==============================================================================
68 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(AudioPluginAudioProcessor)
69};
Definition PluginProcessor.h:9