add auto zoombar/status color, fix 3 batchrender boobies, rotate plugin tweaks, add...
[goodguy/cinelerra.git] / cinelerra-5.1 / plugins / motion2point / 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
26 class MotionGlobal : public BC_CheckBox
27 {
28 public:
29         MotionGlobal(MotionMain2 *plugin,
30                 MotionWindow *gui,
31                 int x,
32                 int y,
33                 int *value,
34                 char *text);
35         int handle_event();
36         MotionWindow *gui;
37         MotionMain2 *plugin;
38         int *value;
39 };
40
41 class MasterLayer : public BC_PopupMenu
42 {
43 public:
44         MasterLayer(MotionMain2 *plugin, MotionWindow *gui, int x, int y);
45         int handle_event();
46         void create_objects();
47         static int calculate_w(MotionWindow *gui);
48         static int from_text(char *text);
49         static char* to_text(int mode);
50         MotionMain2 *plugin;
51         MotionWindow *gui;
52 };
53
54 class Action : public BC_PopupMenu
55 {
56 public:
57         Action(MotionMain2 *plugin, MotionWindow *gui, int x, int y);
58         int handle_event();
59         void create_objects();
60         static int calculate_w(MotionWindow *gui);
61         static int from_text(char *text);
62         static char* to_text(int mode);
63         MotionMain2 *plugin;
64         MotionWindow *gui;
65 };
66
67 class Calculation : public BC_PopupMenu
68 {
69 public:
70         Calculation(MotionMain2 *plugin, MotionWindow *gui, int x, int y);
71         int handle_event();
72         void create_objects();
73         static int calculate_w(MotionWindow *gui);
74         static int from_text(char *text);
75         static char* to_text(int mode);
76         MotionMain2 *plugin;
77         MotionWindow *gui;
78 };
79
80 class TrackingDirection : public BC_PopupMenu
81 {
82 public:
83         TrackingDirection(MotionMain2 *plugin, MotionWindow *gui, int x, int y);
84         int handle_event();
85         void create_objects();
86         static int calculate_w(MotionWindow *gui);
87         static void from_text(int *horizontal_only, int *vertical_only, char *text);
88         static char* to_text(int horizontal_only, int vertical_only);
89         MotionMain2 *plugin;
90         MotionWindow *gui;
91 };
92
93
94 class TrackSingleFrame : public BC_Radial
95 {
96 public:
97         TrackSingleFrame(MotionMain2 *plugin,
98                 MotionWindow *gui,
99                 int x,
100                 int y);
101         int handle_event();
102         MotionMain2 *plugin;
103         MotionWindow *gui;
104 };
105
106 class TrackFrameNumber : public BC_TextBox
107 {
108 public:
109         TrackFrameNumber(MotionMain2 *plugin,
110                 MotionWindow *gui,
111                 int x,
112                 int y);
113         int handle_event();
114         MotionMain2 *plugin;
115         MotionWindow *gui;
116 };
117
118 class TrackPreviousFrame : public BC_Radial
119 {
120 public:
121         TrackPreviousFrame(MotionMain2 *plugin,
122                 MotionWindow *gui,
123                 int x,
124                 int y);
125         int handle_event();
126         MotionMain2 *plugin;
127         MotionWindow *gui;
128 };
129
130 class PreviousFrameSameBlock : public BC_Radial
131 {
132 public:
133         PreviousFrameSameBlock(MotionMain2 *plugin,
134                 MotionWindow *gui,
135                 int x,
136                 int y);
137         int handle_event();
138         MotionMain2 *plugin;
139         MotionWindow *gui;
140 };
141
142 class MotionPot : public BC_IPot
143 {
144 public:
145         MotionPot(MotionMain2 *plugin,
146                 int x,
147                 int y,
148                 int *value,
149                 int min,
150                 int max);
151         int handle_event();
152         MotionMain2 *plugin;
153         int *value;
154 };
155
156 class MotionBlockX : public BC_FPot
157 {
158 public:
159         MotionBlockX(MotionMain2 *plugin,
160                 MotionWindow *gui,
161                 int x,
162                 int y,
163                 int number);
164         int handle_event();
165         MotionWindow *gui;
166         MotionMain2 *plugin;
167         int number;
168 };
169
170 class MotionBlockY : public BC_FPot
171 {
172 public:
173         MotionBlockY(MotionMain2 *plugin,
174                 MotionWindow *gui,
175                 int x,
176                 int y,
177                 int number);
178         int handle_event();
179         MotionWindow *gui;
180         MotionMain2 *plugin;
181         int number;
182 };
183
184 class MotionBlockXText : public BC_TextBox
185 {
186 public:
187         MotionBlockXText(MotionMain2 *plugin,
188                 MotionWindow *gui,
189                 int x,
190                 int y,
191                 int number);
192         int handle_event();
193         MotionWindow *gui;
194         MotionMain2 *plugin;
195         int number;
196 };
197
198 class MotionBlockYText : public BC_TextBox
199 {
200 public:
201         MotionBlockYText(MotionMain2 *plugin,
202                 MotionWindow *gui,
203                 int x,
204                 int y,
205                 int number);
206         int handle_event();
207         MotionWindow *gui;
208         MotionMain2 *plugin;
209         int number;
210 };
211
212 class GlobalSearchPositions : public BC_PopupMenu
213 {
214 public:
215         GlobalSearchPositions(MotionMain2 *plugin,
216                 int x,
217                 int y,
218                 int w);
219         void create_objects();
220         int handle_event();
221         MotionMain2 *plugin;
222 };
223
224
225
226 class MotionMagnitude : public BC_IPot
227 {
228 public:
229         MotionMagnitude(MotionMain2 *plugin,
230                 int x,
231                 int y);
232         int handle_event();
233         MotionMain2 *plugin;
234 };
235
236 class MotionReturnSpeed : public BC_IPot
237 {
238 public:
239         MotionReturnSpeed(MotionMain2 *plugin,
240                 int x,
241                 int y);
242         int handle_event();
243         MotionMain2 *plugin;
244 };
245
246
247
248 class MotionDrawVectors : public BC_CheckBox
249 {
250 public:
251         MotionDrawVectors(MotionMain2 *plugin,
252                 MotionWindow *gui,
253                 int x,
254                 int y,
255                 int number);
256         int handle_event();
257         MotionMain2 *plugin;
258         MotionWindow *gui;
259         int number;
260 };
261
262
263
264
265 class MotionWindow : public PluginClientWindow
266 {
267 public:
268         MotionWindow(MotionMain2 *plugin);
269         ~MotionWindow();
270
271         void create_objects();
272         void update_mode();
273         char* get_radius_title();
274
275         MotionGlobal *global[TOTAL_POINTS];
276         MotionPot *global_range_w[TOTAL_POINTS];
277         MotionPot *global_range_h[TOTAL_POINTS];
278         MotionPot *global_block_w[TOTAL_POINTS];
279         MotionPot *global_block_h[TOTAL_POINTS];
280         MotionPot *global_origin_x[TOTAL_POINTS];
281         MotionPot *global_origin_y[TOTAL_POINTS];
282         MotionBlockX *block_x[TOTAL_POINTS];
283         MotionBlockY *block_y[TOTAL_POINTS];
284         MotionBlockXText *block_x_text[TOTAL_POINTS];
285         MotionBlockYText *block_y_text[TOTAL_POINTS];
286         MotionDrawVectors *vectors[TOTAL_POINTS];
287
288         GlobalSearchPositions *global_search_positions;
289         MotionMagnitude *magnitude;
290         MotionReturnSpeed *return_speed;
291         TrackSingleFrame *track_single;
292         TrackFrameNumber *track_frame_number;
293         TrackPreviousFrame *track_previous;
294         PreviousFrameSameBlock *previous_same;
295         MasterLayer *master_layer;
296         Action *action;
297         Calculation *calculation;
298         TrackingDirection *tracking_direction;
299
300         MotionMain2 *plugin;
301 };
302
303
304
305
306
307
308
309