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;
40 class KeyframeCurveType;
41 class KeyframeCurveTypeMenu;
42 class KeyframeCurveTypeItem;
47 #include "arraylist.h"
50 #include "loadfile.inc"
51 #include "mwindow.inc"
52 #include "mwindowgui.inc"
53 #include "maxchannels.h"
54 #include "menuaeffects.inc"
55 #include "menuveffects.inc"
58 #include "plugindialog.inc"
62 #include "threadloader.inc"
63 #include "viewmenu.inc"
65 #define TOTAL_LOADS 10 // number of files to cache
66 #define TOTAL_EFFECTS 10 // number of effects to cache
68 class MainMenu : public BC_MenuBar
71 MainMenu(MWindow *mwindow, MWindowGUI *gui, int w);
73 void create_objects();
74 int load_defaults(BC_Hash *defaults);
75 int save_defaults(BC_Hash *defaults);
78 int add_load(char *path);
79 void init_loads(BC_Hash *defaults);
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);
91 // show only one of these at a time
93 void update_toggles(int use_lock);
97 ThreadLoader *threadloader;
98 MenuAEffects *aeffects;
99 MenuVEffects *veffects;
102 LoadPrevious *load[TOTAL_LOADS];
105 RecordMenuItem *record_menu_item;
108 MenuAEffectItem *aeffect[TOTAL_EFFECTS];
109 MenuVEffectItem *veffect[TOTAL_EFFECTS];
110 Quit *quit_program; // affected by save
115 BC_Menu *filemenu, *audiomenu, *videomenu; // needed by most recents
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;
149 // ========================================= edit
151 class Undo : public BC_MenuItem
154 Undo(MWindow *mwindow);
156 int update_caption(const char *new_caption = "");
162 class DumpCICache : public BC_MenuItem
165 DumpCICache(MWindow *mwindow);
170 class DumpEDL : public BC_MenuItem
173 DumpEDL(MWindow *mwindow);
178 class DumpPlugins : public BC_MenuItem
181 DumpPlugins(MWindow *mwindow);
186 class DumpAssets : public BC_MenuItem
189 DumpAssets(MWindow *mwindow);
194 class Redo : public BC_MenuItem
197 Redo(MWindow *mwindow);
199 int update_caption(const char *new_caption = "");
203 class Cut : public BC_MenuItem
206 Cut(MWindow *mwindow);
211 class Copy : public BC_MenuItem
214 Copy(MWindow *mwindow);
219 class Paste : public BC_MenuItem
222 Paste(MWindow *mwindow);
227 class Clear : public BC_MenuItem
230 Clear(MWindow *mwindow);
235 class CutKeyframes : public BC_MenuItem
238 CutKeyframes(MWindow *mwindow);
243 class CopyKeyframes : public BC_MenuItem
246 CopyKeyframes(MWindow *mwindow);
251 class PasteKeyframes : public BC_MenuItem
254 PasteKeyframes(MWindow *mwindow);
260 class ClearKeyframes : public BC_MenuItem
263 ClearKeyframes(MWindow *mwindow);
268 class StraightenKeyframes : public BC_MenuItem
271 StraightenKeyframes(MWindow *mwindow);
276 class BendKeyframes : public BC_MenuItem
279 BendKeyframes(MWindow *mwindow);
284 class KeyframeCurveType : public BC_MenuItem
287 KeyframeCurveType(MWindow *mwindow);
288 ~KeyframeCurveType();
290 void create_objects();
291 void update(int curve_type);
295 KeyframeCurveTypeMenu *curve_menu;
298 class KeyframeCurveTypeMenu : public BC_SubMenu
301 KeyframeCurveTypeMenu(KeyframeCurveType *menu_item);
302 ~KeyframeCurveTypeMenu();
304 KeyframeCurveType *menu_item;
307 class KeyframeCurveTypeItem : public BC_MenuItem
310 KeyframeCurveTypeItem(int type, KeyframeCurveType *main_item);
311 ~KeyframeCurveTypeItem();
313 KeyframeCurveType *main_item;
319 class CutDefaultKeyframe : public BC_MenuItem
322 CutDefaultKeyframe(MWindow *mwindow);
327 class CopyDefaultKeyframe : public BC_MenuItem
330 CopyDefaultKeyframe(MWindow *mwindow);
335 class PasteDefaultKeyframe : public BC_MenuItem
338 PasteDefaultKeyframe(MWindow *mwindow);
343 class ClearDefaultKeyframe : public BC_MenuItem
346 ClearDefaultKeyframe(MWindow *mwindow);
351 class PasteSilence : public BC_MenuItem
354 PasteSilence(MWindow *mwindow);
359 class SelectAll : public BC_MenuItem
362 SelectAll(MWindow *mwindow);
367 class ClearLabels : public BC_MenuItem
370 ClearLabels(MWindow *mwindow);
375 class CutCommercials : public BC_MenuItem
378 CutCommercials(MWindow *mwindow);
383 class DetachTransitions : public BC_MenuItem
386 DetachTransitions(MWindow *mwindow);
391 class MuteSelection : public BC_MenuItem
394 MuteSelection(MWindow *mwindow);
399 class TrimSelection : public BC_MenuItem
402 TrimSelection(MWindow *mwindow);
407 // ======================================== audio
409 class AddAudioTrack : public BC_MenuItem
412 AddAudioTrack(MWindow *mwindow);
417 class DeleteAudioTrack : public BC_MenuItem
420 DeleteAudioTrack(MWindow *mwindow);
425 class DefaultATransition : public BC_MenuItem
428 DefaultATransition(MWindow *mwindow);
433 class MapAudio1 : public BC_MenuItem
436 MapAudio1(MWindow *mwindow);
441 class MapAudio2 : public BC_MenuItem
444 MapAudio2(MWindow *mwindow);
449 // ========================================== video
452 class AddVideoTrack : public BC_MenuItem
455 AddVideoTrack(MWindow *mwindow);
461 class DeleteVideoTrack : public BC_MenuItem
464 DeleteVideoTrack(MWindow *mwindow);
469 class ResetTranslation : public BC_MenuItem
472 ResetTranslation(MWindow *mwindow);
477 class DefaultVTransition : public BC_MenuItem
480 DefaultVTransition(MWindow *mwindow);
486 // ========================================== subtitle
488 class AddSubttlTrack : public BC_MenuItem
491 AddSubttlTrack(MWindow *mwindow);
496 class PasteSubttl : public BC_MenuItem
499 PasteSubttl(MWindow *mwindow);
505 // ========================================== settings
508 class MoveTracksUp : public BC_MenuItem
511 MoveTracksUp(MWindow *mwindow);
516 class MoveTracksDown : public BC_MenuItem
519 MoveTracksDown(MWindow *mwindow);
524 class DeleteTracks : public BC_MenuItem
527 DeleteTracks(MWindow *mwindow);
532 class ConcatenateTracks : public BC_MenuItem
535 ConcatenateTracks(MWindow *mwindow);
540 class DeleteTrack : public BC_MenuItem
543 DeleteTrack(MWindow *mwindow);
548 class LoopPlayback : public BC_MenuItem
551 LoopPlayback(MWindow *mwindow);
557 class SetBRenderRange : public BC_MenuItem
560 SetBRenderRange(MWindow *mwindow);
565 class LabelsFollowEdits : public BC_MenuItem
568 LabelsFollowEdits(MWindow *mwindow);
573 class PluginsFollowEdits : public BC_MenuItem
576 PluginsFollowEdits(MWindow *mwindow);
581 class KeyframesFollowEdits : public BC_MenuItem
584 KeyframesFollowEdits(MWindow *mwindow);
589 class CursorOnFrames : public BC_MenuItem
592 CursorOnFrames(MWindow *mwindow);
597 class TypelessKeyframes : public BC_MenuItem
600 TypelessKeyframes(MWindow *mwindow);
605 class ScrubSpeed : public BC_MenuItem
608 ScrubSpeed(MWindow *mwindow);
613 class SaveSettingsNow : public BC_MenuItem
616 SaveSettingsNow(MWindow *mwindow);
621 // ========================================== window
622 class ShowVWindow : public BC_MenuItem
625 ShowVWindow(MWindow *mwindow);
630 class ShowAWindow : public BC_MenuItem
633 ShowAWindow(MWindow *mwindow);
638 class ShowGWindow : public BC_MenuItem
641 ShowGWindow(MWindow *mwindow);
646 class ShowCWindow : public BC_MenuItem
649 ShowCWindow(MWindow *mwindow);
654 class ShowLWindow : public BC_MenuItem
657 ShowLWindow(MWindow *mwindow);
662 class TileWindows : public BC_MenuItem
665 TileWindows(MWindow *mwindow, const char *item_title, int config,
666 const char *hot_keytext="", int hot_key=0);
672 class SplitX : public BC_MenuItem
675 SplitX(MWindow *mwindow);
680 class SplitY : public BC_MenuItem
683 SplitY(MWindow *mwindow);