Debian Codegraph @

plugins/dragonfly-room-reverb/UI.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 #ifndef DRAGONFLY_REVERB_UI_HPP_INCLUDED
18 #define DRAGONFLY_REVERB_UI_HPP_INCLUDED
19
20 #include "AbstractUI.hpp"
21 #include "ImageWidgets.hpp"
22 #include "NanoVG.hpp"
23 #include "DistrhoPlugin.hpp"
24 #include "Spectrogram.hpp"
25 #include "LabelledKnob.hpp"
26 #include "Selection.hpp"
27
28 START_NAMESPACE_DISTRHO
29
30 // -----------------------------------------------------------------------
31
32 class DragonflyReverbUI :
33 public DragonflyReverbAbstractUI,
34 public ImageSlider::Callback,
35 public Selection::Callback {
36 public:
37 DragonflyReverbUI();
38
39 protected:
40 // -------------------------------------------------------------------
41 // DSP Callbacks
42
43 void parameterChanged ( uint32_t index, float value ) override;
44 void stateChanged(const char* key, const char* value) override;
45
46 void programLoaded (uint32_t index);
47
48 // -------------------------------------------------------------------
49 // Widget Callbacks
50 void imageKnobDragStarted ( ImageKnob* knob ) override;
51 void imageKnobDragFinished ( ImageKnob* knob ) override;
52 void imageKnobValueChanged ( ImageKnob* knob, float value ) override;
53 void imageSliderDragStarted(ImageSlider* slider) override;
54 void imageSliderDragFinished(ImageSlider* slider) override;
55 void imageSliderValueChanged(ImageSlider* slider, float value) override;
56 void selectionClicked(Selection* selection, int option) override;
57
58 void onDisplay() override;
59 void uiIdle() override;
60
61 private:
62 Image imgBackground,imgTabOff,imgTabOn;
63
64 ScopedPointer<ImageSlider> sliderDryLevel, sliderEarlyLevel, sliderEarlySend, sliderLateLevel;
65 ScopedPointer<Spectrogram> spectrogram;
66 ScopedPointer<LabelledKnob>
67 knobSize, knobWidth,
68 knobPredelay, knobDecay,
69 knobDiffuse, knobSpin, knobWander,
70 knobInHighCut, knobEarlyDamp, knobLateDamp,
71 knobInLowCut, knobBoostLPF, knobBoost;
72
73 ScopedPointer<Selection> bankSelection;
74 ScopedPointer<Selection> presetSelection;
75
76 int currentBank;
77 int currentPreset[NUM_BANKS];
78
79 DGL::Rectangle<int> rectSliders[4];
80 DGL::Rectangle<int> rectDisplay;
81
82 void updateBank(int newBank);
83 void updatePresetDefaults();
84
85 DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR ( DragonflyReverbUI )
86 };
87
88 // -----------------------------------------------------------------------
89
90 END_NAMESPACE_DISTRHO
91
92 #endif //