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