rework keyframe hide popup, keyframe auto render, textbox set_selection wide text
[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, int curve_type);
288         ~KeyframeCurveType();
289
290         void create_objects();
291         int handle_event();
292
293         MWindow *mwindow;
294         KeyframeCurveTypeMenu *curve_menu;
295         int curve_type;
296 };
297
298 class KeyframeCurveTypeMenu : public BC_PopupMenu
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);
311         ~KeyframeCurveTypeItem();
312
313         int handle_event();
314         int type;
315 };
316
317 class CutDefaultKeyframe : public BC_MenuItem
318 {
319 public:
320         CutDefaultKeyframe(MWindow *mwindow);
321         int handle_event();
322         MWindow *mwindow;
323 };
324
325 class CopyDefaultKeyframe : public BC_MenuItem
326 {
327 public:
328         CopyDefaultKeyframe(MWindow *mwindow);
329         int handle_event();
330         MWindow *mwindow;
331 };
332
333 class PasteDefaultKeyframe : public BC_MenuItem
334 {
335 public:
336         PasteDefaultKeyframe(MWindow *mwindow);
337         int handle_event();
338         MWindow *mwindow;
339 };
340
341 class ClearDefaultKeyframe : public BC_MenuItem
342 {
343 public:
344         ClearDefaultKeyframe(MWindow *mwindow);
345         int handle_event();
346         MWindow *mwindow;
347 };
348
349 class PasteSilence : public BC_MenuItem
350 {
351 public:
352         PasteSilence(MWindow *mwindow);
353         int handle_event();
354         MWindow *mwindow;
355 };
356
357 class SelectAll : public BC_MenuItem
358 {
359 public:
360         SelectAll(MWindow *mwindow);
361         int handle_event();
362         MWindow *mwindow;
363 };
364
365 class ClearLabels : public BC_MenuItem
366 {
367 public:
368         ClearLabels(MWindow *mwindow);
369         int handle_event();
370         MWindow *mwindow;
371 };
372
373 class CutCommercials : public BC_MenuItem
374 {
375 public:
376         CutCommercials(MWindow *mwindow);
377         int handle_event();
378         MWindow *mwindow;
379 };
380
381 class DetachTransitions : public BC_MenuItem
382 {
383 public:
384         DetachTransitions(MWindow *mwindow);
385         int handle_event();
386         MWindow *mwindow;
387 };
388
389 class MuteSelection : public BC_MenuItem
390 {
391 public:
392         MuteSelection(MWindow *mwindow);
393         int handle_event();
394         MWindow *mwindow;
395 };
396
397 class TrimSelection : public BC_MenuItem
398 {
399 public:
400         TrimSelection(MWindow *mwindow);
401         int handle_event();
402         MWindow *mwindow;
403 };
404
405 // ======================================== audio
406
407 class AddAudioTrack : public BC_MenuItem
408 {
409 public:
410         AddAudioTrack(MWindow *mwindow);
411         int handle_event();
412         MWindow *mwindow;
413 };
414
415 class DeleteAudioTrack : public BC_MenuItem
416 {
417 public:
418         DeleteAudioTrack(MWindow *mwindow);
419         int handle_event();
420         MWindow *mwindow;
421 };
422
423 class DefaultATransition : public BC_MenuItem
424 {
425 public:
426         DefaultATransition(MWindow *mwindow);
427         int handle_event();
428         MWindow *mwindow;
429 };
430
431 class MapAudio1 : public BC_MenuItem
432 {
433 public:
434         MapAudio1(MWindow *mwindow);
435         int handle_event();
436         MWindow *mwindow;
437 };
438
439 class MapAudio2 : public BC_MenuItem
440 {
441 public:
442         MapAudio2(MWindow *mwindow);
443         int handle_event();
444         MWindow *mwindow;
445 };
446
447 // ========================================== video
448
449
450 class AddVideoTrack : public BC_MenuItem
451 {
452 public:
453         AddVideoTrack(MWindow *mwindow);
454         int handle_event();
455         MWindow *mwindow;
456 };
457
458
459 class DeleteVideoTrack : public BC_MenuItem
460 {
461 public:
462         DeleteVideoTrack(MWindow *mwindow);
463         int handle_event();
464         MWindow *mwindow;
465 };
466
467 class ResetTranslation : public BC_MenuItem
468 {
469 public:
470         ResetTranslation(MWindow *mwindow);
471         int handle_event();
472         MWindow *mwindow;
473 };
474
475 class DefaultVTransition : public BC_MenuItem
476 {
477 public:
478         DefaultVTransition(MWindow *mwindow);
479         int handle_event();
480         MWindow *mwindow;
481 };
482
483
484 // ========================================== subtitle
485
486 class AddSubttlTrack : public BC_MenuItem
487 {
488 public:
489         AddSubttlTrack(MWindow *mwindow);
490         int handle_event();
491         MWindow *mwindow;
492 };
493
494 class PasteSubttl : public BC_MenuItem
495 {
496 public:
497         PasteSubttl(MWindow *mwindow);
498         int handle_event();
499         MWindow *mwindow;
500 };
501
502
503 // ========================================== settings
504
505
506 class MoveTracksUp : public BC_MenuItem
507 {
508 public:
509         MoveTracksUp(MWindow *mwindow);
510         int handle_event();
511         MWindow *mwindow;
512 };
513
514 class MoveTracksDown : public BC_MenuItem
515 {
516 public:
517         MoveTracksDown(MWindow *mwindow);
518         int handle_event();
519         MWindow *mwindow;
520 };
521
522 class DeleteTracks : public BC_MenuItem
523 {
524 public:
525         DeleteTracks(MWindow *mwindow);
526         int handle_event();
527         MWindow *mwindow;
528 };
529
530 class ConcatenateTracks : public BC_MenuItem
531 {
532 public:
533         ConcatenateTracks(MWindow *mwindow);
534         int handle_event();
535         MWindow *mwindow;
536 };
537
538 class DeleteTrack : public BC_MenuItem
539 {
540 public:
541         DeleteTrack(MWindow *mwindow);
542         int handle_event();
543         MWindow *mwindow;
544 };
545
546 class LoopPlayback : public BC_MenuItem
547 {
548 public:
549         LoopPlayback(MWindow *mwindow);
550
551         int handle_event();
552         MWindow *mwindow;
553 };
554
555 class SetBRenderStart : public BC_MenuItem
556 {
557 public:
558         SetBRenderStart(MWindow *mwindow);
559         int handle_event();
560         MWindow *mwindow;
561 };
562
563 class LabelsFollowEdits : public BC_MenuItem
564 {
565 public:
566         LabelsFollowEdits(MWindow *mwindow);
567         int handle_event();
568         MWindow *mwindow;
569 };
570
571 class PluginsFollowEdits : public BC_MenuItem
572 {
573 public:
574         PluginsFollowEdits(MWindow *mwindow);
575         int handle_event();
576         MWindow *mwindow;
577 };
578
579 class KeyframesFollowEdits : public BC_MenuItem
580 {
581 public:
582         KeyframesFollowEdits(MWindow *mwindow);
583         int handle_event();
584         MWindow *mwindow;
585 };
586
587 class CursorOnFrames : public BC_MenuItem
588 {
589 public:
590         CursorOnFrames(MWindow *mwindow);
591         int handle_event();
592         MWindow *mwindow;
593 };
594
595 class TypelessKeyframes : public BC_MenuItem
596 {
597 public:
598         TypelessKeyframes(MWindow *mwindow);
599         int handle_event();
600         MWindow *mwindow;
601 };
602
603 class ScrubSpeed : public BC_MenuItem
604 {
605 public:
606         ScrubSpeed(MWindow *mwindow);
607         int handle_event();
608         MWindow *mwindow;
609 };
610
611 class SaveSettingsNow : public BC_MenuItem
612 {
613 public:
614         SaveSettingsNow(MWindow *mwindow);
615         int handle_event();
616         MWindow *mwindow;
617 };
618
619 // ========================================== window
620 class ShowVWindow : public BC_MenuItem
621 {
622 public:
623         ShowVWindow(MWindow *mwindow);
624         int handle_event();
625         MWindow *mwindow;
626 };
627
628 class ShowAWindow : public BC_MenuItem
629 {
630 public:
631         ShowAWindow(MWindow *mwindow);
632         int handle_event();
633         MWindow *mwindow;
634 };
635
636 class ShowGWindow : public BC_MenuItem
637 {
638 public:
639         ShowGWindow(MWindow *mwindow);
640         int handle_event();
641         MWindow *mwindow;
642 };
643
644 class ShowCWindow : public BC_MenuItem
645 {
646 public:
647         ShowCWindow(MWindow *mwindow);
648         int handle_event();
649         MWindow *mwindow;
650 };
651
652 class ShowLWindow : public BC_MenuItem
653 {
654 public:
655         ShowLWindow(MWindow *mwindow);
656         int handle_event();
657         MWindow *mwindow;
658 };
659
660 class TileWindows : public BC_MenuItem
661 {
662 public:
663         TileWindows(MWindow *mwindow, const char *item_title, int config,
664                 const char *hot_keytext="", int hot_key=0);
665         int handle_event();
666         MWindow *mwindow;
667         int config;
668 };
669
670 class SplitX : public BC_MenuItem
671 {
672 public:
673         SplitX(MWindow *mwindow);
674         int handle_event();
675         MWindow *mwindow;
676 };
677
678 class SplitY : public BC_MenuItem
679 {
680 public:
681         SplitY(MWindow *mwindow);
682         int handle_event();
683         MWindow *mwindow;
684 };
685
686 #endif