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);
221 class CWindowDisableOpenGLMasking : public BC_CheckBox
224 CWindowDisableOpenGLMasking(CWindowToolGUI *gui, int x, int y);
229 class CWindowMaskGUI : public CWindowToolGUI
232 CWindowMaskGUI(MWindow *mwindow, CWindowTool *thread);
234 void create_objects();
237 void get_keyframe(Track* &track, MaskAutos* &autos, MaskAuto* &keyframe,
238 SubMask* &mask, MaskPoint* &point, int create_it);
239 void update_preview();
242 CWindowMaskMode *mode;
243 CWindowMaskFeather *feather;
244 CWindowMaskDelete *delete_point;
245 CWindowMaskAffectedPoint *active_point;
246 // Not necessary if all keyframes have same points
247 // CWindowMaskCycleNext *next_point;
248 // CWindowMaskCyclePrev *prev_point;
249 CWindowMaskNumber *number;
250 CWindowMaskValue *value;
251 CWindowMaskBeforePlugins *apply_before_plugins;
252 CWindowDisableOpenGLMasking *disable_opengl_masking;
257 class CWindowEyedropGUI : public CWindowToolGUI
260 CWindowEyedropGUI(MWindow *mwindow, CWindowTool *thread);
261 ~CWindowEyedropGUI();
264 void create_objects();
268 CWindowCoord *radius;
269 BC_Title *red, *green, *blue, *y, *u, *v;
270 BC_Title *rgb_hex, *yuv_hex;
271 BC_SubWindow *sample;
276 class CWindowCameraGUI : public CWindowToolGUI
279 CWindowCameraGUI(MWindow *mwindow, CWindowTool *thread);
281 void create_objects();
283 void update_preview();
285 // Update the keyframe from text boxes
287 // BezierAuto* get_keyframe();
288 CWindowCoord *x, *y, *z;
290 // Toggles for keyframe curve mode (for camera automation only)
291 CWindowCurveToggle *t_smooth, *t_linear;
294 class CWindowCameraLeft : public BC_Button
297 CWindowCameraLeft(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
300 CWindowCameraGUI *gui;
303 class CWindowCameraCenter : public BC_Button
306 CWindowCameraCenter(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
309 CWindowCameraGUI *gui;
312 class CWindowCameraRight : public BC_Button
315 CWindowCameraRight(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
318 CWindowCameraGUI *gui;
321 class CWindowCameraTop : public BC_Button
324 CWindowCameraTop(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
327 CWindowCameraGUI *gui;
330 class CWindowCameraMiddle : public BC_Button
333 CWindowCameraMiddle(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
336 CWindowCameraGUI *gui;
339 class CWindowCameraBottom : public BC_Button
342 CWindowCameraBottom(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
345 CWindowCameraGUI *gui;
348 class CWindowProjectorGUI : public CWindowToolGUI
351 CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread);
352 ~CWindowProjectorGUI();
353 void create_objects();
355 void update_preview();
357 // BezierAuto* get_keyframe();
358 CWindowCoord *x, *y, *z;
360 // Toggles for keyframe curve mode (projector automation only)
361 CWindowCurveToggle *t_smooth, *t_linear;
364 class CWindowProjectorLeft : public BC_Button
367 CWindowProjectorLeft(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
370 CWindowProjectorGUI *gui;
373 class CWindowProjectorCenter : public BC_Button
376 CWindowProjectorCenter(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
379 CWindowProjectorGUI *gui;
382 class CWindowProjectorRight : public BC_Button
385 CWindowProjectorRight(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
388 CWindowProjectorGUI *gui;
391 class CWindowProjectorTop : public BC_Button
394 CWindowProjectorTop(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
397 CWindowProjectorGUI *gui;
400 class CWindowProjectorMiddle : public BC_Button
403 CWindowProjectorMiddle(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
406 CWindowProjectorGUI *gui;
409 class CWindowProjectorBottom : public BC_Button
412 CWindowProjectorBottom(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
415 CWindowProjectorGUI *gui;
421 class CWindowRulerGUI : public CWindowToolGUI
424 CWindowRulerGUI(MWindow *mwindow, CWindowTool *thread);
426 void create_objects();