span keyframes toggle, rect_audio tweaks, fix playbackengine clear output for audio...
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / editpanel.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 EDITPANEL_H
23 #define EDITPANEL_H
24
25 #include "guicast.h"
26 #include "editpanel.inc"
27 #include "meterpanel.inc"
28 #include "mwindow.inc"
29 #include "manualgoto.inc"
30
31 class EditPanel;
32
33
34 class EditInPoint : public BC_Button
35 {
36 public:
37         EditInPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
38         ~EditInPoint();
39         int handle_event();
40         int keypress_event();
41         MWindow *mwindow;
42         EditPanel *panel;
43 };
44
45 class EditOutPoint : public BC_Button
46 {
47 public:
48         EditOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
49         ~EditOutPoint();
50         int handle_event();
51         int keypress_event();
52         MWindow *mwindow;
53         EditPanel *panel;
54 };
55
56 class EditDelInPoint : public BC_Button
57 {
58 public:
59         EditDelInPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
60         ~EditDelInPoint();
61         int handle_event();
62         int keypress_event();
63         MWindow *mwindow;
64         EditPanel *panel;
65 };
66
67 class EditDelOutPoint : public BC_Button
68 {
69 public:
70         EditDelOutPoint(MWindow *mwindow, EditPanel *panel, int x, int y);
71         ~EditDelOutPoint();
72         int handle_event();
73         int keypress_event();
74         MWindow *mwindow;
75         EditPanel *panel;
76 };
77
78 class EditSplice : public BC_Button
79 {
80 public:
81         EditSplice(MWindow *mwindow, EditPanel *panel, int x, int y);
82         ~EditSplice();
83         int handle_event();
84         int keypress_event();
85         MWindow *mwindow;
86         EditPanel *panel;
87 };
88
89 class EditOverwrite : public BC_Button
90 {
91 public:
92         EditOverwrite(MWindow *mwindow, EditPanel *panel, int x, int y);
93         ~EditOverwrite();
94         int handle_event();
95         int keypress_event();
96         MWindow *mwindow;
97         EditPanel *panel;
98 };
99
100 class EditToClip : public BC_Button
101 {
102 public:
103         EditToClip(MWindow *mwindow, EditPanel *panel, int x, int y);
104         ~EditToClip();
105         int handle_event();
106         int keypress_event();
107         MWindow *mwindow;
108         EditPanel *panel;
109 };
110
111 class EditManualGoto : public BC_Button
112 {
113 public:
114         EditManualGoto(MWindow *mwindow, EditPanel *panel, int x, int y);
115         ~EditManualGoto();
116         int handle_event();
117         int keypress_event();
118         MWindow *mwindow;
119         EditPanel *panel;
120         ManualGoto *mangoto;
121 };
122
123 class EditCut : public BC_Button
124 {
125 public:
126         EditCut(MWindow *mwindow, EditPanel *panel, int x, int y);
127         ~EditCut();
128
129         int keypress_event();
130         int handle_event();
131
132         MWindow *mwindow;
133         EditPanel *panel;
134 };
135
136 class EditCommercial : public BC_Button
137 {
138 public:
139         EditCommercial(MWindow *mwindow, EditPanel *panel, int x, int y);
140         ~EditCommercial();
141
142         int keypress_event();
143         int handle_event();
144
145         MWindow *mwindow;
146         EditPanel *panel;
147 };
148
149 class EditClick2Play : public BC_Toggle
150 {
151 public:
152         EditClick2Play(MWindow *mwindow, EditPanel *panel, int x, int y);
153         EditClick2Play();
154
155         int handle_event();
156         int keypress_event();
157
158         MWindow *mwindow;
159         EditPanel *panel;
160 };
161
162 class EditCopy : public BC_Button
163 {
164 public:
165         EditCopy(MWindow *mwindow, EditPanel *panel, int x, int y);
166         ~EditCopy();
167
168         int keypress_event();
169         int handle_event();
170
171         MWindow *mwindow;
172         EditPanel *panel;
173 };
174
175 class EditPaste : public BC_Button
176 {
177 public:
178         EditPaste(MWindow *mwindow, EditPanel *panel, int x, int y);
179         ~EditPaste();
180
181         int keypress_event();
182         int handle_event();
183
184         MWindow *mwindow;
185         EditPanel *panel;
186 };
187
188 class EditUndo : public BC_Button
189 {
190 public:
191         EditUndo(MWindow *mwindow, EditPanel *panel, int x, int y);
192         ~EditUndo();
193         int keypress_event();
194         int handle_event();
195         MWindow *mwindow;
196         EditPanel *panel;
197 };
198
199 class EditRedo : public BC_Button
200 {
201 public:
202         EditRedo(MWindow *mwindow, EditPanel *panel, int x, int y);
203         ~EditRedo();
204         int keypress_event();
205         int handle_event();
206         MWindow *mwindow;
207         EditPanel *panel;
208 };
209
210 class EditLabelbutton : public BC_Button
211 {
212 public:
213         EditLabelbutton(MWindow *mwindow, EditPanel *panel, int x, int y);
214         ~EditLabelbutton();
215         int keypress_event();
216         int handle_event();
217         MWindow *mwindow;
218         EditPanel *panel;
219 };
220
221 class EditFit : public BC_Button
222 {
223 public:
224         EditFit(MWindow *mwindow, EditPanel *panel, int x, int y);
225         ~EditFit();
226         int keypress_event();
227         int handle_event();
228         MWindow *mwindow;
229         EditPanel *panel;
230 };
231
232 class EditFitAutos : public BC_Button
233 {
234 public:
235         EditFitAutos(MWindow *mwindow, EditPanel *panel, int x, int y);
236         ~EditFitAutos();
237         int keypress_event();
238         int handle_event();
239         MWindow *mwindow;
240         EditPanel *panel;
241 };
242
243
244 class EditPrevLabel : public BC_Button
245 {
246 public:
247         EditPrevLabel(MWindow *mwindow, EditPanel *panel, int x, int y);
248         ~EditPrevLabel();
249
250         int keypress_event();
251         int handle_event();
252
253         MWindow *mwindow;
254         EditPanel *panel;
255 };
256
257 class EditNextLabel : public BC_Button
258 {
259 public:
260         EditNextLabel(MWindow *mwindow, EditPanel *panel, int x, int y);
261         ~EditNextLabel();
262
263         int keypress_event();
264         int handle_event();
265
266         MWindow *mwindow;
267         EditPanel *panel;
268 };
269
270 class EditPrevEdit : public BC_Button
271 {
272 public:
273         EditPrevEdit(MWindow *mwindow, EditPanel *panel, int x, int y);
274         ~EditPrevEdit();
275
276         int keypress_event();
277         int handle_event();
278
279         MWindow *mwindow;
280         EditPanel *panel;
281 };
282
283 class EditNextEdit : public BC_Button
284 {
285 public:
286         EditNextEdit(MWindow *mwindow, EditPanel *panel, int x, int y);
287         ~EditNextEdit();
288
289         int keypress_event();
290         int handle_event();
291
292         MWindow *mwindow;
293         EditPanel *panel;
294 };
295
296
297 class ArrowButton : public BC_Toggle
298 {
299 public:
300         ArrowButton(MWindow *mwindow, EditPanel *panel, int x, int y);
301         int handle_event();
302         MWindow *mwindow;
303         EditPanel *panel;
304 };
305
306 class IBeamButton : public BC_Toggle
307 {
308 public:
309         IBeamButton(MWindow *mwindow, EditPanel *panel, int x, int y);
310         int handle_event();
311         MWindow *mwindow;
312         EditPanel *panel;
313 };
314
315 class KeyFrameButton : public BC_Toggle
316 {
317 public:
318         KeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y);
319         int handle_event();
320         int keypress_event();
321         MWindow *mwindow;
322         EditPanel *panel;
323 };
324
325 class SpanKeyFrameButton : public BC_Toggle
326 {
327 public:
328         SpanKeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y);
329         int handle_event();
330         MWindow *mwindow;
331         EditPanel *panel;
332 };
333
334 class LockLabelsButton : public BC_Toggle
335 {
336 public:
337         LockLabelsButton(MWindow *mwindow, EditPanel *panel, int x, int y);
338         int handle_event();
339         MWindow *mwindow;
340         EditPanel *panel;
341 };
342
343
344 class EditPanel
345 {
346 public:
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,
351                 int use_keyframe,
352                 int use_splice,   // Extra buttons
353                 int use_overwrite,
354                 int use_copy,  // Use copy when in EDITING_ARROW
355                 int use_paste,
356                 int use_undo,
357                 int use_fit,
358                 int use_locklabels,
359                 int use_labels,
360                 int use_toclip,
361                 int use_meters,
362                 int use_cut,
363                 int use_commerical,
364                 int use_goto,
365                 int use_clk2play);
366         ~EditPanel();
367
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);
371         void update();
372         void create_buttons();
373         void stop_transport(const char *lock_msg);
374         void reposition_buttons(int x, int y);
375         void create_objects();
376         int get_w();
377
378         virtual double get_position() = 0;
379         virtual void set_position(double position) = 0;
380         virtual void set_click_to_play(int v) = 0;
381
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;
403
404         MWindow *mwindow;
405         BC_WindowBase *subwindow;
406         MeterPanel *meter_panel;
407
408         int window_id;
409         int x, y, x1, y1;
410         int editing_mode;
411         int use_editing_mode;
412         int use_keyframe;
413         int use_splice;
414         int use_overwrite;
415         int use_paste;
416         int use_undo;
417         int use_fit;
418         int use_copy;
419         int use_locklabels;
420         int use_labels;
421         int use_toclip;
422         int use_meters;
423         int use_cut;
424         int use_commercial;
425         int use_goto;
426         int use_clk2play;
427
428         EditFit *fit;
429         EditFitAutos *fit_autos;
430         EditInPoint *inpoint;
431         EditOutPoint *outpoint;
432 //      EditDelInPoint *delinpoint;
433 //      EditDelOutPoint *deloutpoint;
434         EditSplice *splice;
435         EditOverwrite *overwrite;
436         EditToClip *clip;
437         EditCut *cut;
438         EditCommercial *commercial;
439         EditManualGoto *mangoto;
440         EditClick2Play *click2play;
441         EditCopy *copy;
442         EditPaste *paste;
443         EditLabelbutton *labelbutton;
444         EditPrevLabel *prevlabel;
445         EditNextLabel *nextlabel;
446         EditPrevEdit *prevedit;
447         EditNextEdit *nextedit;
448         EditUndo *undo;
449         EditRedo *redo;
450         MeterShow *meters;
451         ArrowButton *arrow;
452         IBeamButton *ibeam;
453         KeyFrameButton *keyframe;
454         SpanKeyFrameButton *span_keyframe;
455         LockLabelsButton *locklabels;
456
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; }
460 };
461
462 #endif