modify clr btn 16 plugins, add regdmp for sigtraps, rework mask_engine, mask rotate...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / wave / wave.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  *
20  */
21
22 #ifndef WAVE_H
23 #define WAVE_H
24
25
26 #include "bcdisplayinfo.h"
27 #include "clip.h"
28 #include "bchash.h"
29 #include "filexml.h"
30 #include "guicast.h"
31 #include "keyframe.h"
32 #include "language.h"
33 #include "loadbalance.h"
34 #include "pluginvclient.h"
35 #include "theme.h"
36 #include "vframe.h"
37
38 #include <math.h>
39 #include <stdint.h>
40 #include <string.h>
41
42
43
44
45 #define SMEAR 0
46 #define BLACKEN 1
47
48 #define RESET_DEFAULT_SETTINGS 10
49 #define RESET_ALL        0
50 #define RESET_AMPLITUDE  1
51 #define RESET_PHASE      2
52 #define RESET_WAVELENGTH 3
53
54 class WaveEffect;
55 class WaveWindow;
56 class WaveReset;
57 class WaveDefaultSettings;
58 class WaveSliderClr;
59
60 class WaveConfig
61 {
62 public:
63         WaveConfig();
64
65         void reset(int clear);
66         void copy_from(WaveConfig &src);
67         int equivalent(WaveConfig &src);
68         void interpolate(WaveConfig &prev,
69                 WaveConfig &next,
70                 long prev_frame,
71                 long next_frame,
72                 long current_frame);
73         int mode;
74         int reflective;
75         float amplitude;
76         float phase;
77         float wavelength;
78 };
79
80 class WaveSmear : public BC_Radial
81 {
82 public:
83         WaveSmear(WaveEffect *plugin, WaveWindow *window, int x, int y);
84         int handle_event();
85         WaveEffect *plugin;
86         WaveWindow *window;
87 };
88
89 class WaveBlacken : public BC_Radial
90 {
91 public:
92         WaveBlacken(WaveEffect *plugin, WaveWindow *window, int x, int y);
93         int handle_event();
94         WaveEffect *plugin;
95         WaveWindow *window;
96 };
97
98
99 class WaveReflective : public BC_CheckBox
100 {
101 public:
102         WaveReflective(WaveEffect *plugin, int x, int y);
103         int handle_event();
104         WaveEffect *plugin;
105 };
106
107 class WaveAmplitude : public BC_FSlider
108 {
109 public:
110         WaveAmplitude(WaveEffect *plugin, int x, int y);
111         int handle_event();
112         WaveEffect *plugin;
113 };
114
115 class WavePhase : public BC_FSlider
116 {
117 public:
118         WavePhase(WaveEffect *plugin, int x, int y);
119         int handle_event();
120         WaveEffect *plugin;
121 };
122
123 class WaveLength : public BC_FSlider
124 {
125 public:
126         WaveLength(WaveEffect *plugin, int x, int y);
127         int handle_event();
128         WaveEffect *plugin;
129 };
130
131 class WaveReset : public BC_GenericButton
132 {
133 public:
134         WaveReset(WaveEffect *plugin, WaveWindow *gui, int x, int y);
135         ~WaveReset();
136         int handle_event();
137         WaveEffect *plugin;
138         WaveWindow *gui;
139 };
140
141 class WaveDefaultSettings : public BC_GenericButton
142 {
143 public:
144         WaveDefaultSettings(WaveEffect *plugin, WaveWindow *gui, int x, int y, int w);
145         ~WaveDefaultSettings();
146         int handle_event();
147         WaveEffect *plugin;
148         WaveWindow *gui;
149 };
150
151 class WaveSliderClr : public BC_Button
152 {
153 public:
154         WaveSliderClr(WaveEffect *plugin, WaveWindow *gui, int x, int y, int w, int clear);
155         ~WaveSliderClr();
156         int handle_event();
157         WaveEffect *plugin;
158         WaveWindow *gui;
159         int clear;
160 };
161
162
163
164
165
166 class WaveWindow : public PluginClientWindow
167 {
168 public:
169         WaveWindow(WaveEffect *plugin);
170         ~WaveWindow();
171         void create_objects();
172         void update_mode();
173         void update_gui(int clear);
174
175         WaveEffect *plugin;
176 //      WaveSmear *smear;
177 //      WaveBlacken *blacken;
178 //      WaveReflective *reflective;
179         WaveAmplitude *amplitude;
180         WavePhase *phase;
181         WaveLength *wavelength;
182         WaveReset *reset;
183         WaveDefaultSettings *default_settings;
184         WaveSliderClr *amplitudeClr;
185         WaveSliderClr *phaseClr;
186         WaveSliderClr *wavelengthClr;
187 };
188
189
190
191
192
193
194
195 class WaveServer : public LoadServer
196 {
197 public:
198         WaveServer(WaveEffect *plugin, int cpus);
199         void init_packages();
200         LoadClient* new_client();
201         LoadPackage* new_package();
202         WaveEffect *plugin;
203 };
204
205 class WavePackage : public LoadPackage
206 {
207 public:
208         WavePackage();
209         int row1, row2;
210 };
211
212 class WaveUnit : public LoadClient
213 {
214 public:
215         WaveUnit(WaveEffect *plugin, WaveServer *server);
216         void process_package(LoadPackage *package);
217         WaveEffect *plugin;
218 };
219
220
221
222
223
224
225
226
227
228 class WaveEffect : public PluginVClient
229 {
230 public:
231         WaveEffect(PluginServer *server);
232         ~WaveEffect();
233
234         PLUGIN_CLASS_MEMBERS(WaveConfig)
235         int process_realtime(VFrame *input, VFrame *output);
236         int is_realtime();
237         void save_data(KeyFrame *keyframe);
238         void read_data(KeyFrame *keyframe);
239         void update_gui();
240
241         VFrame *temp_frame;
242         VFrame *input, *output;
243         WaveServer *engine;
244 };
245
246 #endif
247