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