Debian Codegraph @

plugins/dragonfly-plate-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 {
37 public:
38 DragonflyReverbUI();
39
40 protected:
41 // -------------------------------------------------------------------
42 // DSP Callbacks
43
44 void parameterChanged ( uint32_t index, float value ) override;
45 void stateChanged(const char* key, const char* value) override;
46
47 void programLoaded (uint32_t index);
48
49 // -------------------------------------------------------------------
50 // Widget Callbacks
51 void imageKnobDragStarted ( ImageKnob* knob ) override;
52 void imageKnobDragFinished ( ImageKnob* knob ) override;
53 void imageKnobValueChanged ( ImageKnob* knob, float value ) override;
54 void imageSliderDragStarted(ImageSlider* slider) override;
55 void imageSliderDragFinished(ImageSlider* slider) override;
56 void imageSliderValueChanged(ImageSlider* slider, float value) override;
57 void selectionClicked(Selection* selection, int option) override;
58
59 void onDisplay() override;
60 void uiIdle() override;
61
62 private:
63 Image imgBackground,imgTabOff,imgTabOn;
64
65 ScopedPointer<ImageSlider> sliderDry, sliderWet;
66 ScopedPointer<Spectrogram> spectrogram;
67 ScopedPointer<LabelledKnob>
68 knobWidth, knobPredelay, knobDecay,
69 knobLowCut, knobHighCut, knobDamp;
70
71 ScopedPointer<Selection> algorithmSelection;
72 ScopedPointer<Selection> presetSelection1;
73 ScopedPointer<Selection> presetSelection2;
74
75 int currentAlg;
76 int currentPreset;
77
78 DGL::Rectangle<int> rectSliders[2];
79 DGL::Rectangle<int> rectDisplay;
80
81 void updatePresetDefaults();
82
83 DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR ( DragonflyReverbUI )
84 };
85
86 // -----------------------------------------------------------------------
87
88 END_NAMESPACE_DISTRHO
89
90 #endif //