remove Features5, rework gradient plugin, fix paste_edl track title bug, gl_probe...
[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 LockLabelsButton : public BC_Toggle
326 {
327 public:
328         LockLabelsButton(MWindow *mwindow, EditPanel *panel, int x, int y);
329         int handle_event();
330         MWindow *mwindow;
331         EditPanel *panel;
332 };
333
334
335 class EditPanel
336 {
337 public:
338         EditPanel(MWindow *mwindow, BC_WindowBase *subwindow,
339                 int window_id, int x, int y,
340                 int editing_mode,   // From edl.inc
341                 int use_editing_mode,
342                 int use_keyframe,
343                 int use_splice,   // Extra buttons
344                 int use_overwrite,
345                 int use_copy,  // Use copy when in EDITING_ARROW
346                 int use_paste,
347                 int use_undo,
348                 int use_fit,
349                 int use_locklabels,
350                 int use_labels,
351                 int use_toclip,
352                 int use_meters,
353                 int use_cut,
354                 int use_commerical,
355                 int use_goto,
356                 int use_clk2play);
357         ~EditPanel();
358
359         void set_meters(MeterPanel *meter_panel);
360         static int calculate_w(MWindow *mwindow, int use_keyframe, int total_buttons);
361         static int calculate_h(MWindow *mwindow);
362         void update();
363         void create_buttons();
364         void stop_transport(const char *lock_msg);
365         void reposition_buttons(int x, int y);
366         void create_objects();
367         int get_w();
368
369         virtual double get_position() = 0;
370         virtual void set_position(double position) = 0;
371         virtual void set_click_to_play(int v) = 0;
372
373         virtual void panel_stop_transport() = 0;
374         virtual void panel_toggle_label() = 0;
375         virtual void panel_next_label(int cut) = 0;
376         virtual void panel_prev_label(int cut) = 0;
377         virtual void panel_prev_edit(int cut) = 0;
378         virtual void panel_next_edit(int cut) = 0;
379         virtual void panel_copy_selection() = 0;
380         virtual void panel_overwrite_selection() = 0;
381         virtual void panel_splice_selection() = 0;
382         virtual void panel_set_inpoint() = 0;
383         virtual void panel_set_outpoint() = 0;
384         virtual void panel_unset_inoutpoint() = 0;
385         virtual void panel_to_clip() = 0;
386         virtual void panel_cut() = 0;
387         virtual void panel_paste() = 0;
388         virtual void panel_fit_selection() = 0;
389         virtual void panel_fit_autos(int all) = 0;
390         virtual void panel_set_editing_mode(int mode) = 0;
391         virtual void panel_set_auto_keyframes(int v) = 0;
392         virtual void panel_set_labels_follow_edits(int v) = 0;
393
394         MWindow *mwindow;
395         BC_WindowBase *subwindow;
396         MeterPanel *meter_panel;
397
398         int window_id;
399         int x, y, x1, y1;
400         int editing_mode;
401         int use_editing_mode;
402         int use_keyframe;
403         int use_splice;
404         int use_overwrite;
405         int use_paste;
406         int use_undo;
407         int use_fit;
408         int use_copy;
409         int use_locklabels;
410         int use_labels;
411         int use_toclip;
412         int use_meters;
413         int use_cut;
414         int use_commercial;
415         int use_goto;
416         int use_clk2play;
417
418         EditFit *fit;
419         EditFitAutos *fit_autos;
420         EditInPoint *inpoint;
421         EditOutPoint *outpoint;
422 //      EditDelInPoint *delinpoint;
423 //      EditDelOutPoint *deloutpoint;
424         EditSplice *splice;
425         EditOverwrite *overwrite;
426         EditToClip *clip;
427         EditCut *cut;
428         EditCommercial *commercial;
429         EditManualGoto *mangoto;
430         EditClick2Play *click2play;
431         EditCopy *copy;
432         EditPaste *paste;
433         EditLabelbutton *labelbutton;
434         EditPrevLabel *prevlabel;
435         EditNextLabel *nextlabel;
436         EditPrevEdit *prevedit;
437         EditNextEdit *nextedit;
438         EditUndo *undo;
439         EditRedo *redo;
440         MeterShow *meters;
441         ArrowButton *arrow;
442         IBeamButton *ibeam;
443         KeyFrameButton *keyframe;
444         LockLabelsButton *locklabels;
445
446         int is_mwindow() { return window_id == MWINDOW_ID; }
447         int is_cwindow() { return window_id == CWINDOW_ID; }
448         int is_vwindow() { return window_id == VWINDOW_ID; }
449 };
450
451 #endif