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.h"
29 #include "mainclock.inc"
30 #include "meterpanel.h"
31 #include "mwindow.inc"
32 #include "playtransport.h"
36 #include "vtimebar.inc"
37 #include "vwindow.inc"
38 #include "zoompanel.h"
42 class VWindowTransport;
47 class VWindowOutPoint;
49 class VWindowGUI : public BC_Window
52 VWindowGUI(MWindow *mwindow, VWindow *vwindow);
55 void create_objects();
56 int resize_event(int w, int h);
57 int translation_event();
59 void stop_transport();
61 int button_press_event();
62 int cursor_leave_event();
63 int cursor_enter_event();
64 int button_release_event();
65 int cursor_motion_event();
66 // Update source pulldown with new assets
67 void update_sources(const char *title);
68 // Update GUI to reflect new source
69 void change_source(EDL *edl, const char *title);
72 // void update_labels();
73 // void update_points();
80 // Meters are numbered from right to left
81 VWindowCanvas *canvas;
86 VWindowZoom *zoom_panel;
87 VWindowTransport *transport;
88 VWindowEditing *edit_panel;
89 // VWindowSource *source;
90 VWindowMeters *meters;
91 ArrayList<BC_ListBoxItem*> sources;
92 ArrayList<LabelGUI*> labels;
93 VWindowInPoint *in_point;
94 VWindowOutPoint *out_point;
95 char loaded_title[BCTEXTLEN];
98 void get_scrollbars(int &canvas_x, int &canvas_y, int &canvas_w, int &canvas_h);
102 class VWindowMeters : public MeterPanel
105 VWindowMeters(MWindow *mwindow, VWindowGUI *gui, int x, int y, int h);
108 int change_status_event(int new_status);
115 class VWindowCanvas : public Canvas
118 VWindowCanvas(MWindow *mwindow, VWindowGUI *gui);
120 void zoom_resize_window(float percentage);
121 void draw_refresh(int flush = 1);
123 void draw_overlays();
125 int get_fullscreen();
126 void set_fullscreen(int value);
132 class VWindowEditing : public EditPanel
135 VWindowEditing(MWindow *mwindow, VWindow *vwindow);
136 virtual ~VWindowEditing();
138 double get_position();
139 void set_position(double position);
140 void set_click_to_play(int v);
142 void panel_stop_transport();
143 void panel_toggle_label();
144 void panel_next_label(int cut);
145 void panel_prev_label(int cut);
146 void panel_prev_edit(int cut);
147 void panel_next_edit(int cut);
148 void panel_copy_selection();
149 void panel_overwrite_selection();
150 void panel_splice_selection();
151 void panel_set_inpoint();
152 void panel_set_outpoint();
153 void panel_unset_inoutpoint();
154 void panel_to_clip();
157 void panel_fit_selection();
158 void panel_fit_autos(int all);
159 void panel_set_editing_mode(int mode);
160 void panel_set_auto_keyframes(int v);
161 void panel_set_labels_follow_edits(int v);
167 class VWindowZoom : public ZoomPanel
170 VWindowZoom(MWindow *mwindow, VWindowGUI *gui, int x, int y);
178 class VWindowSource : public BC_PopupTextBox
181 VWindowSource(MWindow *mwindow, VWindowGUI *vwindow, int x, int y);
188 class VWindowTransport : public PlayTransport
191 VWindowTransport(MWindow *mwindow,
198 int is_vwindow() { return 1; }
203 class VWindowInPoint : public InPointGUI
206 VWindowInPoint(MWindow *mwindow,
216 class VWindowOutPoint : public OutPointGUI
219 VWindowOutPoint(MWindow *mwindow,