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