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
26 #include "editpanel.inc"
27 #include "meterpanel.inc"
28 #include "mwindow.inc"
29 #include "manualgoto.inc"
34 class EditInPoint : public BC_Button
37 EditInPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
45 class EditOutPoint : public BC_Button
48 EditOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
56 class EditDelInPoint : public BC_Button
59 EditDelInPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
67 class EditDelOutPoint : public BC_Button
70 EditDelOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
78 class EditSplice : public BC_Button
81 EditSplice(MWindow *mwindow, EditPanel *panel, int x, int y);
89 class EditOverwrite : public BC_Button
92 EditOverwrite(MWindow *mwindow, EditPanel *panel, int x, int y);
100 class EditToClip : public BC_Button
103 EditToClip(MWindow *mwindow, EditPanel *panel, int x, int y);
106 int keypress_event();
111 class EditManualGoto : public BC_Button
114 EditManualGoto(MWindow *mwindow, EditPanel *panel, int x, int y);
117 int keypress_event();
123 class EditCut : public BC_Button
126 EditCut(MWindow *mwindow, EditPanel *panel, int x, int y);
129 int keypress_event();
136 class EditCommercial : public BC_Button
139 EditCommercial(MWindow *mwindow, EditPanel *panel, int x, int y);
142 int keypress_event();
149 class EditClick2Play : public BC_Toggle
152 EditClick2Play(MWindow *mwindow, EditPanel *panel, int x, int y);
156 int keypress_event();
162 class EditCopy : public BC_Button
165 EditCopy(MWindow *mwindow, EditPanel *panel, int x, int y);
168 int keypress_event();
175 class EditPaste : public BC_Button
178 EditPaste(MWindow *mwindow, EditPanel *panel, int x, int y);
181 int keypress_event();
188 class EditUndo : public BC_Button
191 EditUndo(MWindow *mwindow, EditPanel *panel, int x, int y);
193 int keypress_event();
199 class EditRedo : public BC_Button
202 EditRedo(MWindow *mwindow, EditPanel *panel, int x, int y);
204 int keypress_event();
210 class EditLabelbutton : public BC_Button
213 EditLabelbutton(MWindow *mwindow, EditPanel *panel, int x, int y);
215 int keypress_event();
221 class EditFit : public BC_Button
224 EditFit(MWindow *mwindow, EditPanel *panel, int x, int y);
226 int keypress_event();
232 class EditFitAutos : public BC_Button
235 EditFitAutos(MWindow *mwindow, EditPanel *panel, int x, int y);
237 int keypress_event();
244 class EditPrevLabel : public BC_Button
247 EditPrevLabel(MWindow *mwindow, EditPanel *panel, int x, int y);
250 int keypress_event();
257 class EditNextLabel : public BC_Button
260 EditNextLabel(MWindow *mwindow, EditPanel *panel, int x, int y);
263 int keypress_event();
270 class EditPrevEdit : public BC_Button
273 EditPrevEdit(MWindow *mwindow, EditPanel *panel, int x, int y);
276 int keypress_event();
283 class EditNextEdit : public BC_Button
286 EditNextEdit(MWindow *mwindow, EditPanel *panel, int x, int y);
289 int keypress_event();
297 class ArrowButton : public BC_Toggle
300 ArrowButton(MWindow *mwindow, EditPanel *panel, int x, int y);
306 class IBeamButton : public BC_Toggle
309 IBeamButton(MWindow *mwindow, EditPanel *panel, int x, int y);
315 class KeyFrameButton : public BC_Toggle
318 KeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y);
320 int keypress_event();
325 class SpanKeyFrameButton : public BC_Toggle
328 SpanKeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y);
334 class LockLabelsButton : public BC_Toggle
337 LockLabelsButton(MWindow *mwindow, EditPanel *panel, int x, int y);
347 EditPanel(MWindow *mwindow, BC_WindowBase *subwindow,
348 int window_id, int x, int y,
349 int editing_mode, // From edl.inc
350 int use_editing_mode,
352 int use_splice, // Extra buttons
354 int use_copy, // Use copy when in EDITING_ARROW
368 void set_meters(MeterPanel *meter_panel);
369 static int calculate_w(MWindow *mwindow, int use_keyframe, int total_buttons);
370 static int calculate_h(MWindow *mwindow);
372 void create_buttons();
373 void stop_transport(const char *lock_msg);
374 void reposition_buttons(int x, int y);
375 void create_objects();
378 virtual double get_position() = 0;
379 virtual void set_position(double position) = 0;
380 virtual void set_click_to_play(int v) = 0;
382 virtual void panel_stop_transport() = 0;
383 virtual void panel_toggle_label() = 0;
384 virtual void panel_next_label(int cut) = 0;
385 virtual void panel_prev_label(int cut) = 0;
386 virtual void panel_prev_edit(int cut) = 0;
387 virtual void panel_next_edit(int cut) = 0;
388 virtual void panel_copy_selection() = 0;
389 virtual void panel_overwrite_selection() = 0;
390 virtual void panel_splice_selection() = 0;
391 virtual void panel_set_inpoint() = 0;
392 virtual void panel_set_outpoint() = 0;
393 virtual void panel_unset_inoutpoint() = 0;
394 virtual void panel_to_clip() = 0;
395 virtual void panel_cut() = 0;
396 virtual void panel_paste() = 0;
397 virtual void panel_fit_selection() = 0;
398 virtual void panel_fit_autos(int all) = 0;
399 virtual void panel_set_editing_mode(int mode) = 0;
400 virtual void panel_set_auto_keyframes(int v) = 0;
401 virtual void panel_set_span_keyframes(int v) = 0;
402 virtual void panel_set_labels_follow_edits(int v) = 0;
405 BC_WindowBase *subwindow;
406 MeterPanel *meter_panel;
411 int use_editing_mode;
429 EditFitAutos *fit_autos;
430 EditInPoint *inpoint;
431 EditOutPoint *outpoint;
432 // EditDelInPoint *delinpoint;
433 // EditDelOutPoint *deloutpoint;
435 EditOverwrite *overwrite;
438 EditCommercial *commercial;
439 EditManualGoto *mangoto;
440 EditClick2Play *click2play;
443 EditLabelbutton *labelbutton;
444 EditPrevLabel *prevlabel;
445 EditNextLabel *nextlabel;
446 EditPrevEdit *prevedit;
447 EditNextEdit *nextedit;
453 KeyFrameButton *keyframe;
454 SpanKeyFrameButton *span_keyframe;
455 LockLabelsButton *locklabels;
457 int is_mwindow() { return window_id == MWINDOW_ID; }
458 int is_cwindow() { return window_id == CWINDOW_ID; }
459 int is_vwindow() { return window_id == VWINDOW_ID; }