add shuttle udev rules to doc, fix still images drag handle
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / mainmenu.h
1
2 /*
3  * CINELERRA
4  * Copyright (C) 1997-2014 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 MAINMENU_H
23 #define MAINMENU_H
24
25 #include "arraylist.h"
26 #include "guicast.h"
27 #include "bchash.inc"
28 #include "loadfile.inc"
29 #include "mainmenu.inc"
30 #include "mwindow.inc"
31 #include "mwindowgui.inc"
32 #include "maxchannels.h"
33 #include "menuaeffects.inc"
34 #include "menuveffects.inc"
35 #include "module.inc"
36 #include "new.inc"
37 #include "plugindialog.inc"
38 #include "quit.inc"
39 #include "record.inc"
40 #include "render.inc"
41 #include "threadloader.inc"
42 #include "viewmenu.inc"
43
44 #define TOTAL_LOADS 10      // number of files to cache
45 #define TOTAL_EFFECTS 10     // number of effects to cache
46
47 #define LAYOUT_LOAD 0
48 #define LAYOUT_SAVE 1
49
50 class MainMenu : public BC_MenuBar
51 {
52 public:
53         MainMenu(MWindow *mwindow, MWindowGUI *gui, int w);
54         ~MainMenu();
55         void create_objects();
56         int load_defaults(BC_Hash *defaults);
57         int save_defaults(BC_Hash *defaults);
58
59 // most recent loads
60         int add_load(char *path);
61         void init_loads(BC_Hash *defaults);
62
63 // most recent effects
64         int init_aeffects(BC_Hash *defaults);
65         int save_aeffects(BC_Hash *defaults);
66         int add_aeffect(char *title);
67         int init_veffects(BC_Hash *defaults);
68         int save_veffects(BC_Hash *defaults);
69         int save_loads(BC_Hash *defaults);
70         int add_veffect(char *title);
71
72         int quit();
73 // show only one of these at a time
74         int set_show_autos();
75         void update_toggles(int use_lock);
76
77         MWindowGUI *gui;
78         MWindow *mwindow;
79         ThreadLoader *threadloader;
80         MenuAEffects *aeffects;
81         MenuVEffects *veffects;
82
83         Load *load_file;
84         LoadPrevious *load[TOTAL_LOADS];
85         int total_loads;
86
87         RecordMenuItem *record_menu_item;
88         RenderItem *render;
89         NewProject *new_project;
90         MenuAEffectItem *aeffect[TOTAL_EFFECTS];
91         MenuVEffectItem *veffect[TOTAL_EFFECTS];
92         Quit *quit_program;              // affected by save
93         MainDumpsMenu *dump_menu;
94         Undo *undo;
95         Redo *redo;
96         int total_aeffects;
97         int total_veffects;
98         BC_Menu *filemenu, *audiomenu, *videomenu;      // needed by most recents
99
100         KeyframeCurveType *keyframe_curve_type;
101         LabelsFollowEdits *labels_follow_edits;
102         PluginsFollowEdits *plugins_follow_edits;
103         KeyframesFollowEdits *keyframes_follow_edits;
104         CursorOnFrames *cursor_on_frames;
105         TypelessKeyframes *typeless_keyframes;
106         SetBRenderActive *brender_active;
107         LoopPlayback *loop_playback;
108         ShowAssets *show_assets;
109         ShowTitles *show_titles;
110         ShowTransitions *show_transitions;
111         ShowAutomation *fade_automation;
112         ShowAutomation *mute_automation;
113         ShowAutomation *pan_automation;
114         ShowAutomation *camera_x;
115         ShowAutomation *camera_y;
116         ShowAutomation *camera_z;
117         ShowAutomation *project_x;
118         ShowAutomation *project_y;
119         ShowAutomation *project_z;
120         PluginAutomation *plugin_automation;
121         ShowAutomation *mask_automation;
122         ShowAutomation *mode_automation;
123         ShowAutomation *speed_automation;
124         ShowVWindow *show_vwindow;
125         ShowAWindow *show_awindow;
126         ShowCWindow *show_cwindow;
127         ShowGWindow *show_gwindow;
128         ShowLWindow *show_lwindow;
129         SplitX *split_x;
130         SplitY *split_y;
131         MixerViewer *mixer_viewer;
132         LoadLayout *load_layout;
133         LoadLayout *save_layout;
134 };
135
136 // ========================================= edit
137
138 class Undo : public BC_MenuItem
139 {
140 public:
141         Undo(MWindow *mwindow);
142         int handle_event();
143         int update_caption(const char *new_caption = "");
144         MWindow *mwindow;
145 };
146
147 class MainDumpsSubMenu : public BC_SubMenu
148 {
149 public:
150         MainDumpsSubMenu(BC_MenuItem *menu_item);
151         ~MainDumpsSubMenu();
152
153         BC_MenuItem *menu_item;
154 };
155
156 class MainDumpsMenu : public BC_MenuItem
157 {
158 public:
159         MainDumpsMenu(MWindow *mwindow);
160         ~MainDumpsMenu();
161         void create_objects();
162
163         MWindow *mwindow;
164         MainDumpsSubMenu *dumps_menu;
165 };
166
167 class DumpCICache : public BC_MenuItem
168 {
169 public:
170         DumpCICache(MWindow *mwindow);
171         int handle_event();
172         MWindow *mwindow;
173 };
174
175 class DumpEDL : public BC_MenuItem
176 {
177 public:
178         DumpEDL(MWindow *mwindow);
179         int handle_event();
180         MWindow *mwindow;
181 };
182
183 class DumpPlugins : public BC_MenuItem
184 {
185 public:
186         DumpPlugins(MWindow *mwindow);
187         int handle_event();
188         MWindow *mwindow;
189 };
190
191 class DumpAssets : public BC_MenuItem
192 {
193 public:
194         DumpAssets(MWindow *mwindow);
195         int handle_event();
196         MWindow *mwindow;
197 };
198
199 class DumpUndo : public BC_MenuItem
200 {
201 public:
202         DumpUndo(MWindow *mwindow);
203         int handle_event();
204         MWindow *mwindow;
205 };
206
207 class Redo : public BC_MenuItem
208 {
209 public:
210         Redo(MWindow *mwindow);
211         int handle_event();
212         int update_caption(const char *new_caption = "");
213         MWindow *mwindow;
214 };
215
216 class Cut : public BC_MenuItem
217 {
218 public:
219         Cut(MWindow *mwindow);
220         int handle_event();
221         MWindow *mwindow;
222 };
223
224 class Copy : public BC_MenuItem
225 {
226 public:
227         Copy(MWindow *mwindow);
228         int handle_event();
229         MWindow *mwindow;
230 };
231
232 class Paste : public BC_MenuItem
233 {
234 public:
235         Paste(MWindow *mwindow);
236         int handle_event();
237         MWindow *mwindow;
238 };
239
240 class Clear : public BC_MenuItem
241 {
242 public:
243         Clear(MWindow *mwindow);
244         int handle_event();
245         MWindow *mwindow;
246 };
247
248 class CutKeyframes : public BC_MenuItem
249 {
250 public:
251         CutKeyframes(MWindow *mwindow);
252         int handle_event();
253         MWindow *mwindow;
254 };
255
256 class CopyKeyframes : public BC_MenuItem
257 {
258 public:
259         CopyKeyframes(MWindow *mwindow);
260         int handle_event();
261         MWindow *mwindow;
262 };
263
264 class PasteKeyframes : public BC_MenuItem
265 {
266 public:
267         PasteKeyframes(MWindow *mwindow);
268         int handle_event();
269         MWindow *mwindow;
270 };
271
272
273 class ClearKeyframes : public BC_MenuItem
274 {
275 public:
276         ClearKeyframes(MWindow *mwindow);
277         int handle_event();
278         MWindow *mwindow;
279 };
280
281 class StraightenKeyframes : public BC_MenuItem
282 {
283 public:
284         StraightenKeyframes(MWindow *mwindow);
285         int handle_event();
286         MWindow *mwindow;
287 };
288
289 class BendKeyframes : public BC_MenuItem
290 {
291 public:
292         BendKeyframes(MWindow *mwindow);
293         int handle_event();
294         MWindow *mwindow;
295 };
296
297 class KeyframeCurveType : public BC_MenuItem
298 {
299 public:
300         KeyframeCurveType(MWindow *mwindow);
301         ~KeyframeCurveType();
302
303         void create_objects();
304         void update(int curve_type);
305         int handle_event();
306
307         MWindow *mwindow;
308         KeyframeCurveTypeMenu *curve_menu;
309 };
310
311 class KeyframeCurveTypeMenu : public BC_SubMenu
312 {
313 public:
314         KeyframeCurveTypeMenu(KeyframeCurveType *menu_item);
315         ~KeyframeCurveTypeMenu();
316
317         KeyframeCurveType *menu_item;
318 };
319
320 class KeyframeCurveTypeItem : public BC_MenuItem
321 {
322 public:
323         KeyframeCurveTypeItem(int type, KeyframeCurveType *main_item);
324         ~KeyframeCurveTypeItem();
325
326         KeyframeCurveType *main_item;
327         int type;
328
329         int handle_event();
330 };
331
332 class CutDefaultKeyframe : public BC_MenuItem
333 {
334 public:
335         CutDefaultKeyframe(MWindow *mwindow);
336         int handle_event();
337         MWindow *mwindow;
338 };
339
340 class CopyDefaultKeyframe : public BC_MenuItem
341 {
342 public:
343         CopyDefaultKeyframe(MWindow *mwindow);
344         int handle_event();
345         MWindow *mwindow;
346 };
347
348 class PasteDefaultKeyframe : public BC_MenuItem
349 {
350 public:
351         PasteDefaultKeyframe(MWindow *mwindow);
352         int handle_event();
353         MWindow *mwindow;
354 };
355
356 class ClearDefaultKeyframe : public BC_MenuItem
357 {
358 public:
359         ClearDefaultKeyframe(MWindow *mwindow);
360         int handle_event();
361         MWindow *mwindow;
362 };
363
364 class PasteSilence : public BC_MenuItem
365 {
366 public:
367         PasteSilence(MWindow *mwindow);
368         int handle_event();
369         MWindow *mwindow;
370 };
371
372 class SelectAll : public BC_MenuItem
373 {
374 public:
375         SelectAll(MWindow *mwindow);
376         int handle_event();
377         MWindow *mwindow;
378 };
379
380 class ClearLabels : public BC_MenuItem
381 {
382 public:
383         ClearLabels(MWindow *mwindow);
384         int handle_event();
385         MWindow *mwindow;
386 };
387
388 class CutCommercials : public BC_MenuItem
389 {
390 public:
391         CutCommercials(MWindow *mwindow);
392         int handle_event();
393         MWindow *mwindow;
394 };
395
396 class DetachTransitions : public BC_MenuItem
397 {
398 public:
399         DetachTransitions(MWindow *mwindow);
400         int handle_event();
401         MWindow *mwindow;
402 };
403
404 class MuteSelection : public BC_MenuItem
405 {
406 public:
407         MuteSelection(MWindow *mwindow);
408         int handle_event();
409         MWindow *mwindow;
410 };
411
412 class TrimSelection : public BC_MenuItem
413 {
414 public:
415         TrimSelection(MWindow *mwindow);
416         int handle_event();
417         MWindow *mwindow;
418 };
419
420 class TileMixers : public BC_MenuItem
421 {
422 public:
423         TileMixers(MWindow *mwindow);
424         int handle_event();
425         MWindow *mwindow;
426 };
427
428 // ======================================== audio
429
430 class AddAudioTrack : public BC_MenuItem
431 {
432 public:
433         AddAudioTrack(MWindow *mwindow);
434         int handle_event();
435         MWindow *mwindow;
436 };
437
438 class DeleteAudioTrack : public BC_MenuItem
439 {
440 public:
441         DeleteAudioTrack(MWindow *mwindow);
442         int handle_event();
443         MWindow *mwindow;
444 };
445
446 class DefaultATransition : public BC_MenuItem
447 {
448 public:
449         DefaultATransition(MWindow *mwindow);
450         int handle_event();
451         MWindow *mwindow;
452 };
453
454 class MapAudio1 : public BC_MenuItem
455 {
456 public:
457         MapAudio1(MWindow *mwindow);
458         int handle_event();
459         MWindow *mwindow;
460 };
461
462 class MapAudio2 : public BC_MenuItem
463 {
464 public:
465         MapAudio2(MWindow *mwindow);
466         int handle_event();
467         MWindow *mwindow;
468 };
469
470 // ========================================== video
471
472
473 class AddVideoTrack : public BC_MenuItem
474 {
475 public:
476         AddVideoTrack(MWindow *mwindow);
477         int handle_event();
478         MWindow *mwindow;
479 };
480
481
482 class DeleteVideoTrack : public BC_MenuItem
483 {
484 public:
485         DeleteVideoTrack(MWindow *mwindow);
486         int handle_event();
487         MWindow *mwindow;
488 };
489
490 class ResetTranslation : public BC_MenuItem
491 {
492 public:
493         ResetTranslation(MWindow *mwindow);
494         int handle_event();
495         MWindow *mwindow;
496 };
497
498 class DefaultVTransition : public BC_MenuItem
499 {
500 public:
501         DefaultVTransition(MWindow *mwindow);
502         int handle_event();
503         MWindow *mwindow;
504 };
505
506
507 // ========================================== subtitle
508
509 class AddSubttlTrack : public BC_MenuItem
510 {
511 public:
512         AddSubttlTrack(MWindow *mwindow);
513         int handle_event();
514         MWindow *mwindow;
515 };
516
517 class PasteSubttl : public BC_MenuItem
518 {
519 public:
520         PasteSubttl(MWindow *mwindow);
521         int handle_event();
522         MWindow *mwindow;
523 };
524
525
526 // ========================================== settings
527
528
529 class MoveTracksUp : public BC_MenuItem
530 {
531 public:
532         MoveTracksUp(MWindow *mwindow);
533         int handle_event();
534         MWindow *mwindow;
535 };
536
537 class MoveTracksDown : public BC_MenuItem
538 {
539 public:
540         MoveTracksDown(MWindow *mwindow);
541         int handle_event();
542         MWindow *mwindow;
543 };
544
545 class DeleteTracks : public BC_MenuItem
546 {
547 public:
548         DeleteTracks(MWindow *mwindow);
549         int handle_event();
550         MWindow *mwindow;
551 };
552
553 class ConcatenateTracks : public BC_MenuItem
554 {
555 public:
556         ConcatenateTracks(MWindow *mwindow);
557         int handle_event();
558         MWindow *mwindow;
559 };
560
561 class DeleteTrack : public BC_MenuItem
562 {
563 public:
564         DeleteTrack(MWindow *mwindow);
565         int handle_event();
566         MWindow *mwindow;
567 };
568
569 class LoopPlayback : public BC_MenuItem
570 {
571 public:
572         LoopPlayback(MWindow *mwindow);
573
574         int handle_event();
575         MWindow *mwindow;
576 };
577
578 class SetBRenderActive : public BC_MenuItem
579 {
580 public:
581         SetBRenderActive(MWindow *mwindow);
582         int handle_event();
583         MWindow *mwindow;
584 };
585
586 class LabelsFollowEdits : public BC_MenuItem
587 {
588 public:
589         LabelsFollowEdits(MWindow *mwindow);
590         int handle_event();
591         MWindow *mwindow;
592 };
593
594 class PluginsFollowEdits : public BC_MenuItem
595 {
596 public:
597         PluginsFollowEdits(MWindow *mwindow);
598         int handle_event();
599         MWindow *mwindow;
600 };
601
602 class KeyframesFollowEdits : public BC_MenuItem
603 {
604 public:
605         KeyframesFollowEdits(MWindow *mwindow);
606         int handle_event();
607         MWindow *mwindow;
608 };
609
610 class CursorOnFrames : public BC_MenuItem
611 {
612 public:
613         CursorOnFrames(MWindow *mwindow);
614         int handle_event();
615         MWindow *mwindow;
616 };
617
618 class TypelessKeyframes : public BC_MenuItem
619 {
620 public:
621         TypelessKeyframes(MWindow *mwindow);
622         int handle_event();
623         MWindow *mwindow;
624 };
625
626 class ScrubSpeed : public BC_MenuItem
627 {
628 public:
629         ScrubSpeed(MWindow *mwindow);
630         int handle_event();
631         MWindow *mwindow;
632 };
633
634 class SaveSettingsNow : public BC_MenuItem
635 {
636 public:
637         SaveSettingsNow(MWindow *mwindow);
638         int handle_event();
639         MWindow *mwindow;
640 };
641
642 // ========================================== window
643 class ShowVWindow : public BC_MenuItem
644 {
645 public:
646         ShowVWindow(MWindow *mwindow);
647         int handle_event();
648         MWindow *mwindow;
649 };
650
651 class ShowAWindow : public BC_MenuItem
652 {
653 public:
654         ShowAWindow(MWindow *mwindow);
655         int handle_event();
656         MWindow *mwindow;
657 };
658
659 class ShowGWindow : public BC_MenuItem
660 {
661 public:
662         ShowGWindow(MWindow *mwindow);
663         int handle_event();
664         MWindow *mwindow;
665 };
666
667 class ShowCWindow : public BC_MenuItem
668 {
669 public:
670         ShowCWindow(MWindow *mwindow);
671         int handle_event();
672         MWindow *mwindow;
673 };
674
675 class ShowLWindow : public BC_MenuItem
676 {
677 public:
678         ShowLWindow(MWindow *mwindow);
679         int handle_event();
680         MWindow *mwindow;
681 };
682
683 class TileWindows : public BC_MenuItem
684 {
685 public:
686         TileWindows(MWindow *mwindow, const char *item_title, int config,
687                 const char *hot_keytext="", int hot_key=0);
688         int handle_event();
689         MWindow *mwindow;
690         int config;
691 };
692
693 class SplitX : public BC_MenuItem
694 {
695 public:
696         SplitX(MWindow *mwindow);
697         int handle_event();
698         MWindow *mwindow;
699 };
700
701 class SplitY : public BC_MenuItem
702 {
703 public:
704         SplitY(MWindow *mwindow);
705         int handle_event();
706         MWindow *mwindow;
707 };
708
709 class MixerViewer : public BC_MenuItem
710 {
711 public:
712         MixerViewer(MWindow *mwindow);
713         int handle_event();
714         MWindow *mwindow;
715 };
716
717
718 class LoadLayoutItem : public BC_MenuItem
719 {
720 public:
721         LoadLayoutItem(LoadLayout *load_layout, const char *text, int no, int hotkey);
722         int handle_event();
723
724         int no;
725         LoadLayout *load_layout;
726 };
727
728 class LoadLayout : public BC_MenuItem
729 {
730 public:
731         LoadLayout(MWindow *mwindow, const char *text, int action);
732         void create_objects();
733
734         MWindow *mwindow; 
735         int action;
736 };
737
738 #endif