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