rework alsa device scan, fix lang for pactl
[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
34 #include "timebar.h"
35
36 #include "vtimebar.inc"
37 #include "vwindow.inc"
38 #include "zoompanel.h"
39
40 class VWindowZoom;
41 class VWindowSource;
42 class VWindowTransport;
43 class VWindowEditing;
44 class VWindowCanvas;
45 class VWindowMeters;
46 class VWindowInPoint;
47 class VWindowOutPoint;
48
49 class VWindowGUI : public BC_Window
50 {
51 public:
52         VWindowGUI(MWindow *mwindow, VWindow *vwindow);
53         ~VWindowGUI();
54
55         void create_objects();
56         int resize_event(int w, int h);
57         int translation_event();
58         int close_event();
59         void stop_transport(const char *lock_msg);
60         int keypress_event();
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);
70         void drag_motion();
71         int drag_stop();
72 //      void update_labels();
73 //      void update_points();
74         void update_meters();
75         void draw_wave();
76
77         MWindow *mwindow;
78         VWindow *vwindow;
79
80 // Meters are numbered from right to left
81         VWindowCanvas *canvas;
82
83         BC_Title *fps_title;
84         MainClock *clock;
85         VTimeBar *timebar;
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];
96         int highlighted;
97 private:
98         void get_scrollbars(int &canvas_x, int &canvas_y, int &canvas_w, int &canvas_h);
99 };
100
101
102 class VWindowMeters : public MeterPanel
103 {
104 public:
105         VWindowMeters(MWindow *mwindow, VWindowGUI *gui, int x, int y, int h);
106         ~VWindowMeters();
107
108         int change_status_event(int new_status);
109
110         MWindow *mwindow;
111         VWindowGUI *gui;
112 };
113
114
115 class VWindowCanvas : public Canvas
116 {
117 public:
118         VWindowCanvas(MWindow *mwindow, VWindowGUI *gui);
119
120         void zoom_resize_window(float percentage);
121         void draw_refresh(int flush = 1);
122         int need_overlays();
123         void draw_overlays();
124         void close_source();
125         int get_fullscreen();
126         void set_fullscreen(int value);
127
128         MWindow *mwindow;
129         VWindowGUI *gui;
130 };
131
132 class VWindowEditing : public EditPanel
133 {
134 public:
135         VWindowEditing(MWindow *mwindow, VWindow *vwindow);
136         virtual ~VWindowEditing();
137
138         void copy_selection();
139         void splice_selection();
140         void overwrite_selection();
141         void set_inpoint();
142         void set_outpoint();
143         void unset_inoutpoint();
144         void to_clip();
145         void toggle_label();
146         void prev_label(int cut);
147         void next_label(int cut);
148         double get_position();
149         void set_position(double position);
150
151         MWindow *mwindow;
152         VWindow *vwindow;
153 };
154
155 class VWindowZoom : public ZoomPanel
156 {
157 public:
158         VWindowZoom(MWindow *mwindow, VWindowGUI *gui, int x, int y);
159         ~VWindowZoom();
160         int handle_event();
161         MWindow *mwindow;
162         VWindowGUI *gui;
163 };
164
165
166 class VWindowSource : public BC_PopupTextBox
167 {
168 public:
169         VWindowSource(MWindow *mwindow, VWindowGUI *vwindow, int x, int y);
170         ~VWindowSource();
171         int handle_event();
172         VWindowGUI *vwindow;
173         MWindow *mwindow;
174 };
175
176 class VWindowTransport : public PlayTransport
177 {
178 public:
179         VWindowTransport(MWindow *mwindow,
180                 VWindowGUI *gui,
181                 int x,
182                 int y);
183         EDL* get_edl();
184         void goto_start();
185         void goto_end();
186         int is_vwindow() { return 1; }
187
188         VWindowGUI *gui;
189 };
190
191 class VWindowInPoint : public InPointGUI
192 {
193 public:
194         VWindowInPoint(MWindow *mwindow,
195                 TimeBar *timebar,
196                 VWindowGUI *gui,
197                 long pixel,
198                 double position);
199         int handle_event();
200         VWindowGUI *gui;
201 };
202
203
204 class VWindowOutPoint : public OutPointGUI
205 {
206 public:
207         VWindowOutPoint(MWindow *mwindow,
208                 TimeBar *timebar,
209                 VWindowGUI *gui,
210                 long pixel,
211                 double position);
212         int handle_event();
213         VWindowGUI *gui;
214 };
215
216 #endif