Debian Codegraph @

plugins/dragonfly-room-reverb/Plugin.hpp

raw
1 /*
2 * Dragonfly Reverb, copyright (c) 2019 Michael Willis, Rob van den Berg
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 3 of
7 * the License, or any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * For a full copy of the GNU General Public License see the LICENSE file.
15 */
16
17 #include "DistrhoPlugin.hpp"
18 #include "DragonflyVersion.h"
19 #include "DSP.hpp"
20 #include "freeverb/earlyref.hpp"
21 #include "freeverb/zrev2.hpp"
22
23 START_NAMESPACE_DISTRHO
24
25 // -----------------------------------------------------------------------
26
27 class DragonflyReverbPlugin : public Plugin
28 {
29 public:
30 DragonflyReverbPlugin();
31
32 protected:
33 // -------------------------------------------------------------------
34 // Information
35
36 const char* getLabel() const noexcept override
37 {
38 return "Dragonfly Room Reverb";
39 }
40
41 const char* getDescription() const override
42 {
43 return "A room reverb based on Freeverb3 ProG";
44 }
45
46 const char* getMaker() const noexcept override
47 {
48 return "Michael Willis";
49 }
50
51 const char* getHomePage() const override
52 {
53 return "https://michaelwillis.github.io/dragonfly-reverb";
54 }
55
56 const char* getLicense() const noexcept override
57 {
58 return "http://www.gnu.org/licenses/gpl-3.0.html";
59 }
60
61 uint32_t getVersion() const noexcept override
62 {
63 return d_version(MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION);
64 }
65
66 int64_t getUniqueId() const noexcept override
67 {
68 return d_cconst('d', 'f', 'r', '2');
69 }
70
71 // -------------------------------------------------------------------
72 // Init
73
74 void initAudioPort(bool input, uint32_t index, AudioPort& port) override;
75 void initParameter(uint32_t index, Parameter& parameter) override;
76 void initState(uint32_t index, State& state) override;
77
78 // -------------------------------------------------------------------
79 // Internal data
80
81 float getParameterValue(uint32_t index) const override;
82 void setParameterValue(uint32_t index, float value) override;
83
84 void setState(const char* key, const char* value) override;
85
86 // -------------------------------------------------------------------
87 // Process
88
89 void activate() override;
90 void run(const float** inputs, float** outputs, uint32_t frames) override;
91
92 // -------------------------------------------------------------------
93 // Callbacks
94
95 void sampleRateChanged(double newSampleRate) override;
96
97 // -------------------------------------------------------------------
98
99 private:
100 DragonflyReverbDSP dsp;
101 int bank;
102 int preset;
103 DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DragonflyReverbPlugin)
104 };
105
106 END_NAMESPACE_DISTRHO