4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5 * Copyright (C) 2003-2016 Cinelerra CV contributors
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include "editpanel.inc"
29 #include "localsession.inc"
30 #include "meterpanel.inc"
31 #include "mwindow.inc"
32 #include "manualgoto.inc"
33 #include "scopewindow.h"
40 class EditInPoint : public BC_Button
43 EditInPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
51 class EditOutPoint : public BC_Button
54 EditOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
62 class EditDelInPoint : public BC_Button
65 EditDelInPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
73 class EditDelOutPoint : public BC_Button
76 EditDelOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
84 class EditSplice : public BC_Button
87 EditSplice(MWindow *mwindow, EditPanel *panel, int x, int y);
95 class EditOverwrite : public BC_Button
98 EditOverwrite(MWindow *mwindow, EditPanel *panel, int x, int y);
101 int keypress_event();
106 class EditToClip : public BC_Button
109 EditToClip(MWindow *mwindow, EditPanel *panel, int x, int y);
112 int keypress_event();
117 class EditManualGoto : public BC_Button
120 EditManualGoto(MWindow *mwindow, EditPanel *panel, int x, int y);
123 int keypress_event();
129 class EditCut : public BC_Button
132 EditCut(MWindow *mwindow, EditPanel *panel, int x, int y);
135 int keypress_event();
142 class EditCommercial : public BC_Button
145 EditCommercial(MWindow *mwindow, EditPanel *panel, int x, int y);
148 int keypress_event();
155 class EditClick2Play : public BC_Toggle
158 EditClick2Play(MWindow *mwindow, EditPanel *panel, int x, int y);
162 int keypress_event();
168 class EditCopy : public BC_Button
171 EditCopy(MWindow *mwindow, EditPanel *panel, int x, int y);
174 int keypress_event();
181 class EditPaste : public BC_Button
184 EditPaste(MWindow *mwindow, EditPanel *panel, int x, int y);
187 int keypress_event();
194 class EditUndo : public BC_Button
197 EditUndo(MWindow *mwindow, EditPanel *panel, int x, int y);
199 int keypress_event();
205 class EditRedo : public BC_Button
208 EditRedo(MWindow *mwindow, EditPanel *panel, int x, int y);
210 int keypress_event();
216 class EditLabelbutton : public BC_Button
219 EditLabelbutton(MWindow *mwindow, EditPanel *panel, int x, int y);
221 int keypress_event();
227 class EditFit : public BC_Button
230 EditFit(MWindow *mwindow, EditPanel *panel, int x, int y);
232 int keypress_event();
238 class EditFitAutos : public BC_Button
241 EditFitAutos(MWindow *mwindow, EditPanel *panel, int x, int y);
243 int keypress_event();
250 class EditPrevLabel : public BC_Button
253 EditPrevLabel(MWindow *mwindow, EditPanel *panel, int x, int y);
256 int keypress_event();
263 class EditNextLabel : public BC_Button
266 EditNextLabel(MWindow *mwindow, EditPanel *panel, int x, int y);
269 int keypress_event();
276 class EditPrevEdit : public BC_Button
279 EditPrevEdit(MWindow *mwindow, EditPanel *panel, int x, int y);
282 int keypress_event();
289 class EditNextEdit : public BC_Button
292 EditNextEdit(MWindow *mwindow, EditPanel *panel, int x, int y);
295 int keypress_event();
303 class ArrowButton : public BC_Toggle
306 ArrowButton(MWindow *mwindow, EditPanel *panel, int x, int y);
312 class IBeamButton : public BC_Toggle
315 IBeamButton(MWindow *mwindow, EditPanel *panel, int x, int y);
321 class KeyFrameButton : public BC_Toggle
324 KeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y);
326 int keypress_event();
331 class SpanKeyFrameButton : public BC_Toggle
334 SpanKeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y);
340 class LockLabelsButton : public BC_Toggle
343 LockLabelsButton(MWindow *mwindow, EditPanel *panel, int x, int y);
350 class EditPanelScopeGUI : public ScopeGUI
353 EditPanelScopeGUI(MWindow *mwindow, EditPanelScopeDialog *dialog);
354 ~EditPanelScopeGUI();
356 void create_objects();
358 int translation_event();
359 int resize_event(int w, int h);
363 EditPanelScopeDialog *dialog;
366 class EditPanelScopeDialog : public BC_DialogThread
369 EditPanelScopeDialog(MWindow *mwindow, EditPanel *panel);
370 ~EditPanelScopeDialog();
372 void handle_close_event(int result);
373 void handle_done_event(int result);
374 BC_Window* new_gui();
375 void process(VFrame *output_frame);
379 EditPanelScopeGUI *scope_gui;
381 VFrame *output_frame;
384 class EditPanelGangTracks : public BC_Button
386 static VFrame **gang_images[TOTAL_GANGS];
387 static const char *gang_tips[TOTAL_GANGS];
389 EditPanelGangTracks(MWindow *mwindow, EditPanel *panel, int x, int y);
390 ~EditPanelGangTracks();
391 VFrame **get_images(MWindow *mwindow);
392 void update(int gang);
399 class EditPanelScope : public BC_Toggle
402 EditPanelScope(MWindow *mwindow, EditPanel *panel, int x, int y);
409 class EditPanelTimecode : public BC_Button
412 EditPanelTimecode(MWindow *mwindow, EditPanel *panel, int x, int y);
413 ~EditPanelTimecode();
417 EditPanelTcDialog *tc_dialog;
420 class EditPanelTcDialog : public BC_DialogThread
423 EditPanelTcDialog(MWindow *mwindow, EditPanel *panel);
424 ~EditPanelTcDialog();
425 BC_Window *new_gui();
426 void start_dialog(int px, int py);
427 void handle_done_event(int result);
431 EditPanelTcWindow *tc_gui;
435 class EditPanelTcWindow : public BC_Window
438 EditPanelTcWindow(EditPanelTcDialog *tc_dialog, int x, int y);
439 ~EditPanelTcWindow();
440 void create_objects();
441 double get_timecode();
442 void update(double timecode);
444 EditPanelTcDialog *tc_dialog;
445 EditPanelTcInt *hours;
446 EditPanelTcInt *minutes;
447 EditPanelTcInt *seconds;
448 EditPanelTcInt *frames;
451 class EditPanelTcInt : public BC_TextBox
454 EditPanelTcInt(EditPanelTcWindow *window, int x, int y, int w,
455 int max, const char *format);
458 int keypress_event();
461 EditPanelTcWindow *window;
466 class EditPanelTcReset : public BC_Button
469 EditPanelTcReset(EditPanelTcWindow *window, int x, int y);
472 EditPanelTcWindow *window;
478 EditPanel(MWindow *mwindow, BC_WindowBase *subwindow,
479 int window_id, int x, int y,
480 int editing_mode, // From edl.inc
481 int use_editing_mode,
483 int use_splice, // Extra buttons
485 int use_copy, // Use copy when in EDITING_ARROW
502 void set_meters(MeterPanel *meter_panel);
503 static int calculate_w(MWindow *mwindow, int use_keyframe, int total_buttons);
504 static int calculate_h(MWindow *mwindow);
506 void create_buttons();
507 void stop_transport(const char *lock_msg);
508 void reposition_buttons(int x, int y);
509 void create_objects();
512 virtual double get_position() = 0;
513 virtual void set_position(double position) = 0;
514 virtual void set_click_to_play(int v) = 0;
516 virtual void panel_stop_transport() = 0;
517 virtual void panel_toggle_label() = 0;
518 virtual void panel_next_label(int cut) = 0;
519 virtual void panel_prev_label(int cut) = 0;
520 virtual void panel_prev_edit(int cut) = 0;
521 virtual void panel_next_edit(int cut) = 0;
522 virtual void panel_copy_selection() = 0;
523 virtual void panel_overwrite_selection() = 0;
524 virtual void panel_splice_selection() = 0;
525 virtual void panel_set_inpoint() = 0;
526 virtual void panel_set_outpoint() = 0;
527 virtual void panel_unset_inoutpoint() = 0;
528 virtual void panel_to_clip() = 0;
529 virtual void panel_cut() = 0;
530 virtual void panel_paste() = 0;
531 virtual void panel_fit_selection() = 0;
532 virtual void panel_fit_autos(int all) = 0;
533 virtual void panel_set_editing_mode(int mode) = 0;
534 virtual void panel_set_auto_keyframes(int v) = 0;
535 virtual void panel_set_span_keyframes(int v) = 0;
536 virtual void panel_set_labels_follow_edits(int v) = 0;
537 virtual void panel_set_gang_tracks(int mode) = 0;
540 BC_WindowBase *subwindow;
541 MeterPanel *meter_panel;
546 int use_editing_mode;
567 EditFitAutos *fit_autos;
568 EditInPoint *inpoint;
569 EditOutPoint *outpoint;
570 // EditDelInPoint *delinpoint;
571 // EditDelOutPoint *deloutpoint;
573 EditOverwrite *overwrite;
576 EditCommercial *commercial;
577 EditManualGoto *mangoto;
578 EditClick2Play *click2play;
579 EditPanelScope *scope;
580 EditPanelTimecode *timecode;
581 EditPanelScopeDialog *scope_dialog;
584 EditLabelbutton *labelbutton;
585 EditPrevLabel *prevlabel;
586 EditNextLabel *nextlabel;
587 EditPrevEdit *prevedit;
588 EditNextEdit *nextedit;
589 EditPanelGangTracks *gang_tracks;
595 KeyFrameButton *keyframe;
596 SpanKeyFrameButton *span_keyframe;
597 LockLabelsButton *locklabels;
599 int is_mwindow() { return window_id == MWINDOW_ID; }
600 int is_cwindow() { return window_id == CWINDOW_ID; }
601 int is_vwindow() { return window_id == VWINDOW_ID; }