last push faux paux, update shortcuts doc, period/comma alt shortcuts, popup deactiva...
[goodguy/history.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 EditLift : public BC_Button
101 {
102 public:
103         EditLift(MWindow *mwindow, EditPanel *panel, int x, int y);
104         ~EditLift();
105         int handle_event();
106         MWindow *mwindow;
107         EditPanel *panel;
108 };
109
110 class EditExtract : public BC_Button
111 {
112 public:
113         EditExtract(MWindow *mwindow, EditPanel *panel, int x, int y);
114         ~EditExtract();
115         int handle_event();
116         MWindow *mwindow;
117         EditPanel *panel;
118 };
119
120 class EditToClip : public BC_Button
121 {
122 public:
123         EditToClip(MWindow *mwindow, EditPanel *panel, int x, int y);
124         ~EditToClip();
125         int handle_event();
126         int keypress_event();
127         MWindow *mwindow;
128         EditPanel *panel;
129 };
130
131 class EditManualGoto : public BC_Button
132 {
133 public:
134         EditManualGoto(MWindow *mwindow, EditPanel *panel, int x, int y);
135         ~EditManualGoto();
136         int handle_event();
137         int keypress_event();
138         MWindow *mwindow;
139         EditPanel *panel;
140         ManualGoto *mangoto;
141 };
142
143 class EditCut : public BC_Button
144 {
145 public:
146         EditCut(MWindow *mwindow, EditPanel *panel, int x, int y);
147         ~EditCut();
148
149         int keypress_event();
150         int handle_event();
151
152         MWindow *mwindow;
153         EditPanel *panel;
154 };
155
156 class EditCommercial : public BC_Button
157 {
158 public:
159         EditCommercial(MWindow *mwindow, EditPanel *panel, int x, int y);
160         ~EditCommercial();
161
162         int keypress_event();
163         int handle_event();
164
165         MWindow *mwindow;
166         EditPanel *panel;
167 };
168
169 class EditClick2Play : public BC_Toggle
170 {
171 public:
172         EditClick2Play(MWindow *mwindow, EditPanel *panel, int x, int y);
173         EditClick2Play();
174
175         int handle_event();
176
177         MWindow *mwindow;
178         EditPanel *panel;
179 };
180
181 class EditCopy : public BC_Button
182 {
183 public:
184         EditCopy(MWindow *mwindow, EditPanel *panel, int x, int y);
185         ~EditCopy();
186
187         int keypress_event();
188         int handle_event();
189
190         MWindow *mwindow;
191         EditPanel *panel;
192 };
193
194 class EditAppend : public BC_Button
195 {
196 public:
197         EditAppend(MWindow *mwindow, EditPanel *panel, int x, int y);
198         ~EditAppend();
199
200         int handle_event();
201
202         MWindow *mwindow;
203         EditPanel *panel;
204 };
205
206 class EditInsert : public BC_Button
207 {
208 public:
209         EditInsert(MWindow *mwindow, EditPanel *panel, int x, int y);
210         ~EditInsert();
211
212         int handle_event();
213
214         MWindow *mwindow;
215         EditPanel *panel;
216 };
217
218 class EditPaste : public BC_Button
219 {
220 public:
221         EditPaste(MWindow *mwindow, EditPanel *panel, int x, int y);
222         ~EditPaste();
223
224         int keypress_event();
225         int handle_event();
226
227         MWindow *mwindow;
228         EditPanel *panel;
229 };
230
231 class EditTransition : public BC_Button
232 {
233 public:
234         EditTransition(MWindow *mwindow, EditPanel *panel, int x, int y);
235         ~EditTransition();
236         int handle_event();
237         MWindow *mwindow;
238         EditPanel *panel;
239 };
240
241 class EditPresentation : public BC_Button
242 {
243 public:
244         EditPresentation(MWindow *mwindow, EditPanel *panel, int x, int y);
245         ~EditPresentation();
246         int handle_event();
247         MWindow *mwindow;
248         EditPanel *panel;
249 };
250
251 class EditUndo : public BC_Button
252 {
253 public:
254         EditUndo(MWindow *mwindow, EditPanel *panel, int x, int y);
255         ~EditUndo();
256         int keypress_event();
257         int handle_event();
258         MWindow *mwindow;
259         EditPanel *panel;
260 };
261
262 class EditRedo : public BC_Button
263 {
264 public:
265         EditRedo(MWindow *mwindow, EditPanel *panel, int x, int y);
266         ~EditRedo();
267         int keypress_event();
268         int handle_event();
269         MWindow *mwindow;
270         EditPanel *panel;
271 };
272
273 class EditLabelbutton : public BC_Button
274 {
275 public:
276         EditLabelbutton(MWindow *mwindow, EditPanel *panel, int x, int y);
277         ~EditLabelbutton();
278         int keypress_event();
279         int handle_event();
280         MWindow *mwindow;
281         EditPanel *panel;
282 };
283
284 class EditFit : public BC_Button
285 {
286 public:
287         EditFit(MWindow *mwindow, EditPanel *panel, int x, int y);
288         ~EditFit();
289         int keypress_event();
290         int handle_event();
291         MWindow *mwindow;
292         EditPanel *panel;
293 };
294
295 class EditFitAutos : public BC_Button
296 {
297 public:
298         EditFitAutos(MWindow *mwindow, EditPanel *panel, int x, int y);
299         ~EditFitAutos();
300         int keypress_event();
301         int handle_event();
302         MWindow *mwindow;
303         EditPanel *panel;
304 };
305
306
307 class EditPrevLabel : public BC_Button
308 {
309 public:
310         EditPrevLabel(MWindow *mwindow, EditPanel *panel, int x, int y);
311         ~EditPrevLabel();
312
313         int keypress_event();
314         int handle_event();
315
316         MWindow *mwindow;
317         EditPanel *panel;
318 };
319
320 class EditNextLabel : public BC_Button
321 {
322 public:
323         EditNextLabel(MWindow *mwindow, EditPanel *panel, int x, int y);
324         ~EditNextLabel();
325
326         int keypress_event();
327         int handle_event();
328
329         MWindow *mwindow;
330         EditPanel *panel;
331 };
332
333 class EditPrevEdit : public BC_Button
334 {
335 public:
336         EditPrevEdit(MWindow *mwindow, EditPanel *panel, int x, int y);
337         ~EditPrevEdit();
338
339         int keypress_event();
340         int handle_event();
341
342         MWindow *mwindow;
343         EditPanel *panel;
344 };
345
346 class EditNextEdit : public BC_Button
347 {
348 public:
349         EditNextEdit(MWindow *mwindow, EditPanel *panel, int x, int y);
350         ~EditNextEdit();
351
352         int keypress_event();
353         int handle_event();
354
355         MWindow *mwindow;
356         EditPanel *panel;
357 };
358
359
360 class ArrowButton : public BC_Toggle
361 {
362 public:
363         ArrowButton(MWindow *mwindow, EditPanel *panel, int x, int y);
364         int handle_event();
365         MWindow *mwindow;
366         EditPanel *panel;
367 };
368
369 class IBeamButton : public BC_Toggle
370 {
371 public:
372         IBeamButton(MWindow *mwindow, EditPanel *panel, int x, int y);
373         int handle_event();
374         MWindow *mwindow;
375         EditPanel *panel;
376 };
377
378 class KeyFrameButton : public BC_Toggle
379 {
380 public:
381         KeyFrameButton(MWindow *mwindow, EditPanel *panel, int x, int y);
382         int handle_event();
383         MWindow *mwindow;
384         EditPanel *panel;
385 };
386
387 class LockLabelsButton : public BC_Toggle
388 {
389 public:
390         LockLabelsButton(MWindow *mwindow, int x, int y);
391         int handle_event();
392         MWindow *mwindow;
393 };
394
395
396 class EditPanel
397 {
398 public:
399         EditPanel(MWindow *mwindow, BC_WindowBase *subwindow,
400                 int window_id, int x, int y,
401                 int editing_mode,   // From edl.inc
402                 int use_editing_mode,
403                 int use_keyframe,
404                 int use_splice,   // Extra buttons
405                 int use_overwrite,
406                 int use_lift,
407                 int use_extract,
408                 int use_copy,  // Use copy when in EDITING_ARROW
409                 int use_paste,
410                 int use_undo,
411                 int use_fit,
412                 int use_locklabels,
413                 int use_labels,
414                 int use_toclip,
415                 int use_meters,
416                 int use_cut,
417                 int use_commerical,
418                 int use_goto,
419                 int use_clk2play);
420         ~EditPanel();
421
422         void set_meters(MeterPanel *meter_panel);
423         static int calculate_w(MWindow *mwindow, int use_keyframe, int total_buttons);
424         static int calculate_h(MWindow *mwindow);
425         void update();
426         void create_buttons();
427         void stop_transport(const char *lock_msg);
428         void reposition_buttons(int x, int y);
429         void create_objects();
430         int get_w();
431         virtual void copy_selection();
432         virtual void splice_selection();
433         virtual void overwrite_selection();
434         virtual void set_inpoint();
435         virtual void set_outpoint();
436         virtual void unset_inoutpoint();
437         virtual void to_clip() = 0;
438         virtual void toggle_label();
439         virtual void prev_label(int cut);
440         virtual void next_label(int cut);
441         virtual void prev_edit(int cut);
442         virtual void next_edit(int cut);
443         virtual double get_position();
444         virtual void set_position(double position);
445
446         MWindow *mwindow;
447         BC_WindowBase *subwindow;
448         MeterPanel *meter_panel;
449
450         int window_id;
451         int x, y, x1, y1;
452         int editing_mode;
453         int use_editing_mode;
454         int use_keyframe;
455         int use_splice;
456         int use_overwrite;
457         int use_lift;
458         int use_extract;
459         int use_paste;
460         int use_undo;
461         int use_fit;
462         int use_copy;
463         int use_locklabels;
464         int use_labels;
465         int use_toclip;
466         int use_meters;
467         int use_cut;
468         int use_commercial;
469         int use_goto;
470         int use_clk2play;
471
472         EditFit *fit;
473         EditFitAutos *fit_autos;
474         EditInPoint *inpoint;
475         EditOutPoint *outpoint;
476 //      EditDelInPoint *delinpoint;
477 //      EditDelOutPoint *deloutpoint;
478         EditSplice *splice;
479         EditOverwrite *overwrite;
480         EditLift *lift;
481         EditExtract *extract;
482         EditToClip *clip;
483         EditCut *cut;
484         EditCommercial *commercial;
485         EditManualGoto *mangoto;
486         EditClick2Play *click2play;
487         EditCopy *copy;
488         EditPaste *paste;
489         EditLabelbutton *labelbutton;
490         EditPrevLabel *prevlabel;
491         EditNextLabel *nextlabel;
492         EditPrevEdit *prevedit;
493         EditNextEdit *nextedit;
494         EditUndo *undo;
495         EditRedo *redo;
496         MeterShow *meters;
497         ArrowButton *arrow;
498         IBeamButton *ibeam;
499         KeyFrameButton *keyframe;
500         LockLabelsButton *locklabels;
501
502         int is_mwindow() { return window_id == MWINDOW_ID; }
503         int is_cwindow() { return window_id == CWINDOW_ID; }
504         int is_vwindow() { return window_id == VWINDOW_ID; }
505 };
506
507 #endif