4 * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
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.
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.
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
25 #include "arraylist.h"
28 #include "loadfile.inc"
29 #include "mainmenu.inc"
30 #include "mwindow.inc"
31 #include "mwindowgui.inc"
32 #include "maxchannels.h"
33 #include "menuaeffects.inc"
34 #include "menuveffects.inc"
37 #include "plugindialog.inc"
41 #include "threadloader.inc"
42 #include "viewmenu.inc"
44 #define TOTAL_LOADS 10 // number of files to cache
45 #define TOTAL_EFFECTS 10 // number of effects to cache
50 class MainMenu : public BC_MenuBar
53 MainMenu(MWindow *mwindow, MWindowGUI *gui, int w);
55 void create_objects();
56 int load_defaults(BC_Hash *defaults);
57 int save_defaults(BC_Hash *defaults);
60 int add_load(char *path);
61 void init_loads(BC_Hash *defaults);
63 // most recent effects
64 int init_aeffects(BC_Hash *defaults);
65 int save_aeffects(BC_Hash *defaults);
66 int add_aeffect(char *title);
67 int init_veffects(BC_Hash *defaults);
68 int save_veffects(BC_Hash *defaults);
69 int save_loads(BC_Hash *defaults);
70 int add_veffect(char *title);
73 // show only one of these at a time
75 void update_toggles(int use_lock);
79 ThreadLoader *threadloader;
80 MenuAEffects *aeffects;
81 MenuVEffects *veffects;
84 LoadPrevious *load[TOTAL_LOADS];
87 RecordMenuItem *record_menu_item;
89 NewProject *new_project;
90 MenuAEffectItem *aeffect[TOTAL_EFFECTS];
91 MenuVEffectItem *veffect[TOTAL_EFFECTS];
92 Quit *quit_program; // affected by save
93 MainDumpsMenu *dump_menu;
98 BC_Menu *filemenu, *audiomenu, *videomenu; // needed by most recents
100 KeyframeCurveType *keyframe_curve_type;
101 LabelsFollowEdits *labels_follow_edits;
102 PluginsFollowEdits *plugins_follow_edits;
103 KeyframesFollowEdits *keyframes_follow_edits;
104 CursorOnFrames *cursor_on_frames;
105 TypelessKeyframes *typeless_keyframes;
106 SetBRenderActive *brender_active;
107 LoopPlayback *loop_playback;
108 ShowAssets *show_assets;
109 ShowTitles *show_titles;
110 ShowTransitions *show_transitions;
111 ShowAutomation *fade_automation;
112 ShowAutomation *mute_automation;
113 ShowAutomation *pan_automation;
114 ShowAutomation *camera_x;
115 ShowAutomation *camera_y;
116 ShowAutomation *camera_z;
117 ShowAutomation *project_x;
118 ShowAutomation *project_y;
119 ShowAutomation *project_z;
120 PluginAutomation *plugin_automation;
121 ShowAutomation *mask_automation;
122 ShowAutomation *mode_automation;
123 ShowAutomation *speed_automation;
124 ShowVWindow *show_vwindow;
125 ShowAWindow *show_awindow;
126 ShowCWindow *show_cwindow;
127 ShowGWindow *show_gwindow;
128 ShowLWindow *show_lwindow;
131 MixerViewer *mixer_viewer;
132 LoadLayout *load_layout;
133 LoadLayout *save_layout;
136 // ========================================= edit
138 class Undo : public BC_MenuItem
141 Undo(MWindow *mwindow);
143 int update_caption(const char *new_caption = "");
147 class MainDumpsSubMenu : public BC_SubMenu
150 MainDumpsSubMenu(BC_MenuItem *menu_item);
153 BC_MenuItem *menu_item;
156 class MainDumpsMenu : public BC_MenuItem
159 MainDumpsMenu(MWindow *mwindow);
161 void create_objects();
164 MainDumpsSubMenu *dumps_menu;
167 class DumpCICache : public BC_MenuItem
170 DumpCICache(MWindow *mwindow);
175 class DumpEDL : public BC_MenuItem
178 DumpEDL(MWindow *mwindow);
183 class DumpPlugins : public BC_MenuItem
186 DumpPlugins(MWindow *mwindow);
191 class DumpAssets : public BC_MenuItem
194 DumpAssets(MWindow *mwindow);
199 class DumpUndo : public BC_MenuItem
202 DumpUndo(MWindow *mwindow);
207 class Redo : public BC_MenuItem
210 Redo(MWindow *mwindow);
212 int update_caption(const char *new_caption = "");
216 class Cut : public BC_MenuItem
219 Cut(MWindow *mwindow);
224 class Copy : public BC_MenuItem
227 Copy(MWindow *mwindow);
232 class Paste : public BC_MenuItem
235 Paste(MWindow *mwindow);
240 class Clear : public BC_MenuItem
243 Clear(MWindow *mwindow);
248 class CutKeyframes : public BC_MenuItem
251 CutKeyframes(MWindow *mwindow);
256 class CopyKeyframes : public BC_MenuItem
259 CopyKeyframes(MWindow *mwindow);
264 class PasteKeyframes : public BC_MenuItem
267 PasteKeyframes(MWindow *mwindow);
273 class ClearKeyframes : public BC_MenuItem
276 ClearKeyframes(MWindow *mwindow);
281 class StraightenKeyframes : public BC_MenuItem
284 StraightenKeyframes(MWindow *mwindow);
289 class BendKeyframes : public BC_MenuItem
292 BendKeyframes(MWindow *mwindow);
297 class KeyframeCurveType : public BC_MenuItem
300 KeyframeCurveType(MWindow *mwindow);
301 ~KeyframeCurveType();
303 void create_objects();
304 void update(int curve_type);
308 KeyframeCurveTypeMenu *curve_menu;
311 class KeyframeCurveTypeMenu : public BC_SubMenu
314 KeyframeCurveTypeMenu(KeyframeCurveType *menu_item);
315 ~KeyframeCurveTypeMenu();
317 KeyframeCurveType *menu_item;
320 class KeyframeCurveTypeItem : public BC_MenuItem
323 KeyframeCurveTypeItem(int type, KeyframeCurveType *main_item);
324 ~KeyframeCurveTypeItem();
326 KeyframeCurveType *main_item;
332 class CutDefaultKeyframe : public BC_MenuItem
335 CutDefaultKeyframe(MWindow *mwindow);
340 class CopyDefaultKeyframe : public BC_MenuItem
343 CopyDefaultKeyframe(MWindow *mwindow);
348 class PasteDefaultKeyframe : public BC_MenuItem
351 PasteDefaultKeyframe(MWindow *mwindow);
356 class ClearDefaultKeyframe : public BC_MenuItem
359 ClearDefaultKeyframe(MWindow *mwindow);
364 class PasteSilence : public BC_MenuItem
367 PasteSilence(MWindow *mwindow);
372 class SelectAll : public BC_MenuItem
375 SelectAll(MWindow *mwindow);
380 class ClearLabels : public BC_MenuItem
383 ClearLabels(MWindow *mwindow);
388 class CutCommercials : public BC_MenuItem
391 CutCommercials(MWindow *mwindow);
396 class DetachTransitions : public BC_MenuItem
399 DetachTransitions(MWindow *mwindow);
404 class MuteSelection : public BC_MenuItem
407 MuteSelection(MWindow *mwindow);
412 class TrimSelection : public BC_MenuItem
415 TrimSelection(MWindow *mwindow);
420 class TileMixers : public BC_MenuItem
423 TileMixers(MWindow *mwindow);
428 // ======================================== audio
430 class AddAudioTrack : public BC_MenuItem
433 AddAudioTrack(MWindow *mwindow);
438 class DeleteAudioTrack : public BC_MenuItem
441 DeleteAudioTrack(MWindow *mwindow);
446 class DefaultATransition : public BC_MenuItem
449 DefaultATransition(MWindow *mwindow);
454 class MapAudio1 : public BC_MenuItem
457 MapAudio1(MWindow *mwindow);
462 class MapAudio2 : public BC_MenuItem
465 MapAudio2(MWindow *mwindow);
470 // ========================================== video
473 class AddVideoTrack : public BC_MenuItem
476 AddVideoTrack(MWindow *mwindow);
482 class DeleteVideoTrack : public BC_MenuItem
485 DeleteVideoTrack(MWindow *mwindow);
490 class ResetTranslation : public BC_MenuItem
493 ResetTranslation(MWindow *mwindow);
498 class DefaultVTransition : public BC_MenuItem
501 DefaultVTransition(MWindow *mwindow);
507 // ========================================== subtitle
509 class AddSubttlTrack : public BC_MenuItem
512 AddSubttlTrack(MWindow *mwindow);
517 class PasteSubttl : public BC_MenuItem
520 PasteSubttl(MWindow *mwindow);
526 // ========================================== settings
529 class MoveTracksUp : public BC_MenuItem
532 MoveTracksUp(MWindow *mwindow);
537 class MoveTracksDown : public BC_MenuItem
540 MoveTracksDown(MWindow *mwindow);
545 class DeleteTracks : public BC_MenuItem
548 DeleteTracks(MWindow *mwindow);
553 class ConcatenateTracks : public BC_MenuItem
556 ConcatenateTracks(MWindow *mwindow);
561 class DeleteTrack : public BC_MenuItem
564 DeleteTrack(MWindow *mwindow);
569 class LoopPlayback : public BC_MenuItem
572 LoopPlayback(MWindow *mwindow);
578 class SetBRenderActive : public BC_MenuItem
581 SetBRenderActive(MWindow *mwindow);
586 class LabelsFollowEdits : public BC_MenuItem
589 LabelsFollowEdits(MWindow *mwindow);
594 class PluginsFollowEdits : public BC_MenuItem
597 PluginsFollowEdits(MWindow *mwindow);
602 class KeyframesFollowEdits : public BC_MenuItem
605 KeyframesFollowEdits(MWindow *mwindow);
610 class CursorOnFrames : public BC_MenuItem
613 CursorOnFrames(MWindow *mwindow);
618 class TypelessKeyframes : public BC_MenuItem
621 TypelessKeyframes(MWindow *mwindow);
626 class ScrubSpeed : public BC_MenuItem
629 ScrubSpeed(MWindow *mwindow);
634 class SaveSettingsNow : public BC_MenuItem
637 SaveSettingsNow(MWindow *mwindow);
642 // ========================================== window
643 class ShowVWindow : public BC_MenuItem
646 ShowVWindow(MWindow *mwindow);
651 class ShowAWindow : public BC_MenuItem
654 ShowAWindow(MWindow *mwindow);
659 class ShowGWindow : public BC_MenuItem
662 ShowGWindow(MWindow *mwindow);
667 class ShowCWindow : public BC_MenuItem
670 ShowCWindow(MWindow *mwindow);
675 class ShowLWindow : public BC_MenuItem
678 ShowLWindow(MWindow *mwindow);
683 class TileWindows : public BC_MenuItem
686 TileWindows(MWindow *mwindow, const char *item_title, int config,
687 const char *hot_keytext="", int hot_key=0);
693 class SplitX : public BC_MenuItem
696 SplitX(MWindow *mwindow);
701 class SplitY : public BC_MenuItem
704 SplitY(MWindow *mwindow);
709 class MixerViewer : public BC_MenuItem
712 MixerViewer(MWindow *mwindow);
718 class LoadLayoutItem : public BC_MenuItem
721 LoadLayoutItem(LoadLayout *load_layout, const char *text, int no, int hotkey);
725 LoadLayout *load_layout;
728 class LoadLayout : public BC_MenuItem
731 LoadLayout(MWindow *mwindow, const char *text, int action);
732 void create_objects();