new/reworked audio plugins ported from hv72 compressor/multi/reverb, glyph workaround...
[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, ComprMultiWindow *window, int x, int y);
70         int handle_event();
71         ComprMultiEffect *plugin;
72 };
73
74 class ComprMultiY : public BC_TumbleTextBox
75 {
76 public:
77         ComprMultiY(ComprMultiEffect *plugin, ComprMultiWindow *window, int x, int y);
78         int handle_event();
79         ComprMultiEffect *plugin;
80 };
81
82 class ComprMultiTrigger : public BC_TumbleTextBox
83 {
84 public:
85         ComprMultiTrigger(ComprMultiEffect *plugin, ComprMultiWindow *window, int x, int y);
86         int handle_event();
87         ComprMultiEffect *plugin;
88 };
89
90 class ComprMultiDecay : public BC_TumbleTextBox
91 {
92 public:
93         ComprMultiDecay(ComprMultiEffect *plugin, ComprMultiWindow *window, int x, int y);
94         int handle_event();
95         ComprMultiEffect *plugin;
96 };
97
98
99 class ComprMultiClear : public BC_GenericButton
100 {
101 public:
102         ComprMultiClear(ComprMultiEffect *plugin, int x, int y);
103         int handle_event();
104         ComprMultiEffect *plugin;
105 };
106
107 class ComprMultiSmooth : public BC_CheckBox
108 {
109 public:
110         ComprMultiSmooth(ComprMultiEffect *plugin, int x, int y);
111         int handle_event();
112         ComprMultiEffect *plugin;
113 };
114
115 class ComprMultiSolo : public BC_CheckBox
116 {
117 public:
118         ComprMultiSolo(ComprMultiEffect *plugin, int x, int y);
119         int handle_event();
120         ComprMultiEffect *plugin;
121 };
122
123 class ComprMultiBypass : public BC_CheckBox
124 {
125 public:
126         ComprMultiBypass(ComprMultiEffect *plugin, int x, int y);
127         int handle_event();
128         ComprMultiEffect *plugin;
129 };
130
131 class ComprMultiInput : public BC_PopupMenu
132 {
133 public:
134         ComprMultiInput(ComprMultiEffect *plugin, int x, int y);
135         void create_objects();
136         int handle_event();
137         static const char* value_to_text(int value);
138         static int text_to_value(char *text);
139         ComprMultiEffect *plugin;
140 };
141
142
143 class ComprMultiFPot : public BC_FPot
144 {
145 public:
146         ComprMultiFPot(ComprMultiWindow *gui, ComprMultiEffect *plugin,
147                         int x, int y, double *output, double min, double max);
148         int handle_event();
149         ComprMultiWindow *gui;
150         ComprMultiEffect *plugin;
151         double *output;
152 };
153
154 class ComprMultiQPot : public BC_QPot
155 {
156 public:
157         ComprMultiQPot(ComprMultiWindow *gui, ComprMultiEffect *plugin,
158                 int x, int y, int *output);
159         int handle_event();
160         ComprMultiWindow *gui;
161         ComprMultiEffect *plugin;
162         int *output;
163 };
164
165
166 class ComprMultiSize : public BC_PopupMenu
167 {
168 public:
169         ComprMultiSize(ComprMultiWindow *gui,
170                 ComprMultiEffect *plugin, int x, int y);
171         int handle_event();
172         void create_objects();           // add initial items
173         void update(int size);
174         ComprMultiWindow *gui;
175         ComprMultiEffect *plugin;       
176 };
177
178
179 class ComprMultiWindow : public PluginClientWindow
180 {
181 public:
182         ComprMultiWindow(ComprMultiEffect *plugin);
183         ~ComprMultiWindow();
184         void create_objects();
185         void update();
186 // draw the dynamic range canvas
187         void update_canvas();
188 // draw the bandpass canvas
189         void update_eqcanvas();
190         int resize_event(int w, int h); 
191
192         ComprMultiCanvas *canvas;
193         ComprMultiReaction *reaction;
194         ComprMultiClear *clear;
195         ComprMultiX *x_text;
196         ComprMultiY *y_text;
197         ComprMultiTrigger *trigger;
198         ComprMultiDecay *decay;
199         ComprMultiSmooth *smooth;
200         ComprMultiSolo *solo;
201         ComprMultiBypass *bypass;
202         ComprMultiInput *input;
203         BC_Meter *in;
204         BC_Meter *gain_change;
205         ComprMultiBand *band[TOTAL_BANDS];
206         CompressorGainFrame *gain_frame;
207         CompressorFreqFrame *freq_frame;
208
209         ComprMultiQPot *freq1;
210         ComprMultiQPot *freq2;
211         ComprMultiFPot *q;
212         ComprMultiSize *size;
213         EQCanvas *eqcanvas;
214
215         ComprMultiEffect *plugin;
216         BC_Hash *defaults;
217 };
218
219 #endif
220