4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
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.
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.
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
25 #include "condition.inc"
26 #include "cwindowgui.inc"
28 #include "maskauto.inc"
29 #include "maskautos.inc"
30 #include "mwindow.inc"
35 class CWindowCurveToggle;
38 // This common thread supports all the tool GUI's.
39 class CWindowTool : public Thread
42 CWindowTool(MWindow *mwindow, CWindowGUI *gui);
45 // Called depending on state of toggle button
46 void start_tool(int operation);
49 // Called when window is visible
54 void update_show_window();
60 CWindowToolGUI *tool_gui;
63 Condition *input_lock;
64 Condition *output_lock;
65 // Lock run and update_values
69 class CWindowToolGUI : public BC_Window
72 CWindowToolGUI(MWindow *mwindow,
79 virtual void create_objects() {};
80 // Update the keyframe from text boxes
81 virtual void handle_event() {};
82 // Update text boxes from keyframe here
83 virtual void update() {};
84 // Update EDL and preview only
85 virtual void update_preview() {};
86 int current_operation;
89 int translation_event();
93 CWindowCoord *event_caller;
96 class CWindowCoord : public BC_TumbleTextBox
99 CWindowCoord(CWindowToolGUI *gui, int x, int y, float value, int logincrement);
100 CWindowCoord(CWindowToolGUI *gui, int x, int y, int value);
102 // Calls the window's handle_event
108 class CWindowCropOK : public BC_GenericButton
111 CWindowCropOK(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
112 // Perform the cropping operation
114 int keypress_event();
119 class CWindowCropGUI : public CWindowToolGUI
122 CWindowCropGUI(MWindow *mwindow, CWindowTool *thread);
124 void create_objects();
128 CWindowCoord *x1, *y1, *width, *height;
131 class CWindowMaskMode : public BC_PopupMenu
134 CWindowMaskMode(MWindow *mwindow, CWindowToolGUI *gui, int x, int y, const char *text);
135 void create_objects();
137 static char* mode_to_text(int mode);
138 int text_to_mode(char *text);
143 class CWindowMaskDelete : public BC_GenericButton
146 CWindowMaskDelete(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
148 int keypress_event();
153 class CWindowMaskCycleNext : public BC_GenericButton
156 CWindowMaskCycleNext(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
162 class CWindowMaskCyclePrev : public BC_GenericButton
165 CWindowMaskCyclePrev(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
171 class CWindowMaskNumber : public BC_TumbleTextBox
174 CWindowMaskNumber(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
175 ~CWindowMaskNumber();
182 class CWindowMaskAffectedPoint : public BC_TumbleTextBox
185 CWindowMaskAffectedPoint(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
186 ~CWindowMaskAffectedPoint();
193 class CWindowMaskFeather : public BC_TumbleTextBox
196 CWindowMaskFeather(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
197 ~CWindowMaskFeather();
203 class CWindowMaskValue : public BC_ISlider
206 CWindowMaskValue(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
213 class CWindowMaskBeforePlugins : public BC_CheckBox
216 CWindowMaskBeforePlugins(CWindowToolGUI *gui, int x, int y);
224 class CWindowMaskGUI : public CWindowToolGUI
227 CWindowMaskGUI(MWindow *mwindow, CWindowTool *thread);
229 void create_objects();
232 void get_keyframe(Track* &track, MaskAutos* &autos, MaskAuto* &keyframe,
233 SubMask* &mask, MaskPoint* &point, int create_it);
234 void update_preview();
237 CWindowMaskMode *mode;
238 CWindowMaskFeather *feather;
239 CWindowMaskDelete *delete_point;
240 CWindowMaskAffectedPoint *active_point;
241 // Not necessary if all keyframes have same points
242 // CWindowMaskCycleNext *next_point;
243 // CWindowMaskCyclePrev *prev_point;
244 CWindowMaskNumber *number;
245 CWindowMaskValue *value;
246 CWindowMaskBeforePlugins *apply_before_plugins;
251 class CWindowEyedropGUI : public CWindowToolGUI
254 CWindowEyedropGUI(MWindow *mwindow, CWindowTool *thread);
255 ~CWindowEyedropGUI();
258 void create_objects();
261 CWindowCoord *radius;
262 BC_Title *red, *green, *blue, *y, *u, *v;
263 BC_SubWindow *sample;
268 class CWindowCameraGUI : public CWindowToolGUI
271 CWindowCameraGUI(MWindow *mwindow, CWindowTool *thread);
273 void create_objects();
275 void update_preview();
277 // Update the keyframe from text boxes
279 // BezierAuto* get_keyframe();
280 CWindowCoord *x, *y, *z;
282 // Toggles for keyframe curve mode (for camera automation only)
283 CWindowCurveToggle *t_smooth, *t_linear;
286 class CWindowCameraLeft : public BC_Button
289 CWindowCameraLeft(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
292 CWindowCameraGUI *gui;
295 class CWindowCameraCenter : public BC_Button
298 CWindowCameraCenter(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
301 CWindowCameraGUI *gui;
304 class CWindowCameraRight : public BC_Button
307 CWindowCameraRight(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
310 CWindowCameraGUI *gui;
313 class CWindowCameraTop : public BC_Button
316 CWindowCameraTop(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
319 CWindowCameraGUI *gui;
322 class CWindowCameraMiddle : public BC_Button
325 CWindowCameraMiddle(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
328 CWindowCameraGUI *gui;
331 class CWindowCameraBottom : public BC_Button
334 CWindowCameraBottom(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
337 CWindowCameraGUI *gui;
340 class CWindowProjectorGUI : public CWindowToolGUI
343 CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread);
344 ~CWindowProjectorGUI();
345 void create_objects();
347 void update_preview();
349 // BezierAuto* get_keyframe();
350 CWindowCoord *x, *y, *z;
352 // Toggles for keyframe curve mode (projector automation only)
353 CWindowCurveToggle *t_smooth, *t_linear;
356 class CWindowProjectorLeft : public BC_Button
359 CWindowProjectorLeft(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
362 CWindowProjectorGUI *gui;
365 class CWindowProjectorCenter : public BC_Button
368 CWindowProjectorCenter(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
371 CWindowProjectorGUI *gui;
374 class CWindowProjectorRight : public BC_Button
377 CWindowProjectorRight(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
380 CWindowProjectorGUI *gui;
383 class CWindowProjectorTop : public BC_Button
386 CWindowProjectorTop(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
389 CWindowProjectorGUI *gui;
392 class CWindowProjectorMiddle : public BC_Button
395 CWindowProjectorMiddle(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
398 CWindowProjectorGUI *gui;
401 class CWindowProjectorBottom : public BC_Button
404 CWindowProjectorBottom(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
407 CWindowProjectorGUI *gui;
413 class CWindowRulerGUI : public CWindowToolGUI
416 CWindowRulerGUI(MWindow *mwindow, CWindowTool *thread);
418 void create_objects();