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 EditPanelGangTracks : public BC_Button
384 static VFrame **gang_images[TOTAL_GANGS];
385 static const char *gang_tips[TOTAL_GANGS];
387 EditPanelGangTracks(MWindow *mwindow, EditPanel *panel, int x, int y);
388 ~EditPanelGangTracks();
389 VFrame **get_images(MWindow *mwindow);
390 void update(int gang);
397 class EditPanelScope : public BC_Toggle
400 EditPanelScope(MWindow *mwindow, EditPanel *panel, int x, int y);
407 class EditPanelTimecode : public BC_Button
410 EditPanelTimecode(MWindow *mwindow, EditPanel *panel, int x, int y);
411 ~EditPanelTimecode();
415 EditPanelTcDialog *tc_dialog;
418 class EditPanelTcDialog : public BC_DialogThread
421 EditPanelTcDialog(MWindow *mwindow, EditPanel *panel);
422 ~EditPanelTcDialog();
423 BC_Window *new_gui();
424 void start_dialog(int px, int py);
425 void handle_done_event(int result);
429 EditPanelTcWindow *tc_gui;
433 class EditPanelTcWindow : public BC_Window
436 EditPanelTcWindow(EditPanelTcDialog *tc_dialog, int x, int y);
437 ~EditPanelTcWindow();
438 void create_objects();
439 double get_timecode();
440 void update(double timecode);
442 EditPanelTcDialog *tc_dialog;
443 EditPanelTcInt *hours;
444 EditPanelTcInt *minutes;
445 EditPanelTcInt *seconds;
446 EditPanelTcInt *frames;
449 class EditPanelTcInt : public BC_TextBox
452 EditPanelTcInt(EditPanelTcWindow *window, int x, int y, int w,
453 int max, const char *format);
456 int keypress_event();
459 EditPanelTcWindow *window;
464 class EditPanelTcReset : public BC_Button
467 EditPanelTcReset(EditPanelTcWindow *window, int x, int y);
470 EditPanelTcWindow *window;
476 EditPanel(MWindow *mwindow, BC_WindowBase *subwindow,
477 int window_id, int x, int y,
478 int editing_mode, // From edl.inc
479 int use_editing_mode,
481 int use_splice, // Extra buttons
483 int use_copy, // Use copy when in EDITING_ARROW
500 void set_meters(MeterPanel *meter_panel);
501 static int calculate_w(MWindow *mwindow, int use_keyframe, int total_buttons);
502 static int calculate_h(MWindow *mwindow);
504 void create_buttons();
505 void stop_transport(const char *lock_msg);
506 void reposition_buttons(int x, int y);
507 void create_objects();
510 virtual double get_position() = 0;
511 virtual void set_position(double position) = 0;
512 virtual void set_click_to_play(int v) = 0;
514 virtual void panel_stop_transport() = 0;
515 virtual void panel_toggle_label() = 0;
516 virtual void panel_next_label(int cut) = 0;
517 virtual void panel_prev_label(int cut) = 0;
518 virtual void panel_prev_edit(int cut) = 0;
519 virtual void panel_next_edit(int cut) = 0;
520 virtual void panel_copy_selection() = 0;
521 virtual void panel_overwrite_selection() = 0;
522 virtual void panel_splice_selection() = 0;
523 virtual void panel_set_inpoint() = 0;
524 virtual void panel_set_outpoint() = 0;
525 virtual void panel_unset_inoutpoint() = 0;
526 virtual void panel_to_clip() = 0;
527 virtual void panel_cut() = 0;
528 virtual void panel_paste() = 0;
529 virtual void panel_fit_selection() = 0;
530 virtual void panel_fit_autos(int all) = 0;
531 virtual void panel_set_editing_mode(int mode) = 0;
532 virtual void panel_set_auto_keyframes(int v) = 0;
533 virtual void panel_set_span_keyframes(int v) = 0;
534 virtual void panel_set_labels_follow_edits(int v) = 0;
535 virtual void panel_set_gang_tracks(int mode) = 0;
538 BC_WindowBase *subwindow;
539 MeterPanel *meter_panel;
544 int use_editing_mode;
565 EditFitAutos *fit_autos;
566 EditInPoint *inpoint;
567 EditOutPoint *outpoint;
568 // EditDelInPoint *delinpoint;
569 // EditDelOutPoint *deloutpoint;
571 EditOverwrite *overwrite;
574 EditCommercial *commercial;
575 EditManualGoto *mangoto;
576 EditClick2Play *click2play;
577 EditPanelScope *scope;
578 EditPanelTimecode *timecode;
579 EditPanelScopeDialog *scope_dialog;
582 EditLabelbutton *labelbutton;
583 EditPrevLabel *prevlabel;
584 EditNextLabel *nextlabel;
585 EditPrevEdit *prevedit;
586 EditNextEdit *nextedit;
587 EditPanelGangTracks *gang_tracks;
593 KeyFrameButton *keyframe;
594 SpanKeyFrameButton *span_keyframe;
595 LockLabelsButton *locklabels;
597 int is_mwindow() { return window_id == MWINDOW_ID; }
598 int is_cwindow() { return window_id == CWINDOW_ID; }
599 int is_vwindow() { return window_id == VWINDOW_ID; }