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