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 "localsession.inc"
29 #include "meterpanel.inc"
30 #include "mwindow.inc"
31 #include "manualgoto.inc"
32 #include "scopewindow.h"
39 class EditInPoint : public BC_Button
42 EditInPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
50 class EditOutPoint : public BC_Button
53 EditOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
61 class EditDelInPoint : public BC_Button
64 EditDelInPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
72 class EditDelOutPoint : public BC_Button
75 EditDelOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
83 class EditSplice : public BC_Button
86 EditSplice(MWindow *mwindow, EditPanel *panel, int x, int y);
94 class EditOverwrite : public BC_Button
97 EditOverwrite(MWindow *mwindow, EditPanel *panel, int x, int y);
100 int keypress_event();
105 class EditToClip : public BC_Button
108 EditToClip(MWindow *mwindow, EditPanel *panel, int x, int y);
111 int keypress_event();
116 class EditManualGoto : public BC_Button
119 EditManualGoto(MWindow *mwindow, EditPanel *panel, int x, int y);
122 int keypress_event();
128 class EditCut : public BC_Button
131 EditCut(MWindow *mwindow, EditPanel *panel, int x, int y);
134 int keypress_event();
141 class EditCommercial : public BC_Button
144 EditCommercial(MWindow *mwindow, EditPanel *panel, int x, int y);
147 int keypress_event();
154 class EditClick2Play : public BC_Toggle
157 EditClick2Play(MWindow *mwindow, EditPanel *panel, int x, int y);
161 int keypress_event();
167 class EditCopy : public BC_Button
170 EditCopy(MWindow *mwindow, EditPanel *panel, int x, int y);
173 int keypress_event();
180 class EditPaste : public BC_Button
183 EditPaste(MWindow *mwindow, EditPanel *panel, int x, int y);
186 int keypress_event();
193 class EditUndo : public BC_Button
196 EditUndo(MWindow *mwindow, EditPanel *panel, int x, int y);
198 int keypress_event();
204 class EditRedo : public BC_Button
207 EditRedo(MWindow *mwindow, EditPanel *panel, int x, int y);
209 int keypress_event();
215 class EditLabelbutton : public BC_Button
218 EditLabelbutton(MWindow *mwindow, EditPanel *panel, int x, int y);
220 int keypress_event();
226 class EditFit : public BC_Button
229 EditFit(MWindow *mwindow, EditPanel *panel, int x, int y);
231 int keypress_event();
237 class EditFitAutos : public BC_Button
240 EditFitAutos(MWindow *mwindow, EditPanel *panel, int x, int y);
242 int keypress_event();
249 class EditPrevLabel : public BC_Button
252 EditPrevLabel(MWindow *mwindow, EditPanel *panel, int x, int y);
255 int keypress_event();
262 class EditNextLabel : public BC_Button
265 EditNextLabel(MWindow *mwindow, EditPanel *panel, int x, int y);
268 int keypress_event();
275 class EditPrevEdit : public BC_Button
278 EditPrevEdit(MWindow *mwindow, EditPanel *panel, int x, int y);
281 int keypress_event();
288 class EditNextEdit : public BC_Button
291 EditNextEdit(MWindow *mwindow, EditPanel *panel, int x, int y);
294 int keypress_event();
302 class ArrowButton : public BC_Toggle
305 ArrowButton(MWindow *mwindow, EditPanel *panel, int x, int y);
311 class IBeamButton : public BC_Toggle
314 IBeamButton(MWindow *mwindow, EditPanel *panel, int x, int y);
320 class KeyFrameButton : public BC_Toggle
323 KeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y);
325 int keypress_event();
330 class SpanKeyFrameButton : public BC_Toggle
333 SpanKeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y);
339 class LockLabelsButton : public BC_Toggle
342 LockLabelsButton(MWindow *mwindow, EditPanel *panel, int x, int y);
349 class EditPanelScopeGUI : public ScopeGUI
352 EditPanelScopeGUI(MWindow *mwindow, EditPanelScopeDialog *dialog);
353 ~EditPanelScopeGUI();
355 void create_objects();
357 int translation_event();
358 int resize_event(int w, int h);
362 EditPanelScopeDialog *dialog;
365 class EditPanelScopeDialog : public BC_DialogThread
368 EditPanelScopeDialog(MWindow *mwindow, EditPanel *panel);
369 ~EditPanelScopeDialog();
371 void handle_close_event(int result);
372 void handle_done_event(int result);
373 BC_Window* new_gui();
374 void process(VFrame *output_frame);
378 EditPanelScopeGUI *scope_gui;
380 VFrame *output_frame;
383 class EditPanelGangTracks : public BC_Button
385 static VFrame **gang_images[TOTAL_GANGS];
386 static const char *gang_tips[TOTAL_GANGS];
388 EditPanelGangTracks(MWindow *mwindow, EditPanel *panel, int x, int y);
389 ~EditPanelGangTracks();
390 VFrame **get_images(MWindow *mwindow);
391 void update(int gang);
398 class EditPanelScope : public BC_Toggle
401 EditPanelScope(MWindow *mwindow, EditPanel *panel, int x, int y);
408 class EditPanelTimecode : public BC_Button
411 EditPanelTimecode(MWindow *mwindow, EditPanel *panel, int x, int y);
412 ~EditPanelTimecode();
416 EditPanelTcDialog *tc_dialog;
419 class EditPanelTcDialog : public BC_DialogThread
422 EditPanelTcDialog(MWindow *mwindow, EditPanel *panel);
423 ~EditPanelTcDialog();
424 BC_Window *new_gui();
425 void start_dialog(int px, int py);
426 void handle_done_event(int result);
430 EditPanelTcWindow *tc_gui;
434 class EditPanelTcWindow : public BC_Window
437 EditPanelTcWindow(EditPanelTcDialog *tc_dialog, int x, int y);
438 ~EditPanelTcWindow();
439 void create_objects();
440 double get_timecode();
441 void update(double timecode);
443 EditPanelTcDialog *tc_dialog;
444 EditPanelTcInt *hours;
445 EditPanelTcInt *minutes;
446 EditPanelTcInt *seconds;
447 EditPanelTcInt *frames;
450 class EditPanelTcInt : public BC_TextBox
453 EditPanelTcInt(EditPanelTcWindow *window, int x, int y, int w,
454 int max, const char *format);
457 int keypress_event();
460 EditPanelTcWindow *window;
465 class EditPanelTcReset : public BC_Button
468 EditPanelTcReset(EditPanelTcWindow *window, int x, int y);
471 EditPanelTcWindow *window;
477 EditPanel(MWindow *mwindow, BC_WindowBase *subwindow,
478 int window_id, int x, int y,
479 int editing_mode, // From edl.inc
480 int use_editing_mode,
482 int use_splice, // Extra buttons
484 int use_copy, // Use copy when in EDITING_ARROW
501 void set_meters(MeterPanel *meter_panel);
502 static int calculate_w(MWindow *mwindow, int use_keyframe, int total_buttons);
503 static int calculate_h(MWindow *mwindow);
505 void create_buttons();
506 void stop_transport(const char *lock_msg);
507 void reposition_buttons(int x, int y);
508 void create_objects();
511 virtual double get_position() = 0;
512 virtual void set_position(double position) = 0;
513 virtual void set_click_to_play(int v) = 0;
515 virtual void panel_stop_transport() = 0;
516 virtual void panel_toggle_label() = 0;
517 virtual void panel_next_label(int cut) = 0;
518 virtual void panel_prev_label(int cut) = 0;
519 virtual void panel_prev_edit(int cut) = 0;
520 virtual void panel_next_edit(int cut) = 0;
521 virtual void panel_copy_selection() = 0;
522 virtual void panel_overwrite_selection() = 0;
523 virtual void panel_splice_selection() = 0;
524 virtual void panel_set_inpoint() = 0;
525 virtual void panel_set_outpoint() = 0;
526 virtual void panel_unset_inoutpoint() = 0;
527 virtual void panel_to_clip() = 0;
528 virtual void panel_cut() = 0;
529 virtual void panel_paste() = 0;
530 virtual void panel_fit_selection() = 0;
531 virtual void panel_fit_autos(int all) = 0;
532 virtual void panel_set_editing_mode(int mode) = 0;
533 virtual void panel_set_auto_keyframes(int v) = 0;
534 virtual void panel_set_span_keyframes(int v) = 0;
535 virtual void panel_set_labels_follow_edits(int v) = 0;
536 virtual void panel_set_gang_tracks(int mode) = 0;
539 BC_WindowBase *subwindow;
540 MeterPanel *meter_panel;
545 int use_editing_mode;
566 EditFitAutos *fit_autos;
567 EditInPoint *inpoint;
568 EditOutPoint *outpoint;
569 // EditDelInPoint *delinpoint;
570 // EditDelOutPoint *deloutpoint;
572 EditOverwrite *overwrite;
575 EditCommercial *commercial;
576 EditManualGoto *mangoto;
577 EditClick2Play *click2play;
578 EditPanelScope *scope;
579 EditPanelTimecode *timecode;
580 EditPanelScopeDialog *scope_dialog;
583 EditLabelbutton *labelbutton;
584 EditPrevLabel *prevlabel;
585 EditNextLabel *nextlabel;
586 EditPrevEdit *prevedit;
587 EditNextEdit *nextedit;
588 EditPanelGangTracks *gang_tracks;
594 KeyFrameButton *keyframe;
595 SpanKeyFrameButton *span_keyframe;
596 LockLabelsButton *locklabels;
598 int is_mwindow() { return window_id == MWINDOW_ID; }
599 int is_cwindow() { return window_id == CWINDOW_ID; }
600 int is_vwindow() { return window_id == VWINDOW_ID; }