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;
49 #include "arraylist.h"
52 #include "loadfile.inc"
53 #include "mwindow.inc"
54 #include "mwindowgui.inc"
55 #include "maxchannels.h"
56 #include "menuaeffects.inc"
57 #include "menuveffects.inc"
60 #include "plugindialog.inc"
64 #include "threadloader.inc"
65 #include "viewmenu.inc"
67 #define TOTAL_LOADS 10 // number of files to cache
68 #define TOTAL_EFFECTS 10 // number of effects to cache
70 class MainMenu : public BC_MenuBar
73 MainMenu(MWindow *mwindow, MWindowGUI *gui, int w);
75 void create_objects();
76 int load_defaults(BC_Hash *defaults);
77 int save_defaults(BC_Hash *defaults);
80 int add_load(char *path);
81 void init_loads(BC_Hash *defaults);
83 // most recent effects
84 int init_aeffects(BC_Hash *defaults);
85 int save_aeffects(BC_Hash *defaults);
86 int add_aeffect(char *title);
87 int init_veffects(BC_Hash *defaults);
88 int save_veffects(BC_Hash *defaults);
89 int save_loads(BC_Hash *defaults);
90 int add_veffect(char *title);
93 // show only one of these at a time
95 void update_toggles(int use_lock);
99 ThreadLoader *threadloader;
100 MenuAEffects *aeffects;
101 MenuVEffects *veffects;
104 LoadPrevious *load[TOTAL_LOADS];
107 RecordMenuItem *record_menu_item;
109 NewProject *new_project;
110 MenuAEffectItem *aeffect[TOTAL_EFFECTS];
111 MenuVEffectItem *veffect[TOTAL_EFFECTS];
112 Quit *quit_program; // affected by save
117 BC_Menu *filemenu, *audiomenu, *videomenu; // needed by most recents
119 KeyframeCurveType *keyframe_curve_type;
120 LabelsFollowEdits *labels_follow_edits;
121 PluginsFollowEdits *plugins_follow_edits;
122 KeyframesFollowEdits *keyframes_follow_edits;
123 CursorOnFrames *cursor_on_frames;
124 TypelessKeyframes *typeless_keyframes;
125 SetBRenderActive *brender_active;
126 LoopPlayback *loop_playback;
127 ShowAssets *show_assets;
128 ShowTitles *show_titles;
129 ShowTransitions *show_transitions;
130 ShowAutomation *fade_automation;
131 ShowAutomation *mute_automation;
132 ShowAutomation *pan_automation;
133 ShowAutomation *camera_x;
134 ShowAutomation *camera_y;
135 ShowAutomation *camera_z;
136 ShowAutomation *project_x;
137 ShowAutomation *project_y;
138 ShowAutomation *project_z;
139 PluginAutomation *plugin_automation;
140 ShowAutomation *mask_automation;
141 ShowAutomation *mode_automation;
142 ShowAutomation *speed_automation;
143 ShowVWindow *show_vwindow;
144 ShowAWindow *show_awindow;
145 ShowCWindow *show_cwindow;
146 ShowGWindow *show_gwindow;
147 ShowLWindow *show_lwindow;
150 MixerViewer *mixer_viewer;
153 // ========================================= edit
155 class Undo : public BC_MenuItem
158 Undo(MWindow *mwindow);
160 int update_caption(const char *new_caption = "");
166 class DumpCICache : public BC_MenuItem
169 DumpCICache(MWindow *mwindow);
174 class DumpEDL : public BC_MenuItem
177 DumpEDL(MWindow *mwindow);
182 class DumpPlugins : public BC_MenuItem
185 DumpPlugins(MWindow *mwindow);
190 class DumpAssets : public BC_MenuItem
193 DumpAssets(MWindow *mwindow);
198 class Redo : public BC_MenuItem
201 Redo(MWindow *mwindow);
203 int update_caption(const char *new_caption = "");
207 class Cut : public BC_MenuItem
210 Cut(MWindow *mwindow);
215 class Copy : public BC_MenuItem
218 Copy(MWindow *mwindow);
223 class Paste : public BC_MenuItem
226 Paste(MWindow *mwindow);
231 class Clear : public BC_MenuItem
234 Clear(MWindow *mwindow);
239 class CutKeyframes : public BC_MenuItem
242 CutKeyframes(MWindow *mwindow);
247 class CopyKeyframes : public BC_MenuItem
250 CopyKeyframes(MWindow *mwindow);
255 class PasteKeyframes : public BC_MenuItem
258 PasteKeyframes(MWindow *mwindow);
264 class ClearKeyframes : public BC_MenuItem
267 ClearKeyframes(MWindow *mwindow);
272 class StraightenKeyframes : public BC_MenuItem
275 StraightenKeyframes(MWindow *mwindow);
280 class BendKeyframes : public BC_MenuItem
283 BendKeyframes(MWindow *mwindow);
288 class KeyframeCurveType : public BC_MenuItem
291 KeyframeCurveType(MWindow *mwindow);
292 ~KeyframeCurveType();
294 void create_objects();
295 void update(int curve_type);
299 KeyframeCurveTypeMenu *curve_menu;
302 class KeyframeCurveTypeMenu : public BC_SubMenu
305 KeyframeCurveTypeMenu(KeyframeCurveType *menu_item);
306 ~KeyframeCurveTypeMenu();
308 KeyframeCurveType *menu_item;
311 class KeyframeCurveTypeItem : public BC_MenuItem
314 KeyframeCurveTypeItem(int type, KeyframeCurveType *main_item);
315 ~KeyframeCurveTypeItem();
317 KeyframeCurveType *main_item;
323 class CutDefaultKeyframe : public BC_MenuItem
326 CutDefaultKeyframe(MWindow *mwindow);
331 class CopyDefaultKeyframe : public BC_MenuItem
334 CopyDefaultKeyframe(MWindow *mwindow);
339 class PasteDefaultKeyframe : public BC_MenuItem
342 PasteDefaultKeyframe(MWindow *mwindow);
347 class ClearDefaultKeyframe : public BC_MenuItem
350 ClearDefaultKeyframe(MWindow *mwindow);
355 class PasteSilence : public BC_MenuItem
358 PasteSilence(MWindow *mwindow);
363 class SelectAll : public BC_MenuItem
366 SelectAll(MWindow *mwindow);
371 class ClearLabels : public BC_MenuItem
374 ClearLabels(MWindow *mwindow);
379 class CutCommercials : public BC_MenuItem
382 CutCommercials(MWindow *mwindow);
387 class DetachTransitions : public BC_MenuItem
390 DetachTransitions(MWindow *mwindow);
395 class MuteSelection : public BC_MenuItem
398 MuteSelection(MWindow *mwindow);
403 class TrimSelection : public BC_MenuItem
406 TrimSelection(MWindow *mwindow);
411 class TileMixers : public BC_MenuItem
414 TileMixers(MWindow *mwindow);
419 // ======================================== audio
421 class AddAudioTrack : public BC_MenuItem
424 AddAudioTrack(MWindow *mwindow);
429 class DeleteAudioTrack : public BC_MenuItem
432 DeleteAudioTrack(MWindow *mwindow);
437 class DefaultATransition : public BC_MenuItem
440 DefaultATransition(MWindow *mwindow);
445 class MapAudio1 : public BC_MenuItem
448 MapAudio1(MWindow *mwindow);
453 class MapAudio2 : public BC_MenuItem
456 MapAudio2(MWindow *mwindow);
461 // ========================================== video
464 class AddVideoTrack : public BC_MenuItem
467 AddVideoTrack(MWindow *mwindow);
473 class DeleteVideoTrack : public BC_MenuItem
476 DeleteVideoTrack(MWindow *mwindow);
481 class ResetTranslation : public BC_MenuItem
484 ResetTranslation(MWindow *mwindow);
489 class DefaultVTransition : public BC_MenuItem
492 DefaultVTransition(MWindow *mwindow);
498 // ========================================== subtitle
500 class AddSubttlTrack : public BC_MenuItem
503 AddSubttlTrack(MWindow *mwindow);
508 class PasteSubttl : public BC_MenuItem
511 PasteSubttl(MWindow *mwindow);
517 // ========================================== settings
520 class MoveTracksUp : public BC_MenuItem
523 MoveTracksUp(MWindow *mwindow);
528 class MoveTracksDown : public BC_MenuItem
531 MoveTracksDown(MWindow *mwindow);
536 class DeleteTracks : public BC_MenuItem
539 DeleteTracks(MWindow *mwindow);
544 class ConcatenateTracks : public BC_MenuItem
547 ConcatenateTracks(MWindow *mwindow);
552 class DeleteTrack : public BC_MenuItem
555 DeleteTrack(MWindow *mwindow);
560 class LoopPlayback : public BC_MenuItem
563 LoopPlayback(MWindow *mwindow);
569 class SetBRenderActive : public BC_MenuItem
572 SetBRenderActive(MWindow *mwindow);
577 class LabelsFollowEdits : public BC_MenuItem
580 LabelsFollowEdits(MWindow *mwindow);
585 class PluginsFollowEdits : public BC_MenuItem
588 PluginsFollowEdits(MWindow *mwindow);
593 class KeyframesFollowEdits : public BC_MenuItem
596 KeyframesFollowEdits(MWindow *mwindow);
601 class CursorOnFrames : public BC_MenuItem
604 CursorOnFrames(MWindow *mwindow);
609 class TypelessKeyframes : public BC_MenuItem
612 TypelessKeyframes(MWindow *mwindow);
617 class ScrubSpeed : public BC_MenuItem
620 ScrubSpeed(MWindow *mwindow);
625 class SaveSettingsNow : public BC_MenuItem
628 SaveSettingsNow(MWindow *mwindow);
633 // ========================================== window
634 class ShowVWindow : public BC_MenuItem
637 ShowVWindow(MWindow *mwindow);
642 class ShowAWindow : public BC_MenuItem
645 ShowAWindow(MWindow *mwindow);
650 class ShowGWindow : public BC_MenuItem
653 ShowGWindow(MWindow *mwindow);
658 class ShowCWindow : public BC_MenuItem
661 ShowCWindow(MWindow *mwindow);
666 class ShowLWindow : public BC_MenuItem
669 ShowLWindow(MWindow *mwindow);
674 class TileWindows : public BC_MenuItem
677 TileWindows(MWindow *mwindow, const char *item_title, int config,
678 const char *hot_keytext="", int hot_key=0);
684 class SplitX : public BC_MenuItem
687 SplitX(MWindow *mwindow);
692 class SplitY : public BC_MenuItem
695 SplitY(MWindow *mwindow);
700 class MixerViewer : public BC_MenuItem
703 MixerViewer(MWindow *mwindow);