Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / compressormulti / comprmultigui.h
1 /*
2  * CINELERRA
3  * Copyright (C) 2008-2019 Adam Williams <broadcast at earthling dot net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) 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  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  *
19  */
20
21
22
23 #ifndef COMPRMULTIGUI_H
24 #define COMPRMULTIGUI_H
25
26 #include "bchash.inc"
27 #include "comprmulti.h"
28 #include "compressortools.h"
29 #include "eqcanvas.inc"
30 #include "guicast.h"
31
32 class ComprMultiWindow;
33
34
35 class ComprMultiCanvas : public CompressorCanvasBase
36 {
37 public:
38         ComprMultiCanvas(ComprMultiEffect *plugin,
39                 ComprMultiWindow *window, int x, int y, int w, int h);
40         void update_window();
41 };
42
43 class ComprMultiBand : public BC_Radial
44 {
45 public:
46         ComprMultiBand(ComprMultiWindow *window,
47                 ComprMultiEffect *plugin, int x, int y, int number, char *text);
48         int handle_event();
49
50         ComprMultiWindow *window;
51         ComprMultiEffect *plugin;
52 // 0 - (TOTAL_BANDS-1)
53         int number;
54 };
55
56
57 class ComprMultiReaction : public BC_TumbleTextBox
58 {
59 public:
60         ComprMultiReaction(ComprMultiEffect *plugin,
61                         ComprMultiWindow *window, int x, int y);
62         int handle_event();
63         ComprMultiEffect *plugin;
64 };
65
66 class ComprMultiX : public BC_TumbleTextBox
67 {
68 public:
69         ComprMultiX(ComprMultiEffect *plugin,
70                         ComprMultiWindow *window, int x, int y);
71         int handle_event();
72         ComprMultiEffect *plugin;
73         ComprMultiWindow *window;
74 };
75
76 class ComprMultiY : public BC_TumbleTextBox
77 {
78 public:
79         ComprMultiY(ComprMultiEffect *plugin,
80                         ComprMultiWindow *window, int x, int y);
81         int handle_event();
82         ComprMultiEffect *plugin;
83         ComprMultiWindow *window;
84 };
85
86 class ComprMultiTrigger : public BC_TumbleTextBox
87 {
88 public:
89         ComprMultiTrigger(ComprMultiEffect *plugin,
90                         ComprMultiWindow *window, int x, int y);
91         int handle_event();
92         ComprMultiEffect *plugin;
93 };
94
95 class ComprMultiDecay : public BC_TumbleTextBox
96 {
97 public:
98         ComprMultiDecay(ComprMultiEffect *plugin,
99                         ComprMultiWindow *window, int x, int y);
100         int handle_event();
101         ComprMultiEffect *plugin;
102 };
103
104
105 class ComprMultiClear : public BC_GenericButton
106 {
107 public:
108         ComprMultiClear(ComprMultiEffect *plugin,
109                         ComprMultiWindow *window, int x, int y);
110         int handle_event();
111         ComprMultiEffect *plugin;
112         ComprMultiWindow *window;
113 };
114
115 class ComprMultiReset : public BC_GenericButton
116 {
117 public:
118         ComprMultiReset(ComprMultiEffect *plugin,
119                         ComprMultiWindow *window, int x, int y);
120         int handle_event();
121         ComprMultiEffect *plugin;
122         ComprMultiWindow *window;
123 };
124
125 class ComprMultiSmooth : public BC_CheckBox
126 {
127 public:
128         ComprMultiSmooth(ComprMultiEffect *plugin, int x, int y);
129         int handle_event();
130         ComprMultiEffect *plugin;
131 };
132
133 class ComprMultiSolo : public BC_CheckBox
134 {
135 public:
136         ComprMultiSolo(ComprMultiEffect *plugin, int x, int y);
137         int handle_event();
138         ComprMultiEffect *plugin;
139 };
140
141 class ComprMultiBypass : public BC_CheckBox
142 {
143 public:
144         ComprMultiBypass(ComprMultiEffect *plugin, int x, int y);
145         int handle_event();
146         ComprMultiEffect *plugin;
147 };
148
149 class ComprMultiInput : public BC_PopupMenu
150 {
151 public:
152         ComprMultiInput(ComprMultiEffect *plugin,
153                         ComprMultiWindow *window, int x, int y);
154         void create_objects();
155         int handle_event();
156         static const char* value_to_text(int value);
157         static int text_to_value(char *text);
158         ComprMultiEffect *plugin;
159         ComprMultiWindow *window;
160 };
161
162
163 class ComprMultiFPot : public BC_FPot
164 {
165 public:
166         ComprMultiFPot(ComprMultiWindow *gui, ComprMultiEffect *plugin,
167                         int x, int y, double *output, double min, double max);
168         int handle_event();
169         ComprMultiWindow *gui;
170         ComprMultiEffect *plugin;
171         double *output;
172 };
173
174 class ComprMultiQPot : public BC_QPot
175 {
176 public:
177         ComprMultiQPot(ComprMultiWindow *gui, ComprMultiEffect *plugin,
178                 int x, int y, int *output);
179         int handle_event();
180         ComprMultiWindow *gui;
181         ComprMultiEffect *plugin;
182         int *output;
183 };
184
185
186 class ComprMultiSize : public BC_PopupMenu
187 {
188 public:
189         ComprMultiSize(ComprMultiWindow *gui,
190                         ComprMultiEffect *plugin, int x, int y);
191         int handle_event();
192         void create_objects();           // add initial items
193         void update(int size);
194         ComprMultiWindow *gui;
195         ComprMultiEffect *plugin;       
196 };
197
198 class ComprMultiMkupGain : public BC_FPot
199 {
200 public:
201         ComprMultiMkupGain(ComprMultiEffect *plugin, ComprMultiWindow *window,
202                         int x, int y, double *output, double min, double max);
203         int handle_event();
204         ComprMultiWindow *window;
205         ComprMultiEffect *plugin;
206         double *output;
207 };
208
209
210 class ComprMultiWindow : public PluginClientWindow
211 {
212 public:
213         ComprMultiWindow(ComprMultiEffect *plugin);
214         ~ComprMultiWindow();
215         void create_objects();
216         void update();
217 // draw the dynamic range canvas
218         void update_canvas();
219 // draw the bandpass canvas
220         void update_eqcanvas();
221         int resize_event(int w, int h); 
222
223         ComprMultiCanvas *canvas;
224         ComprMultiReaction *reaction;
225         ComprMultiClear *clear;
226         ComprMultiReset *reset;
227         ComprMultiX *x_text;
228         ComprMultiY *y_text;
229         ComprMultiTrigger *trigger;
230         ComprMultiDecay *decay;
231         ComprMultiSmooth *smooth;
232         ComprMultiSolo *solo;
233         ComprMultiBypass *bypass;
234         ComprMultiInput *input;
235         BC_Meter *in;
236         BC_Meter *gain_change;
237         ComprMultiBand *band[TOTAL_BANDS];
238         CompressorGainFrame *gain_frame;
239         CompressorFreqFrame *freq_frame;
240
241         ComprMultiQPot *freq1;
242         ComprMultiQPot *freq2;
243         ComprMultiFPot *q;
244         ComprMultiMkupGain *mkup_gain;
245         ComprMultiSize *size;
246         EQCanvas *eqcanvas;
247
248         ComprMultiEffect *plugin;
249         BC_Hash *defaults;
250 };
251
252 #endif
253