merge hv v6, rework trace methods
[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 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 KeyframeCurveType;
41 class KeyframeCurveTypeMenu;
42 class KeyframeCurveTypeItem;
43 class SplitX;
44 class SplitY;
45
46
47 #include "arraylist.h"
48 #include "guicast.h"
49 #include "bchash.inc"
50 #include "loadfile.inc"
51 #include "mwindow.inc"
52 #include "mwindowgui.inc"
53 #include "maxchannels.h"
54 #include "menuaeffects.inc"
55 #include "menuveffects.inc"
56 #include "module.inc"
57 #include "new.inc"
58 #include "plugindialog.inc"
59 #include "quit.inc"
60 #include "record.inc"
61 #include "render.inc"
62 #include "threadloader.inc"
63 #include "viewmenu.inc"
64
65 #define TOTAL_LOADS 10      // number of files to cache
66 #define TOTAL_EFFECTS 10     // number of effects to cache
67
68 class MainMenu : public BC_MenuBar
69 {
70 public:
71         MainMenu(MWindow *mwindow, MWindowGUI *gui, int w);
72         ~MainMenu();
73         void create_objects();
74         int load_defaults(BC_Hash *defaults);
75         int save_defaults(BC_Hash *defaults);
76
77 // most recent loads
78         int add_load(char *path);
79         void init_loads(BC_Hash *defaults);
80
81 // most recent effects
82         int init_aeffects(BC_Hash *defaults);
83         int save_aeffects(BC_Hash *defaults);
84         int add_aeffect(char *title);
85         int init_veffects(BC_Hash *defaults);
86         int save_veffects(BC_Hash *defaults);
87         int save_loads(BC_Hash *defaults);
88         int add_veffect(char *title);
89
90         int quit();
91 // show only one of these at a time
92         int set_show_autos();
93         void update_toggles(int use_lock);
94
95         MWindowGUI *gui;
96         MWindow *mwindow;
97         ThreadLoader *threadloader;
98         MenuAEffects *aeffects;
99         MenuVEffects *veffects;
100
101         Load *load_file;
102         LoadPrevious *load[TOTAL_LOADS];
103         int total_loads;
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         KeyframeCurveType *keyframe_curve_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 KeyframeCurveType : public BC_MenuItem
285 {
286 public:
287         KeyframeCurveType(MWindow *mwindow);
288         ~KeyframeCurveType();
289
290         void create_objects();
291         void update(int curve_type);
292         int handle_event();
293
294         MWindow *mwindow;
295         KeyframeCurveTypeMenu *curve_menu;
296 };
297
298 class KeyframeCurveTypeMenu : public BC_SubMenu
299 {
300 public:
301         KeyframeCurveTypeMenu(KeyframeCurveType *menu_item);
302         ~KeyframeCurveTypeMenu();
303
304         KeyframeCurveType *menu_item;
305 };
306
307 class KeyframeCurveTypeItem : public BC_MenuItem
308 {
309 public:
310         KeyframeCurveTypeItem(int type, KeyframeCurveType *main_item);
311         ~KeyframeCurveTypeItem();
312
313         KeyframeCurveType *main_item;
314         int type;
315
316         int handle_event();
317 };
318
319 class CutDefaultKeyframe : public BC_MenuItem
320 {
321 public:
322         CutDefaultKeyframe(MWindow *mwindow);
323         int handle_event();
324         MWindow *mwindow;
325 };
326
327 class CopyDefaultKeyframe : public BC_MenuItem
328 {
329 public:
330         CopyDefaultKeyframe(MWindow *mwindow);
331         int handle_event();
332         MWindow *mwindow;
333 };
334
335 class PasteDefaultKeyframe : public BC_MenuItem
336 {
337 public:
338         PasteDefaultKeyframe(MWindow *mwindow);
339         int handle_event();
340         MWindow *mwindow;
341 };
342
343 class ClearDefaultKeyframe : public BC_MenuItem
344 {
345 public:
346         ClearDefaultKeyframe(MWindow *mwindow);
347         int handle_event();
348         MWindow *mwindow;
349 };
350
351 class PasteSilence : public BC_MenuItem
352 {
353 public:
354         PasteSilence(MWindow *mwindow);
355         int handle_event();
356         MWindow *mwindow;
357 };
358
359 class SelectAll : public BC_MenuItem
360 {
361 public:
362         SelectAll(MWindow *mwindow);
363         int handle_event();
364         MWindow *mwindow;
365 };
366
367 class ClearLabels : public BC_MenuItem
368 {
369 public:
370         ClearLabels(MWindow *mwindow);
371         int handle_event();
372         MWindow *mwindow;
373 };
374
375 class CutCommercials : public BC_MenuItem
376 {
377 public:
378         CutCommercials(MWindow *mwindow);
379         int handle_event();
380         MWindow *mwindow;
381 };
382
383 class DetachTransitions : public BC_MenuItem
384 {
385 public:
386         DetachTransitions(MWindow *mwindow);
387         int handle_event();
388         MWindow *mwindow;
389 };
390
391 class MuteSelection : public BC_MenuItem
392 {
393 public:
394         MuteSelection(MWindow *mwindow);
395         int handle_event();
396         MWindow *mwindow;
397 };
398
399 class TrimSelection : public BC_MenuItem
400 {
401 public:
402         TrimSelection(MWindow *mwindow);
403         int handle_event();
404         MWindow *mwindow;
405 };
406
407 // ======================================== audio
408
409 class AddAudioTrack : public BC_MenuItem
410 {
411 public:
412         AddAudioTrack(MWindow *mwindow);
413         int handle_event();
414         MWindow *mwindow;
415 };
416
417 class DeleteAudioTrack : public BC_MenuItem
418 {
419 public:
420         DeleteAudioTrack(MWindow *mwindow);
421         int handle_event();
422         MWindow *mwindow;
423 };
424
425 class DefaultATransition : public BC_MenuItem
426 {
427 public:
428         DefaultATransition(MWindow *mwindow);
429         int handle_event();
430         MWindow *mwindow;
431 };
432
433 class MapAudio1 : public BC_MenuItem
434 {
435 public:
436         MapAudio1(MWindow *mwindow);
437         int handle_event();
438         MWindow *mwindow;
439 };
440
441 class MapAudio2 : public BC_MenuItem
442 {
443 public:
444         MapAudio2(MWindow *mwindow);
445         int handle_event();
446         MWindow *mwindow;
447 };
448
449 // ========================================== video
450
451
452 class AddVideoTrack : public BC_MenuItem
453 {
454 public:
455         AddVideoTrack(MWindow *mwindow);
456         int handle_event();
457         MWindow *mwindow;
458 };
459
460
461 class DeleteVideoTrack : public BC_MenuItem
462 {
463 public:
464         DeleteVideoTrack(MWindow *mwindow);
465         int handle_event();
466         MWindow *mwindow;
467 };
468
469 class ResetTranslation : public BC_MenuItem
470 {
471 public:
472         ResetTranslation(MWindow *mwindow);
473         int handle_event();
474         MWindow *mwindow;
475 };
476
477 class DefaultVTransition : public BC_MenuItem
478 {
479 public:
480         DefaultVTransition(MWindow *mwindow);
481         int handle_event();
482         MWindow *mwindow;
483 };
484
485
486 // ========================================== subtitle
487
488 class AddSubttlTrack : public BC_MenuItem
489 {
490 public:
491         AddSubttlTrack(MWindow *mwindow);
492         int handle_event();
493         MWindow *mwindow;
494 };
495
496 class PasteSubttl : public BC_MenuItem
497 {
498 public:
499         PasteSubttl(MWindow *mwindow);
500         int handle_event();
501         MWindow *mwindow;
502 };
503
504
505 // ========================================== settings
506
507
508 class MoveTracksUp : public BC_MenuItem
509 {
510 public:
511         MoveTracksUp(MWindow *mwindow);
512         int handle_event();
513         MWindow *mwindow;
514 };
515
516 class MoveTracksDown : public BC_MenuItem
517 {
518 public:
519         MoveTracksDown(MWindow *mwindow);
520         int handle_event();
521         MWindow *mwindow;
522 };
523
524 class DeleteTracks : public BC_MenuItem
525 {
526 public:
527         DeleteTracks(MWindow *mwindow);
528         int handle_event();
529         MWindow *mwindow;
530 };
531
532 class ConcatenateTracks : public BC_MenuItem
533 {
534 public:
535         ConcatenateTracks(MWindow *mwindow);
536         int handle_event();
537         MWindow *mwindow;
538 };
539
540 class DeleteTrack : public BC_MenuItem
541 {
542 public:
543         DeleteTrack(MWindow *mwindow);
544         int handle_event();
545         MWindow *mwindow;
546 };
547
548 class LoopPlayback : public BC_MenuItem
549 {
550 public:
551         LoopPlayback(MWindow *mwindow);
552
553         int handle_event();
554         MWindow *mwindow;
555 };
556
557 class SetBRenderRange : public BC_MenuItem
558 {
559 public:
560         SetBRenderRange(MWindow *mwindow);
561         int handle_event();
562         MWindow *mwindow;
563 };
564
565 class LabelsFollowEdits : public BC_MenuItem
566 {
567 public:
568         LabelsFollowEdits(MWindow *mwindow);
569         int handle_event();
570         MWindow *mwindow;
571 };
572
573 class PluginsFollowEdits : public BC_MenuItem
574 {
575 public:
576         PluginsFollowEdits(MWindow *mwindow);
577         int handle_event();
578         MWindow *mwindow;
579 };
580
581 class KeyframesFollowEdits : public BC_MenuItem
582 {
583 public:
584         KeyframesFollowEdits(MWindow *mwindow);
585         int handle_event();
586         MWindow *mwindow;
587 };
588
589 class CursorOnFrames : public BC_MenuItem
590 {
591 public:
592         CursorOnFrames(MWindow *mwindow);
593         int handle_event();
594         MWindow *mwindow;
595 };
596
597 class TypelessKeyframes : public BC_MenuItem
598 {
599 public:
600         TypelessKeyframes(MWindow *mwindow);
601         int handle_event();
602         MWindow *mwindow;
603 };
604
605 class ScrubSpeed : public BC_MenuItem
606 {
607 public:
608         ScrubSpeed(MWindow *mwindow);
609         int handle_event();
610         MWindow *mwindow;
611 };
612
613 class SaveSettingsNow : public BC_MenuItem
614 {
615 public:
616         SaveSettingsNow(MWindow *mwindow);
617         int handle_event();
618         MWindow *mwindow;
619 };
620
621 // ========================================== window
622 class ShowVWindow : public BC_MenuItem
623 {
624 public:
625         ShowVWindow(MWindow *mwindow);
626         int handle_event();
627         MWindow *mwindow;
628 };
629
630 class ShowAWindow : public BC_MenuItem
631 {
632 public:
633         ShowAWindow(MWindow *mwindow);
634         int handle_event();
635         MWindow *mwindow;
636 };
637
638 class ShowGWindow : public BC_MenuItem
639 {
640 public:
641         ShowGWindow(MWindow *mwindow);
642         int handle_event();
643         MWindow *mwindow;
644 };
645
646 class ShowCWindow : public BC_MenuItem
647 {
648 public:
649         ShowCWindow(MWindow *mwindow);
650         int handle_event();
651         MWindow *mwindow;
652 };
653
654 class ShowLWindow : public BC_MenuItem
655 {
656 public:
657         ShowLWindow(MWindow *mwindow);
658         int handle_event();
659         MWindow *mwindow;
660 };
661
662 class TileWindows : public BC_MenuItem
663 {
664 public:
665         TileWindows(MWindow *mwindow, const char *item_title, int config,
666                 const char *hot_keytext="", int hot_key=0);
667         int handle_event();
668         MWindow *mwindow;
669         int config;
670 };
671
672 class SplitX : public BC_MenuItem
673 {
674 public:
675         SplitX(MWindow *mwindow);
676         int handle_event();
677         MWindow *mwindow;
678 };
679
680 class SplitY : public BC_MenuItem
681 {
682 public:
683         SplitY(MWindow *mwindow);
684         int handle_event();
685         MWindow *mwindow;
686 };
687
688 #endif