Debian Codegraph @

plugins/dragonfly-hall-reverb/Plugin.hpp

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