quantumVERB  1.0.0
A FOSS convolution reverb plugin
MainPipeline.h
1 /*
2  ==============================================================================
3 
4  MainPipeline.h
5 
6  ==============================================================================
7 */
8 
9 #pragma once
10 
11 #include "Task.h"
12 
13 #include "Convolution.h"
14 #include "Gain.h"
15 #include "Mixer.h"
16 
17 namespace reverb
18 {
19 
20  //==============================================================================
21  /**
22  * Main audio processing pipeline. Contains various steps applied on every processing cycle,
23  * in particular convolution with the associated impulse response and some cleanup steps
24  * afterwards. This pipeline constitutes the critical path (i.e. it limits plugin
25  * performance) and thus is more heavily optimised than its IR counterpart.
26  */
27  class MainPipeline : public Task
28  {
29  public:
30  //==============================================================================
31  MainPipeline(juce::AudioProcessor * processor);
32 
33  ~MainPipeline() = default;
34 
35  //==============================================================================
36  using Ptr = std::shared_ptr<MainPipeline>;
37 
38  //==============================================================================
39  virtual void updateParams(const juce::AudioProcessorValueTreeState& params,
40  const juce::String& = "") override;
41 
42  virtual void updateSampleRate(double sr) override;
43 
44  virtual AudioBlock exec(AudioBlock audio) override;
45 
46  //==============================================================================
47  /**
48  * @brief Pipeline must always be executed
49  *
50  * @returns True
51  */
52  virtual bool needsToRun() const override { return true; }
53 
54  //==============================================================================
55  void loadIR(AudioBlock irIn);
56 
57  AudioBlock ir;
58 
59  protected:
60  //==============================================================================
61  Convolution::Ptr convolution;
62  Gain::Ptr gain;
63  Mixer::Ptr dryWetMixer;
64  };
65 
66 }
float getParam(const juce::AudioProcessorValueTreeState &params, const juce::String &blockId) const
Internal method used to get (and check) a parameter&#39;s value.
Definition: Task.h:111
virtual AudioBlock exec(AudioBlock audio) override
Apply reverb effect to given audio buffer.
virtual void updateSampleRate(double sr) override
Update sample rate for pipeline and child tasks.
MainPipeline(juce::AudioProcessor *processor)
Constructs a MainPipeline object associated with an AudioProcessor.
virtual void updateParams(const juce::AudioProcessorValueTreeState &params, const juce::String &="") override
Updates parameters from processor parameter tree.
virtual bool needsToRun() const override
Pipeline must always be executed.
Definition: MainPipeline.h:52
void loadIR(AudioBlock irIn)
Copy reference to IR buffer.