6836293fcd3e6f49648d9de404a549b49222e34e
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / vwindowgui.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
5  *
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.
10  *
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.
15  *
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
19  *
20  */
21
22 #ifndef VWINDOWGUI_H
23 #define VWINDOWGUI_H
24
25 #include "asset.inc"
26 #include "canvas.h"
27 #include "editpanel.h"
28 #include "guicast.h"
29 #include "mainclock.inc"
30 #include "meterpanel.h"
31 #include "mwindow.inc"
32 #include "playtransport.h"
33 #include "timebar.h"
34 #include "vtimebar.inc"
35 #include "vwindow.inc"
36 #include "vwindowgui.inc"
37 #include "zoompanel.h"
38
39 class VWindowGUI : public BC_Window
40 {
41 public:
42         VWindowGUI(MWindow *mwindow, VWindow *vwindow);
43         ~VWindowGUI();
44
45         void create_objects();
46         int resize_event(int w, int h);
47         int translation_event();
48         int close_event();
49         void stop_transport();
50         int keypress_event();
51         int button_press_event();
52         int cursor_leave_event();
53         int cursor_enter_event();
54         int button_release_event();
55         int cursor_motion_event();
56 // Update source pulldown with new assets
57         void update_sources(const char *title);
58 // Update GUI to reflect new source
59         void change_source(EDL *edl, const char *title);
60         void drag_motion();
61         int drag_stop();
62 //      void update_labels();
63 //      void update_points();
64         void update_meters();
65         void draw_wave();
66
67         MWindow *mwindow;
68         VWindow *vwindow;
69
70 // Meters are numbered from right to left
71         VWindowCanvas *canvas;
72
73         BC_Title *fps_title;
74         MainClock *clock;
75         VTimeBar *timebar;
76         VWindowZoom *zoom_panel;
77         VWindowTransport *transport;
78         VWindowEditing *edit_panel;
79 //      VWindowSource *source;
80         VWindowMeters *meters;
81         ArrayList<BC_ListBoxItem*> sources;
82         ArrayList<LabelGUI*> labels;
83         VWindowInPoint *in_point;
84         VWindowOutPoint *out_point;
85         char loaded_title[BCTEXTLEN];
86         int highlighted;
87 };
88
89
90 class VWindowMeters : public MeterPanel
91 {
92 public:
93         VWindowMeters(MWindow *mwindow, VWindowGUI *gui, int x, int y, int h);
94         ~VWindowMeters();
95
96         int change_status_event(int new_status);
97
98         MWindow *mwindow;
99         VWindowGUI *gui;
100 };
101
102
103 class VWindowCanvasPopupRemoveSource : public BC_MenuItem
104 {
105 public:
106         VWindowCanvasPopupRemoveSource(Canvas *canvas);
107         int handle_event();
108         Canvas *canvas;
109 };
110
111 class VWindowCanvas : public Canvas
112 {
113 public:
114         VWindowCanvas(MWindow *mwindow, VWindowGUI *gui);
115         void create_objects(EDL *edl);
116         void zoom_resize_window(float percentage);
117         void draw_refresh(int flush = 1);
118         int need_overlays();
119         void draw_overlays();
120         void close_source();
121         void zoom_auto();
122
123         MWindow *mwindow;
124         VWindowGUI *gui;
125 };
126
127 class VWindowEditing : public EditPanel
128 {
129 public:
130         VWindowEditing(MWindow *mwindow, VWindow *vwindow);
131         virtual ~VWindowEditing();
132
133         double get_position();
134         void set_position(double position);
135         void set_click_to_play(int v);
136
137         void panel_stop_transport();
138         void panel_toggle_label();
139         void panel_next_label(int cut);
140         void panel_prev_label(int cut);
141         void panel_prev_edit(int cut);
142         void panel_next_edit(int cut);
143         void panel_copy_selection();
144         void panel_overwrite_selection();
145         void panel_splice_selection();
146         void panel_set_inpoint();
147         void panel_set_outpoint();
148         void panel_unset_inoutpoint();
149         void panel_to_clip();
150         void panel_cut();
151         void panel_paste();
152         void panel_fit_selection();
153         void panel_fit_autos(int all);
154         void panel_set_editing_mode(int mode);
155         void panel_set_auto_keyframes(int v);
156         void panel_set_span_keyframes(int v);
157         void panel_set_labels_follow_edits(int v);
158
159         MWindow *mwindow;
160         VWindow *vwindow;
161 };
162
163 class VWindowZoom : public ZoomPanel
164 {
165 public:
166         VWindowZoom(MWindow *mwindow, VWindowGUI *gui, int x, int y);
167         ~VWindowZoom();
168         int handle_event();
169         MWindow *mwindow;
170         VWindowGUI *gui;
171 };
172
173
174 class VWindowSource : public BC_PopupTextBox
175 {
176 public:
177         VWindowSource(MWindow *mwindow, VWindowGUI *vwindow, int x, int y);
178         ~VWindowSource();
179         int handle_event();
180         VWindowGUI *vwindow;
181         MWindow *mwindow;
182 };
183
184 class VWindowTransport : public PlayTransport
185 {
186 public:
187         VWindowTransport(MWindow *mwindow,
188                 VWindowGUI *gui,
189                 int x,
190                 int y);
191         EDL* get_edl();
192         void goto_start();
193         void goto_end();
194         int is_vwindow() { return 1; }
195
196         VWindowGUI *gui;
197 };
198
199 class VWindowInPoint : public InPointGUI
200 {
201 public:
202         VWindowInPoint(MWindow *mwindow,
203                 TimeBar *timebar,
204                 VWindowGUI *gui,
205                 long pixel,
206                 double position);
207         int handle_event();
208         VWindowGUI *gui;
209 };
210
211
212 class VWindowOutPoint : public OutPointGUI
213 {
214 public:
215         VWindowOutPoint(MWindow *mwindow,
216                 TimeBar *timebar,
217                 VWindowGUI *gui,
218                 long pixel,
219                 double position);
220         int handle_event();
221         VWindowGUI *gui;
222 };
223
224 #endif