c1f83bd042a69a0aa86c13a55ecf60b639bd4884
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / motion / 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, MotionWindow *gui, int x, int y);
82         int handle_event();
83         MotionMain *plugin;
84         MotionWindow *gui;
85 };
86
87 class TrackFrameNumber : public BC_TextBox
88 {
89 public:
90         TrackFrameNumber(MotionMain *plugin, MotionWindow *gui, int x, int y);
91         int handle_event();
92         MotionMain *plugin;
93         MotionWindow *gui;
94 };
95
96 class TrackPreviousFrame : public BC_Radial
97 {
98 public:
99         TrackPreviousFrame(MotionMain *plugin, MotionWindow *gui, int x, int y);
100         int handle_event();
101         MotionMain *plugin;
102         MotionWindow *gui;
103 };
104
105 class PreviousFrameSameBlock : public BC_Radial
106 {
107 public:
108         PreviousFrameSameBlock(MotionMain *plugin, MotionWindow *gui, int x, int y);
109         int handle_event();
110         MotionMain *plugin;
111         MotionWindow *gui;
112 };
113
114 class GlobalRange : public BC_IPot
115 {
116 public:
117         GlobalRange(MotionMain *plugin, int x, int y, int *value);
118         int handle_event();
119         MotionMain *plugin;
120         int *value;
121 };
122
123 class RotationRange : public BC_IPot
124 {
125 public:
126         RotationRange(MotionMain *plugin, int x, int y);
127         int handle_event();
128         MotionMain *plugin;
129 };
130
131 class RotationCenter : public BC_IPot
132 {
133 public:
134         RotationCenter(MotionMain *plugin, int x, int y);
135         int handle_event();
136         MotionMain *plugin;
137 };
138
139 class BlockSize : public BC_IPot
140 {
141 public:
142         BlockSize(MotionMain *plugin, int x, int y, int *value);
143         int handle_event();
144         MotionMain *plugin;
145         int *value;
146 };
147
148 class MotionBlockX : public BC_FPot
149 {
150 public:
151         MotionBlockX(MotionMain *plugin, MotionWindow *gui, int x, int y);
152         int handle_event();
153         MotionWindow *gui;
154         MotionMain *plugin;
155 };
156
157 class MotionBlockY : public BC_FPot
158 {
159 public:
160         MotionBlockY(MotionMain *plugin, MotionWindow *gui, int x, int y);
161         int handle_event();
162         MotionWindow *gui;
163         MotionMain *plugin;
164 };
165
166 class MotionBlockXText : public BC_TextBox
167 {
168 public:
169         MotionBlockXText(MotionMain *plugin, MotionWindow *gui, int x, int y);
170         int handle_event();
171         MotionWindow *gui;
172         MotionMain *plugin;
173 };
174
175 class MotionBlockYText : public BC_TextBox
176 {
177 public:
178         MotionBlockYText(MotionMain *plugin, MotionWindow *gui, int x, int y);
179         int handle_event();
180         MotionWindow *gui;
181         MotionMain *plugin;
182 };
183
184 class GlobalSearchPositions : public BC_PopupMenu
185 {
186 public:
187         GlobalSearchPositions(MotionMain *plugin, int x, int y, int w);
188         void create_objects();
189         int handle_event();
190         MotionMain *plugin;
191 };
192
193 class RotationSearchPositions : public BC_PopupMenu
194 {
195 public:
196         RotationSearchPositions(MotionMain *plugin, int x, int y, int w);
197         void create_objects();
198         int handle_event();
199         MotionMain *plugin;
200 };
201
202 class MotionMagnitude : public BC_IPot
203 {
204 public:
205         MotionMagnitude(MotionMain *plugin, int x, int y);
206         int handle_event();
207         MotionMain *plugin;
208 };
209
210 class MotionRMagnitude : public BC_IPot
211 {
212 public:
213         MotionRMagnitude(MotionMain *plugin, int x, int y);
214         int handle_event();
215         MotionMain *plugin;
216 };
217
218 class MotionReturnSpeed : public BC_IPot
219 {
220 public:
221         MotionReturnSpeed(MotionMain *plugin, int x, int y);
222         int handle_event();
223         MotionMain *plugin;
224 };
225
226
227 class MotionRReturnSpeed : public BC_IPot
228 {
229 public:
230         MotionRReturnSpeed(MotionMain *plugin, int x, int y);
231         int handle_event();
232         MotionMain *plugin;
233 };
234
235
236 class MotionDrawVectors : public BC_CheckBox
237 {
238 public:
239         MotionDrawVectors(MotionMain *plugin, MotionWindow *gui, int x, int y);
240         int handle_event();
241         MotionMain *plugin;
242         MotionWindow *gui;
243 };
244
245 class AddTrackedFrameOffset : public BC_CheckBox
246 {
247 public:
248         AddTrackedFrameOffset(MotionMain *plugin, MotionWindow *gui, int x, int y);
249         int handle_event();
250         MotionWindow *gui;
251         MotionMain *plugin;
252 };
253
254 class MotionTrackingFile : public BC_TextBox
255 {
256 public:
257         MotionTrackingFile(MotionMain *plugin, const char *filename,
258                 MotionWindow *gui, int x, int y);
259         int handle_event();
260         MotionMain *plugin;
261         MotionWindow *gui;
262 };
263
264 class MotionGlobal : public BC_CheckBox
265 {
266 public:
267         MotionGlobal(MotionMain *plugin, MotionWindow *gui, int x, int y);
268         int handle_event();
269         MotionWindow *gui;
270         MotionMain *plugin;
271 };
272
273 class MotionRotate : public BC_CheckBox
274 {
275 public:
276         MotionRotate(MotionMain *plugin, MotionWindow *gui, int x, int y);
277         int handle_event();
278         MotionWindow *gui;
279         MotionMain *plugin;
280 };
281
282
283
284 class MotionWindow : public PluginClientWindow
285 {
286 public:
287         MotionWindow(MotionMain *plugin);
288         ~MotionWindow();
289
290         void create_objects();
291         void update_mode();
292         char* get_radius_title();
293
294         GlobalRange *global_range_w;
295         GlobalRange *global_range_h;
296         RotationRange *rotation_range;
297         RotationCenter *rotation_center;
298         BlockSize *global_block_w;
299         BlockSize *global_block_h;
300         BlockSize *rotation_block_w;
301         BlockSize *rotation_block_h;
302         MotionBlockX *block_x;
303         MotionBlockY *block_y;
304         MotionBlockXText *block_x_text;
305         MotionBlockYText *block_y_text;
306         GlobalSearchPositions *global_search_positions;
307         RotationSearchPositions *rotation_search_positions;
308         MotionMagnitude *magnitude;
309         MotionRMagnitude *rotate_magnitude;
310         MotionReturnSpeed *return_speed;
311         MotionRReturnSpeed *rotate_return_speed;
312         ActionType *action_type;
313         MotionDrawVectors *vectors;
314         MotionTrackingFile *tracking_file;
315         MotionGlobal *global;
316         MotionRotate *rotate;
317         AddTrackedFrameOffset *addtrackedframeoffset;
318         TrackSingleFrame *track_single;
319         TrackFrameNumber *track_frame_number;
320         TrackPreviousFrame *track_previous;
321         PreviousFrameSameBlock *previous_same;
322         MasterLayer *master_layer;
323         TrackingType *tracking_type;
324         TrackDirection *track_direction;
325         BC_Title *pef_title;
326
327         MotionMain *plugin;
328 };
329
330