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();
181 class CWindowMaskFeather : public BC_TumbleTextBox
184 CWindowMaskFeather(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
185 ~CWindowMaskFeather();
191 class CWindowMaskValue : public BC_ISlider
194 CWindowMaskValue(MWindow *mwindow, CWindowToolGUI *gui, int x, int y);
201 class CWindowMaskBeforePlugins : public BC_CheckBox
204 CWindowMaskBeforePlugins(CWindowToolGUI *gui, int x, int y);
212 class CWindowMaskGUI : public CWindowToolGUI
215 CWindowMaskGUI(MWindow *mwindow, CWindowTool *thread);
217 void create_objects();
220 void get_keyframe(Track* &track, MaskAutos* &autos, MaskAuto* &keyframe,
221 SubMask* &mask, MaskPoint* &point, int create_it);
222 void update_preview();
225 CWindowMaskMode *mode;
226 CWindowMaskFeather *feather;
227 CWindowMaskDelete *delete_point;
228 // Not necessary if all keyframes have same points
229 // CWindowMaskCycleNext *next_point;
230 // CWindowMaskCyclePrev *prev_point;
231 CWindowMaskNumber *number;
232 CWindowMaskValue *value;
233 CWindowMaskBeforePlugins *apply_before_plugins;
238 class CWindowEyedropGUI : public CWindowToolGUI
241 CWindowEyedropGUI(MWindow *mwindow, CWindowTool *thread);
242 ~CWindowEyedropGUI();
245 void create_objects();
248 CWindowCoord *radius;
249 BC_Title *red, *green, *blue, *y, *u, *v;
250 BC_SubWindow *sample;
255 class CWindowCameraGUI : public CWindowToolGUI
258 CWindowCameraGUI(MWindow *mwindow, CWindowTool *thread);
260 void create_objects();
262 void update_preview();
264 // Update the keyframe from text boxes
266 // BezierAuto* get_keyframe();
267 CWindowCoord *x, *y, *z;
269 // Toggles for keyframe curve mode (for camera automation only)
270 CWindowCurveToggle *t_smooth, *t_linear;
273 class CWindowCameraLeft : public BC_Button
276 CWindowCameraLeft(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
279 CWindowCameraGUI *gui;
282 class CWindowCameraCenter : public BC_Button
285 CWindowCameraCenter(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
288 CWindowCameraGUI *gui;
291 class CWindowCameraRight : public BC_Button
294 CWindowCameraRight(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
297 CWindowCameraGUI *gui;
300 class CWindowCameraTop : public BC_Button
303 CWindowCameraTop(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
306 CWindowCameraGUI *gui;
309 class CWindowCameraMiddle : public BC_Button
312 CWindowCameraMiddle(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
315 CWindowCameraGUI *gui;
318 class CWindowCameraBottom : public BC_Button
321 CWindowCameraBottom(MWindow *mwindow, CWindowCameraGUI *gui, int x, int y);
324 CWindowCameraGUI *gui;
327 class CWindowProjectorGUI : public CWindowToolGUI
330 CWindowProjectorGUI(MWindow *mwindow, CWindowTool *thread);
331 ~CWindowProjectorGUI();
332 void create_objects();
334 void update_preview();
336 // BezierAuto* get_keyframe();
337 CWindowCoord *x, *y, *z;
339 // Toggles for keyframe curve mode (projector automation only)
340 CWindowCurveToggle *t_smooth, *t_linear;
343 class CWindowProjectorLeft : public BC_Button
346 CWindowProjectorLeft(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
349 CWindowProjectorGUI *gui;
352 class CWindowProjectorCenter : public BC_Button
355 CWindowProjectorCenter(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
358 CWindowProjectorGUI *gui;
361 class CWindowProjectorRight : public BC_Button
364 CWindowProjectorRight(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
367 CWindowProjectorGUI *gui;
370 class CWindowProjectorTop : public BC_Button
373 CWindowProjectorTop(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
376 CWindowProjectorGUI *gui;
379 class CWindowProjectorMiddle : public BC_Button
382 CWindowProjectorMiddle(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
385 CWindowProjectorGUI *gui;
388 class CWindowProjectorBottom : public BC_Button
391 CWindowProjectorBottom(MWindow *mwindow, CWindowProjectorGUI *gui, int x, int y);
394 CWindowProjectorGUI *gui;
400 class CWindowRulerGUI : public CWindowToolGUI
403 CWindowRulerGUI(MWindow *mwindow, CWindowTool *thread);
405 void create_objects();