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