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
26 class LabelsFollowEdits;
27 class PluginsFollowEdits;
28 class KeyframesFollowEdits;
30 class TypelessKeyframes;
31 class SetBRenderActive;
41 class KeyframeCurveType;
42 class KeyframeCurveTypeMenu;
43 class KeyframeCurveTypeItem;
48 #include "arraylist.h"
51 #include "loadfile.inc"
52 #include "mwindow.inc"
53 #include "mwindowgui.inc"
54 #include "maxchannels.h"
55 #include "menuaeffects.inc"
56 #include "menuveffects.inc"
59 #include "plugindialog.inc"
63 #include "threadloader.inc"
64 #include "viewmenu.inc"
66 #define TOTAL_LOADS 10 // number of files to cache
67 #define TOTAL_EFFECTS 10 // number of effects to cache
69 class MainMenu : public BC_MenuBar
72 MainMenu(MWindow *mwindow, MWindowGUI *gui, int w);
74 void create_objects();
75 int load_defaults(BC_Hash *defaults);
76 int save_defaults(BC_Hash *defaults);
79 int add_load(char *path);
80 void init_loads(BC_Hash *defaults);
82 // most recent effects
83 int init_aeffects(BC_Hash *defaults);
84 int save_aeffects(BC_Hash *defaults);
85 int add_aeffect(char *title);
86 int init_veffects(BC_Hash *defaults);
87 int save_veffects(BC_Hash *defaults);
88 int save_loads(BC_Hash *defaults);
89 int add_veffect(char *title);
92 // show only one of these at a time
94 void update_toggles(int use_lock);
98 ThreadLoader *threadloader;
99 MenuAEffects *aeffects;
100 MenuVEffects *veffects;
103 LoadPrevious *load[TOTAL_LOADS];
106 RecordMenuItem *record_menu_item;
109 MenuAEffectItem *aeffect[TOTAL_EFFECTS];
110 MenuVEffectItem *veffect[TOTAL_EFFECTS];
111 Quit *quit_program; // affected by save
116 BC_Menu *filemenu, *audiomenu, *videomenu; // needed by most recents
118 KeyframeCurveType *keyframe_curve_type;
119 LabelsFollowEdits *labels_follow_edits;
120 PluginsFollowEdits *plugins_follow_edits;
121 KeyframesFollowEdits *keyframes_follow_edits;
122 CursorOnFrames *cursor_on_frames;
123 TypelessKeyframes *typeless_keyframes;
124 SetBRenderActive *brender_active;
125 LoopPlayback *loop_playback;
126 ShowAssets *show_assets;
127 ShowTitles *show_titles;
128 ShowTransitions *show_transitions;
129 ShowAutomation *fade_automation;
130 ShowAutomation *mute_automation;
131 ShowAutomation *pan_automation;
132 ShowAutomation *camera_x;
133 ShowAutomation *camera_y;
134 ShowAutomation *camera_z;
135 ShowAutomation *project_x;
136 ShowAutomation *project_y;
137 ShowAutomation *project_z;
138 PluginAutomation *plugin_automation;
139 ShowAutomation *mask_automation;
140 ShowAutomation *mode_automation;
141 ShowAutomation *speed_automation;
142 ShowVWindow *show_vwindow;
143 ShowAWindow *show_awindow;
144 ShowCWindow *show_cwindow;
145 ShowGWindow *show_gwindow;
146 ShowLWindow *show_lwindow;
151 // ========================================= edit
153 class Undo : public BC_MenuItem
156 Undo(MWindow *mwindow);
158 int update_caption(const char *new_caption = "");
164 class DumpCICache : public BC_MenuItem
167 DumpCICache(MWindow *mwindow);
172 class DumpEDL : public BC_MenuItem
175 DumpEDL(MWindow *mwindow);
180 class DumpPlugins : public BC_MenuItem
183 DumpPlugins(MWindow *mwindow);
188 class DumpAssets : public BC_MenuItem
191 DumpAssets(MWindow *mwindow);
196 class Redo : public BC_MenuItem
199 Redo(MWindow *mwindow);
201 int update_caption(const char *new_caption = "");
205 class Cut : public BC_MenuItem
208 Cut(MWindow *mwindow);
213 class Copy : public BC_MenuItem
216 Copy(MWindow *mwindow);
221 class Paste : public BC_MenuItem
224 Paste(MWindow *mwindow);
229 class Clear : public BC_MenuItem
232 Clear(MWindow *mwindow);
237 class CutKeyframes : public BC_MenuItem
240 CutKeyframes(MWindow *mwindow);
245 class CopyKeyframes : public BC_MenuItem
248 CopyKeyframes(MWindow *mwindow);
253 class PasteKeyframes : public BC_MenuItem
256 PasteKeyframes(MWindow *mwindow);
262 class ClearKeyframes : public BC_MenuItem
265 ClearKeyframes(MWindow *mwindow);
270 class StraightenKeyframes : public BC_MenuItem
273 StraightenKeyframes(MWindow *mwindow);
278 class BendKeyframes : public BC_MenuItem
281 BendKeyframes(MWindow *mwindow);
286 class KeyframeCurveType : public BC_MenuItem
289 KeyframeCurveType(MWindow *mwindow);
290 ~KeyframeCurveType();
292 void create_objects();
293 void update(int curve_type);
297 KeyframeCurveTypeMenu *curve_menu;
300 class KeyframeCurveTypeMenu : public BC_SubMenu
303 KeyframeCurveTypeMenu(KeyframeCurveType *menu_item);
304 ~KeyframeCurveTypeMenu();
306 KeyframeCurveType *menu_item;
309 class KeyframeCurveTypeItem : public BC_MenuItem
312 KeyframeCurveTypeItem(int type, KeyframeCurveType *main_item);
313 ~KeyframeCurveTypeItem();
315 KeyframeCurveType *main_item;
321 class CutDefaultKeyframe : public BC_MenuItem
324 CutDefaultKeyframe(MWindow *mwindow);
329 class CopyDefaultKeyframe : public BC_MenuItem
332 CopyDefaultKeyframe(MWindow *mwindow);
337 class PasteDefaultKeyframe : public BC_MenuItem
340 PasteDefaultKeyframe(MWindow *mwindow);
345 class ClearDefaultKeyframe : public BC_MenuItem
348 ClearDefaultKeyframe(MWindow *mwindow);
353 class PasteSilence : public BC_MenuItem
356 PasteSilence(MWindow *mwindow);
361 class SelectAll : public BC_MenuItem
364 SelectAll(MWindow *mwindow);
369 class ClearLabels : public BC_MenuItem
372 ClearLabels(MWindow *mwindow);
377 class CutCommercials : public BC_MenuItem
380 CutCommercials(MWindow *mwindow);
385 class DetachTransitions : public BC_MenuItem
388 DetachTransitions(MWindow *mwindow);
393 class MuteSelection : public BC_MenuItem
396 MuteSelection(MWindow *mwindow);
401 class TrimSelection : public BC_MenuItem
404 TrimSelection(MWindow *mwindow);
409 // ======================================== audio
411 class AddAudioTrack : public BC_MenuItem
414 AddAudioTrack(MWindow *mwindow);
419 class DeleteAudioTrack : public BC_MenuItem
422 DeleteAudioTrack(MWindow *mwindow);
427 class DefaultATransition : public BC_MenuItem
430 DefaultATransition(MWindow *mwindow);
435 class MapAudio1 : public BC_MenuItem
438 MapAudio1(MWindow *mwindow);
443 class MapAudio2 : public BC_MenuItem
446 MapAudio2(MWindow *mwindow);
451 // ========================================== video
454 class AddVideoTrack : public BC_MenuItem
457 AddVideoTrack(MWindow *mwindow);
463 class DeleteVideoTrack : public BC_MenuItem
466 DeleteVideoTrack(MWindow *mwindow);
471 class ResetTranslation : public BC_MenuItem
474 ResetTranslation(MWindow *mwindow);
479 class DefaultVTransition : public BC_MenuItem
482 DefaultVTransition(MWindow *mwindow);
488 // ========================================== subtitle
490 class AddSubttlTrack : public BC_MenuItem
493 AddSubttlTrack(MWindow *mwindow);
498 class PasteSubttl : public BC_MenuItem
501 PasteSubttl(MWindow *mwindow);
507 // ========================================== settings
510 class MoveTracksUp : public BC_MenuItem
513 MoveTracksUp(MWindow *mwindow);
518 class MoveTracksDown : public BC_MenuItem
521 MoveTracksDown(MWindow *mwindow);
526 class DeleteTracks : public BC_MenuItem
529 DeleteTracks(MWindow *mwindow);
534 class ConcatenateTracks : public BC_MenuItem
537 ConcatenateTracks(MWindow *mwindow);
542 class DeleteTrack : public BC_MenuItem
545 DeleteTrack(MWindow *mwindow);
550 class LoopPlayback : public BC_MenuItem
553 LoopPlayback(MWindow *mwindow);
559 class SetBRenderActive : public BC_MenuItem
562 SetBRenderActive(MWindow *mwindow);
567 class LabelsFollowEdits : public BC_MenuItem
570 LabelsFollowEdits(MWindow *mwindow);
575 class PluginsFollowEdits : public BC_MenuItem
578 PluginsFollowEdits(MWindow *mwindow);
583 class KeyframesFollowEdits : public BC_MenuItem
586 KeyframesFollowEdits(MWindow *mwindow);
591 class CursorOnFrames : public BC_MenuItem
594 CursorOnFrames(MWindow *mwindow);
599 class TypelessKeyframes : public BC_MenuItem
602 TypelessKeyframes(MWindow *mwindow);
607 class ScrubSpeed : public BC_MenuItem
610 ScrubSpeed(MWindow *mwindow);
615 class SaveSettingsNow : public BC_MenuItem
618 SaveSettingsNow(MWindow *mwindow);
623 // ========================================== window
624 class ShowVWindow : public BC_MenuItem
627 ShowVWindow(MWindow *mwindow);
632 class ShowAWindow : public BC_MenuItem
635 ShowAWindow(MWindow *mwindow);
640 class ShowGWindow : public BC_MenuItem
643 ShowGWindow(MWindow *mwindow);
648 class ShowCWindow : public BC_MenuItem
651 ShowCWindow(MWindow *mwindow);
656 class ShowLWindow : public BC_MenuItem
659 ShowLWindow(MWindow *mwindow);
664 class TileWindows : public BC_MenuItem
667 TileWindows(MWindow *mwindow, const char *item_title, int config,
668 const char *hot_keytext="", int hot_key=0);
674 class SplitX : public BC_MenuItem
677 SplitX(MWindow *mwindow);
682 class SplitY : public BC_MenuItem
685 SplitY(MWindow *mwindow);