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
27 #include "editpanel.inc"
28 #include "meterpanel.inc"
29 #include "mwindow.inc"
30 #include "manualgoto.inc"
31 #include "scopewindow.h"
38 class EditInPoint : public BC_Button
41 EditInPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
49 class EditOutPoint : public BC_Button
52 EditOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
60 class EditDelInPoint : public BC_Button
63 EditDelInPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
71 class EditDelOutPoint : public BC_Button
74 EditDelOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
82 class EditSplice : public BC_Button
85 EditSplice(MWindow *mwindow, EditPanel *panel, int x, int y);
93 class EditOverwrite : public BC_Button
96 EditOverwrite(MWindow *mwindow, EditPanel *panel, int x, int y);
104 class EditToClip : public BC_Button
107 EditToClip(MWindow *mwindow, EditPanel *panel, int x, int y);
110 int keypress_event();
115 class EditManualGoto : public BC_Button
118 EditManualGoto(MWindow *mwindow, EditPanel *panel, int x, int y);
121 int keypress_event();
127 class EditCut : public BC_Button
130 EditCut(MWindow *mwindow, EditPanel *panel, int x, int y);
133 int keypress_event();
140 class EditCommercial : public BC_Button
143 EditCommercial(MWindow *mwindow, EditPanel *panel, int x, int y);
146 int keypress_event();
153 class EditClick2Play : public BC_Toggle
156 EditClick2Play(MWindow *mwindow, EditPanel *panel, int x, int y);
160 int keypress_event();
166 class EditCopy : public BC_Button
169 EditCopy(MWindow *mwindow, EditPanel *panel, int x, int y);
172 int keypress_event();
179 class EditPaste : public BC_Button
182 EditPaste(MWindow *mwindow, EditPanel *panel, int x, int y);
185 int keypress_event();
192 class EditUndo : public BC_Button
195 EditUndo(MWindow *mwindow, EditPanel *panel, int x, int y);
197 int keypress_event();
203 class EditRedo : public BC_Button
206 EditRedo(MWindow *mwindow, EditPanel *panel, int x, int y);
208 int keypress_event();
214 class EditLabelbutton : public BC_Button
217 EditLabelbutton(MWindow *mwindow, EditPanel *panel, int x, int y);
219 int keypress_event();
225 class EditFit : public BC_Button
228 EditFit(MWindow *mwindow, EditPanel *panel, int x, int y);
230 int keypress_event();
236 class EditFitAutos : public BC_Button
239 EditFitAutos(MWindow *mwindow, EditPanel *panel, int x, int y);
241 int keypress_event();
248 class EditPrevLabel : public BC_Button
251 EditPrevLabel(MWindow *mwindow, EditPanel *panel, int x, int y);
254 int keypress_event();
261 class EditNextLabel : public BC_Button
264 EditNextLabel(MWindow *mwindow, EditPanel *panel, int x, int y);
267 int keypress_event();
274 class EditPrevEdit : public BC_Button
277 EditPrevEdit(MWindow *mwindow, EditPanel *panel, int x, int y);
280 int keypress_event();
287 class EditNextEdit : public BC_Button
290 EditNextEdit(MWindow *mwindow, EditPanel *panel, int x, int y);
293 int keypress_event();
301 class ArrowButton : public BC_Toggle
304 ArrowButton(MWindow *mwindow, EditPanel *panel, int x, int y);
310 class IBeamButton : public BC_Toggle
313 IBeamButton(MWindow *mwindow, EditPanel *panel, int x, int y);
319 class KeyFrameButton : public BC_Toggle
322 KeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y);
324 int keypress_event();
329 class SpanKeyFrameButton : public BC_Toggle
332 SpanKeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y);
338 class LockLabelsButton : public BC_Toggle
341 LockLabelsButton(MWindow *mwindow, EditPanel *panel, int x, int y);
348 class EditPanelScopeGUI : public ScopeGUI
351 EditPanelScopeGUI(MWindow *mwindow, EditPanelScopeDialog *dialog);
352 ~EditPanelScopeGUI();
354 void create_objects();
356 int translation_event();
357 int resize_event(int w, int h);
361 EditPanelScopeDialog *dialog;
364 class EditPanelScopeDialog : public BC_DialogThread
367 EditPanelScopeDialog(MWindow *mwindow, EditPanel *panel);
368 ~EditPanelScopeDialog();
370 void handle_close_event(int result);
371 void handle_done_event(int result);
372 BC_Window* new_gui();
373 void process(VFrame *output_frame);
377 EditPanelScopeGUI *scope_gui;
379 VFrame *output_frame;
382 class EditPanelScope : public BC_Toggle
385 EditPanelScope(MWindow *mwindow, EditPanel *panel, int x, int y);
396 EditPanel(MWindow *mwindow, BC_WindowBase *subwindow,
397 int window_id, int x, int y,
398 int editing_mode, // From edl.inc
399 int use_editing_mode,
401 int use_splice, // Extra buttons
403 int use_copy, // Use copy when in EDITING_ARROW
418 void set_meters(MeterPanel *meter_panel);
419 static int calculate_w(MWindow *mwindow, int use_keyframe, int total_buttons);
420 static int calculate_h(MWindow *mwindow);
422 void create_buttons();
423 void stop_transport(const char *lock_msg);
424 void reposition_buttons(int x, int y);
425 void create_objects();
428 virtual double get_position() = 0;
429 virtual void set_position(double position) = 0;
430 virtual void set_click_to_play(int v) = 0;
432 virtual void panel_stop_transport() = 0;
433 virtual void panel_toggle_label() = 0;
434 virtual void panel_next_label(int cut) = 0;
435 virtual void panel_prev_label(int cut) = 0;
436 virtual void panel_prev_edit(int cut) = 0;
437 virtual void panel_next_edit(int cut) = 0;
438 virtual void panel_copy_selection() = 0;
439 virtual void panel_overwrite_selection() = 0;
440 virtual void panel_splice_selection() = 0;
441 virtual void panel_set_inpoint() = 0;
442 virtual void panel_set_outpoint() = 0;
443 virtual void panel_unset_inoutpoint() = 0;
444 virtual void panel_to_clip() = 0;
445 virtual void panel_cut() = 0;
446 virtual void panel_paste() = 0;
447 virtual void panel_fit_selection() = 0;
448 virtual void panel_fit_autos(int all) = 0;
449 virtual void panel_set_editing_mode(int mode) = 0;
450 virtual void panel_set_auto_keyframes(int v) = 0;
451 virtual void panel_set_span_keyframes(int v) = 0;
452 virtual void panel_set_labels_follow_edits(int v) = 0;
455 BC_WindowBase *subwindow;
456 MeterPanel *meter_panel;
461 int use_editing_mode;
480 EditFitAutos *fit_autos;
481 EditInPoint *inpoint;
482 EditOutPoint *outpoint;
483 // EditDelInPoint *delinpoint;
484 // EditDelOutPoint *deloutpoint;
486 EditOverwrite *overwrite;
489 EditCommercial *commercial;
490 EditManualGoto *mangoto;
491 EditClick2Play *click2play;
492 EditPanelScope *scope;
493 EditPanelScopeDialog *scope_dialog;
496 EditLabelbutton *labelbutton;
497 EditPrevLabel *prevlabel;
498 EditNextLabel *nextlabel;
499 EditPrevEdit *prevedit;
500 EditNextEdit *nextedit;
506 KeyFrameButton *keyframe;
507 SpanKeyFrameButton *span_keyframe;
508 LockLabelsButton *locklabels;
510 int is_mwindow() { return window_id == MWINDOW_ID; }
511 int is_cwindow() { return window_id == CWINDOW_ID; }
512 int is_vwindow() { return window_id == VWINDOW_ID; }