Credit Andrew - fix vorbis audio which was scratchy and ensure aging plugin does...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / motion-hv / motionwindow-hv.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 #include "guicast.h"
23 #include "motion-hv.inc"
24
25 class MasterLayer : public BC_PopupMenu
26 {
27 public:
28         MasterLayer(MotionHVMain *plugin, MotionHVWindow *gui, int x, int y);
29         int handle_event();
30         void create_objects();
31         static int calculate_w(MotionHVWindow *gui);
32         static int from_text(char *text);
33         static char* to_text(int mode);
34         MotionHVMain *plugin;
35         MotionHVWindow *gui;
36 };
37
38 class ActionType : public BC_PopupMenu
39 {
40 public:
41         ActionType(MotionHVMain *plugin, MotionHVWindow *gui, int x, int y);
42         int handle_event();
43         void create_objects();
44         static int calculate_w(MotionHVWindow *gui);
45         static int from_text(char *text);
46         static char* to_text(int mode);
47         MotionHVMain *plugin;
48         MotionHVWindow *gui;
49 };
50
51 class TrackingType : public BC_PopupMenu
52 {
53 public:
54         TrackingType(MotionHVMain *plugin, MotionHVWindow *gui, int x, int y);
55         int handle_event();
56         void create_objects();
57         static int calculate_w(MotionHVWindow *gui);
58         static int from_text(char *text);
59         static char* to_text(int mode);
60         MotionHVMain *plugin;
61         MotionHVWindow *gui;
62 };
63
64 class TrackDirection : public BC_PopupMenu
65 {
66 public:
67         TrackDirection(MotionHVMain *plugin, MotionHVWindow *gui, int x, int y);
68         int handle_event();
69         void create_objects();
70         static int calculate_w(MotionHVWindow *gui);
71         static void from_text(int *horizontal_only, int *vertical_only, char *text);
72         static char* to_text(int horizontal_only, int vertical_only);
73         MotionHVMain *plugin;
74         MotionHVWindow *gui;
75 };
76
77
78 class TrackSingleFrame : public BC_Radial
79 {
80 public:
81         TrackSingleFrame(MotionHVMain *plugin,
82                 MotionHVWindow *gui,
83                 int x,
84                 int y);
85         int handle_event();
86         MotionHVMain *plugin;
87         MotionHVWindow *gui;
88 };
89
90 class TrackFrameNumber : public BC_TextBox
91 {
92 public:
93         TrackFrameNumber(MotionHVMain *plugin,
94                 MotionHVWindow *gui,
95                 int x,
96                 int y);
97         int handle_event();
98         MotionHVMain *plugin;
99         MotionHVWindow *gui;
100 };
101
102 class TrackPreviousFrame : public BC_Radial
103 {
104 public:
105         TrackPreviousFrame(MotionHVMain *plugin,
106                 MotionHVWindow *gui,
107                 int x,
108                 int y);
109         int handle_event();
110         MotionHVMain *plugin;
111         MotionHVWindow *gui;
112 };
113
114 class PreviousFrameSameBlock : public BC_Radial
115 {
116 public:
117         PreviousFrameSameBlock(MotionHVMain *plugin,
118                 MotionHVWindow *gui,
119                 int x,
120                 int y);
121         int handle_event();
122         MotionHVMain *plugin;
123         MotionHVWindow *gui;
124 };
125
126 class GlobalRange : public BC_IPot
127 {
128 public:
129         GlobalRange(MotionHVMain *plugin,
130                 int x,
131                 int y,
132                 int *value);
133         int handle_event();
134         MotionHVMain *plugin;
135         int *value;
136 };
137
138 class RotationRange : public BC_IPot
139 {
140 public:
141         RotationRange(MotionHVMain *plugin,
142                 int x,
143                 int y);
144         int handle_event();
145         MotionHVMain *plugin;
146 };
147
148 class RotationCenter : public BC_IPot
149 {
150 public:
151         RotationCenter(MotionHVMain *plugin,
152                 int x,
153                 int y);
154         int handle_event();
155         MotionHVMain *plugin;
156 };
157
158 class BlockSize : public BC_IPot
159 {
160 public:
161         BlockSize(MotionHVMain *plugin,
162                 int x,
163                 int y,
164                 int *value);
165         int handle_event();
166         MotionHVMain *plugin;
167         int *value;
168 };
169
170 class MotionHVBlockX : public BC_FPot
171 {
172 public:
173         MotionHVBlockX(MotionHVMain *plugin,
174                 MotionHVWindow *gui,
175                 int x,
176                 int y);
177         int handle_event();
178         MotionHVWindow *gui;
179         MotionHVMain *plugin;
180 };
181
182 class MotionHVBlockY : public BC_FPot
183 {
184 public:
185         MotionHVBlockY(MotionHVMain *plugin,
186                 MotionHVWindow *gui,
187                 int x,
188                 int y);
189         int handle_event();
190         MotionHVWindow *gui;
191         MotionHVMain *plugin;
192 };
193
194 class MotionHVBlockXText : public BC_TextBox
195 {
196 public:
197         MotionHVBlockXText(MotionHVMain *plugin,
198                 MotionHVWindow *gui,
199                 int x,
200                 int y);
201         int handle_event();
202         MotionHVWindow *gui;
203         MotionHVMain *plugin;
204 };
205
206 class MotionHVBlockYText : public BC_TextBox
207 {
208 public:
209         MotionHVBlockYText(MotionHVMain *plugin,
210                 MotionHVWindow *gui,
211                 int x,
212                 int y);
213         int handle_event();
214         MotionHVWindow *gui;
215         MotionHVMain *plugin;
216 };
217
218 // class GlobalSearchPositions : public BC_PopupMenu
219 // {
220 // public:
221 //      GlobalSearchPositions(MotionHVMain *plugin,
222 //              int x,
223 //              int y,
224 //              int w);
225 //      void create_objects();
226 //      int handle_event();
227 //      MotionHVMain *plugin;
228 // };
229 //
230 // class RotationSearchPositions : public BC_PopupMenu
231 // {
232 // public:
233 //      RotationSearchPositions(MotionHVMain *plugin,
234 //              int x,
235 //              int y,
236 //              int w);
237 //      void create_objects();
238 //      int handle_event();
239 //      MotionHVMain *plugin;
240 // };
241
242 class MotionHVMagnitude : public BC_IPot
243 {
244 public:
245         MotionHVMagnitude(MotionHVMain *plugin,
246                 int x,
247                 int y);
248         int handle_event();
249         MotionHVMain *plugin;
250 };
251
252 class MotionHVRMagnitude : public BC_IPot
253 {
254 public:
255         MotionHVRMagnitude(MotionHVMain *plugin,
256                 int x,
257                 int y);
258         int handle_event();
259         MotionHVMain *plugin;
260 };
261
262 class MotionHVReturnSpeed : public BC_IPot
263 {
264 public:
265         MotionHVReturnSpeed(MotionHVMain *plugin,
266                 int x,
267                 int y);
268         int handle_event();
269         MotionHVMain *plugin;
270 };
271
272
273 class MotionHVRReturnSpeed : public BC_IPot
274 {
275 public:
276         MotionHVRReturnSpeed(MotionHVMain *plugin,
277                 int x,
278                 int y);
279         int handle_event();
280         MotionHVMain *plugin;
281 };
282
283
284 class MotionHVDrawVectors : public BC_CheckBox
285 {
286 public:
287         MotionHVDrawVectors(MotionHVMain *plugin,
288                 MotionHVWindow *gui,
289                 int x,
290                 int y);
291         int handle_event();
292         MotionHVMain *plugin;
293         MotionHVWindow *gui;
294 };
295
296 class AddTrackedFrameOffset : public BC_CheckBox
297 {
298 public:
299         AddTrackedFrameOffset(MotionHVMain *plugin,
300                 MotionHVWindow *gui,
301                 int x,
302                 int y);
303         int handle_event();
304         MotionHVWindow *gui;
305         MotionHVMain *plugin;
306 };
307
308 // class MotionHVGlobal : public BC_CheckBox
309 // {
310 // public:
311 //      MotionHVGlobal(MotionHVMain *plugin,
312 //              MotionHVWindow *gui,
313 //              int x,
314 //              int y);
315 //      int handle_event();
316 //      MotionHVWindow *gui;
317 //      MotionHVMain *plugin;
318 // };
319
320 class MotionHVRotate : public BC_CheckBox
321 {
322 public:
323         MotionHVRotate(MotionHVMain *plugin,
324                 MotionHVWindow *gui,
325                 int x,
326                 int y);
327         int handle_event();
328         MotionHVWindow *gui;
329         MotionHVMain *plugin;
330 };
331
332
333
334 class MotionHVWindow : public PluginClientWindow
335 {
336 public:
337         MotionHVWindow(MotionHVMain *plugin);
338         ~MotionHVWindow();
339
340         void create_objects();
341         void update_mode();
342         char* get_radius_title();
343
344         GlobalRange *global_range_w;
345         GlobalRange *global_range_h;
346         RotationRange *rotation_range;
347         RotationCenter *rotation_center;
348         BlockSize *global_block_w;
349         BlockSize *global_block_h;
350         BlockSize *rotation_block_w;
351         BlockSize *rotation_block_h;
352         MotionHVBlockX *block_x;
353         MotionHVBlockY *block_y;
354         MotionHVBlockXText *block_x_text;
355         MotionHVBlockYText *block_y_text;
356 //      GlobalSearchPositions *global_search_positions;
357 //      RotationSearchPositions *rotation_search_positions;
358         MotionHVMagnitude *magnitude;
359         MotionHVRMagnitude *rotate_magnitude;
360         MotionHVReturnSpeed *return_speed;
361         MotionHVRReturnSpeed *rotate_return_speed;
362         ActionType *action_type;
363         MotionHVDrawVectors *vectors;
364 //      MotionHVGlobal *global;
365         MotionHVRotate *rotate;
366         AddTrackedFrameOffset *addtrackedframeoffset;
367         TrackSingleFrame *track_single;
368         TrackFrameNumber *track_frame_number;
369         TrackPreviousFrame *track_previous;
370         PreviousFrameSameBlock *previous_same;
371         MasterLayer *master_layer;
372         TrackingType *tracking_type;
373         TrackDirection *track_direction;
374
375         MotionHVMain *plugin;
376 };
377
378
379
380
381
382
383
384
385