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