Add TAL-Reverb-II plugin to test
[juce-lv2.git] / tal-reverb-2-juce / src / TalComponent.h
blobb19bfedcd5afdf0bb001a03cb7b25ea9631dc526
1 /*
2 ==============================================================================
4 This file is part of the JUCE library - "Jules' Utility Class Extensions"
5 Copyright 2004-7 by Raw Material Software ltd.
7 ------------------------------------------------------------------------------
9 JUCE can be redistributed and/or modified under the terms of the
10 GNU General Public License, as published by the Free Software Foundation;
11 either version 2 of the License, or (at your option) any later version.
13 JUCE is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with JUCE; if not, visit www.gnu.org/licenses or write to the
20 Free Software Foundation, Inc., 59 Temple Place, Suite 330,
21 Boston, MA 02111-1307 USA
23 ------------------------------------------------------------------------------
25 If you'd like to release a closed-source product which uses JUCE, commercial
26 licenses are also available: visit www.rawmaterialsoftware.com/juce for
27 more information.
29 ==============================================================================
32 #ifndef TALCOMPONENTEDITOR_H
33 #define TALCOMPONENTEDITOR_H
35 #include "TalCore.h"
36 #include "FilmStripKnob.h"
37 #include "ImageSlider.h"
38 #include "ImageToggleButton.h"
40 #include "./Engine/AudioUtils.h"
43 //==============================================================================
44 /**
45 This is the Component that our filter will use as its UI.
47 One or more of these is created by the DemoJuceFilter::createEditor() method,
48 and they will be deleted at some later time by the wrapper code.
50 To demonstrate the correct way of connecting a filter to its UI, this
51 class is a ChangeListener, and our demo filter is a ChangeBroadcaster. The
52 editor component registers with the filter when it's created and deregisters
53 when it's destroyed. When the filter's parameters are changed, it broadcasts
54 a message and this editor responds by updating its display.
56 class TalComponent : public AudioProcessorEditor,
57 public ChangeListener,
58 public SliderListener,
59 public ButtonListener
61 public:
62 /** Constructor.
64 When created, this will register itself with the filter for changes. It's
65 safe to assume that the filter won't be deleted before this object is.
67 TalComponent(TalCore* const ownerFilter);
71 /** Destructor. */
72 ~TalComponent();
74 //==============================================================================
75 /** Our demo filter is a ChangeBroadcaster, and will call us back when one of
76 its parameters changes.
78 void changeListenerCallback (ChangeBroadcaster* source);
80 void sliderValueChanged (Slider*);
82 void buttonClicked (Button *);
84 //==============================================================================
85 /** Standard Juce paint callback. */
86 void paint (Graphics& g);
88 /** Standard Juce resize callback. */
89 //void resized();
91 static const char* bmp00128_png;
92 static const int bmp00128_pngSize;
94 static const char* bmp00129_png;
95 static const int bmp00129_pngSize;
97 static const char* bmp00130_png;
98 static const int bmp00130_pngSize;
100 static const char* bmp00132_png;
101 static const int bmp00132_pngSize;
103 static const char* bmp00133_png;
104 static const int bmp00133_pngSize;
106 private:
107 //==============================================================================
108 FilmStripKnob *decayTimeKnob;
109 FilmStripKnob *preDelayKnob;
112 FilmStripKnob *lowShelfFrequencyKnob;
113 FilmStripKnob *highShelfFrequencyKnob;
114 FilmStripKnob *peakFrequencyKnob;
116 FilmStripKnob *lowShelfGainKnob;
117 FilmStripKnob *highShelfGainKnob;
118 FilmStripKnob *peakGainKnob;
120 FilmStripKnob *stereoWithKnob;
122 ImageSlider *drySlider;
123 ImageSlider *wetSlider;
125 ImageToggleButton *realStereoModeButton;
127 Label *versionLabel;
129 AudioUtils audioUtils;
130 TooltipWindow tooltipWindow;
132 void updateParametersFromFilter();
133 FilmStripKnob* addNormalKnob(int x, int y, TalCore* const ownerFilter, Image knobImage, const int parameter);
134 void setTooltip(Slider* slider);
136 // handy wrapper method to avoid having to cast the filter to a DemoJuceFilter
137 // every time we need it..
138 TalCore* getFilter() const throw() { return (TalCore*) getAudioProcessor(); }
142 #endif