labels follow edits fix, group only ungrouped edits, add reset to 7 plugins, add...
[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 "vframe.h"
36
37 #include <math.h>
38 #include <stdint.h>
39 #include <string.h>
40
41
42
43
44 #define SMEAR 0
45 #define BLACKEN 1
46
47
48
49 class WaveEffect;
50 class WaveWindow;
51 class WaveReset;
52
53 class WaveConfig
54 {
55 public:
56         WaveConfig();
57
58         void reset();
59         void copy_from(WaveConfig &src);
60         int equivalent(WaveConfig &src);
61         void interpolate(WaveConfig &prev,
62                 WaveConfig &next,
63                 long prev_frame,
64                 long next_frame,
65                 long current_frame);
66         int mode;
67         int reflective;
68         float amplitude;
69         float phase;
70         float wavelength;
71 };
72
73 class WaveSmear : public BC_Radial
74 {
75 public:
76         WaveSmear(WaveEffect *plugin, WaveWindow *window, int x, int y);
77         int handle_event();
78         WaveEffect *plugin;
79         WaveWindow *window;
80 };
81
82 class WaveBlacken : public BC_Radial
83 {
84 public:
85         WaveBlacken(WaveEffect *plugin, WaveWindow *window, int x, int y);
86         int handle_event();
87         WaveEffect *plugin;
88         WaveWindow *window;
89 };
90
91
92 class WaveReflective : public BC_CheckBox
93 {
94 public:
95         WaveReflective(WaveEffect *plugin, int x, int y);
96         int handle_event();
97         WaveEffect *plugin;
98 };
99
100 class WaveAmplitude : public BC_FSlider
101 {
102 public:
103         WaveAmplitude(WaveEffect *plugin, int x, int y);
104         int handle_event();
105         WaveEffect *plugin;
106 };
107
108 class WavePhase : public BC_FSlider
109 {
110 public:
111         WavePhase(WaveEffect *plugin, int x, int y);
112         int handle_event();
113         WaveEffect *plugin;
114 };
115
116 class WaveLength : public BC_FSlider
117 {
118 public:
119         WaveLength(WaveEffect *plugin, int x, int y);
120         int handle_event();
121         WaveEffect *plugin;
122 };
123
124 class WaveReset : public BC_GenericButton
125 {
126 public:
127         WaveReset(WaveEffect *plugin, WaveWindow *gui, int x, int y);
128         ~WaveReset();
129         int handle_event();
130         WaveEffect *plugin;
131         WaveWindow *gui;
132 };
133
134
135
136
137
138
139
140 class WaveWindow : public PluginClientWindow
141 {
142 public:
143         WaveWindow(WaveEffect *plugin);
144         ~WaveWindow();
145         void create_objects();
146         void update_mode();
147         void update();
148
149         WaveEffect *plugin;
150 //      WaveSmear *smear;
151 //      WaveBlacken *blacken;
152 //      WaveReflective *reflective;
153         WaveAmplitude *amplitude;
154         WavePhase *phase;
155         WaveLength *wavelength;
156         WaveReset *reset;
157 };
158
159
160
161
162
163
164
165 class WaveServer : public LoadServer
166 {
167 public:
168         WaveServer(WaveEffect *plugin, int cpus);
169         void init_packages();
170         LoadClient* new_client();
171         LoadPackage* new_package();
172         WaveEffect *plugin;
173 };
174
175 class WavePackage : public LoadPackage
176 {
177 public:
178         WavePackage();
179         int row1, row2;
180 };
181
182 class WaveUnit : public LoadClient
183 {
184 public:
185         WaveUnit(WaveEffect *plugin, WaveServer *server);
186         void process_package(LoadPackage *package);
187         WaveEffect *plugin;
188 };
189
190
191
192
193
194
195
196
197
198 class WaveEffect : public PluginVClient
199 {
200 public:
201         WaveEffect(PluginServer *server);
202         ~WaveEffect();
203
204         PLUGIN_CLASS_MEMBERS(WaveConfig)
205         int process_realtime(VFrame *input, VFrame *output);
206         int is_realtime();
207         void save_data(KeyFrame *keyframe);
208         void read_data(KeyFrame *keyframe);
209         void update_gui();
210
211         VFrame *temp_frame;
212         VFrame *input, *output;
213         WaveServer *engine;
214 };
215
216 #endif
217