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