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, int curve_type);
288 ~KeyframeCurveType();
290 void create_objects();
294 KeyframeCurveTypeMenu *curve_menu;
298 class KeyframeCurveTypeMenu : public BC_PopupMenu
301 KeyframeCurveTypeMenu(KeyframeCurveType *menu_item);
302 ~KeyframeCurveTypeMenu();
304 KeyframeCurveType *menu_item;
307 class KeyframeCurveTypeItem : public BC_MenuItem
310 KeyframeCurveTypeItem(int type);
311 ~KeyframeCurveTypeItem();
317 class CutDefaultKeyframe : public BC_MenuItem
320 CutDefaultKeyframe(MWindow *mwindow);
325 class CopyDefaultKeyframe : public BC_MenuItem
328 CopyDefaultKeyframe(MWindow *mwindow);
333 class PasteDefaultKeyframe : public BC_MenuItem
336 PasteDefaultKeyframe(MWindow *mwindow);
341 class ClearDefaultKeyframe : public BC_MenuItem
344 ClearDefaultKeyframe(MWindow *mwindow);
349 class PasteSilence : public BC_MenuItem
352 PasteSilence(MWindow *mwindow);
357 class SelectAll : public BC_MenuItem
360 SelectAll(MWindow *mwindow);
365 class ClearLabels : public BC_MenuItem
368 ClearLabels(MWindow *mwindow);
373 class CutCommercials : public BC_MenuItem
376 CutCommercials(MWindow *mwindow);
381 class DetachTransitions : public BC_MenuItem
384 DetachTransitions(MWindow *mwindow);
389 class MuteSelection : public BC_MenuItem
392 MuteSelection(MWindow *mwindow);
397 class TrimSelection : public BC_MenuItem
400 TrimSelection(MWindow *mwindow);
405 // ======================================== audio
407 class AddAudioTrack : public BC_MenuItem
410 AddAudioTrack(MWindow *mwindow);
415 class DeleteAudioTrack : public BC_MenuItem
418 DeleteAudioTrack(MWindow *mwindow);
423 class DefaultATransition : public BC_MenuItem
426 DefaultATransition(MWindow *mwindow);
431 class MapAudio1 : public BC_MenuItem
434 MapAudio1(MWindow *mwindow);
439 class MapAudio2 : public BC_MenuItem
442 MapAudio2(MWindow *mwindow);
447 // ========================================== video
450 class AddVideoTrack : public BC_MenuItem
453 AddVideoTrack(MWindow *mwindow);
459 class DeleteVideoTrack : public BC_MenuItem
462 DeleteVideoTrack(MWindow *mwindow);
467 class ResetTranslation : public BC_MenuItem
470 ResetTranslation(MWindow *mwindow);
475 class DefaultVTransition : public BC_MenuItem
478 DefaultVTransition(MWindow *mwindow);
484 // ========================================== subtitle
486 class AddSubttlTrack : public BC_MenuItem
489 AddSubttlTrack(MWindow *mwindow);
494 class PasteSubttl : public BC_MenuItem
497 PasteSubttl(MWindow *mwindow);
503 // ========================================== settings
506 class MoveTracksUp : public BC_MenuItem
509 MoveTracksUp(MWindow *mwindow);
514 class MoveTracksDown : public BC_MenuItem
517 MoveTracksDown(MWindow *mwindow);
522 class DeleteTracks : public BC_MenuItem
525 DeleteTracks(MWindow *mwindow);
530 class ConcatenateTracks : public BC_MenuItem
533 ConcatenateTracks(MWindow *mwindow);
538 class DeleteTrack : public BC_MenuItem
541 DeleteTrack(MWindow *mwindow);
546 class LoopPlayback : public BC_MenuItem
549 LoopPlayback(MWindow *mwindow);
555 class SetBRenderStart : public BC_MenuItem
558 SetBRenderStart(MWindow *mwindow);
563 class LabelsFollowEdits : public BC_MenuItem
566 LabelsFollowEdits(MWindow *mwindow);
571 class PluginsFollowEdits : public BC_MenuItem
574 PluginsFollowEdits(MWindow *mwindow);
579 class KeyframesFollowEdits : public BC_MenuItem
582 KeyframesFollowEdits(MWindow *mwindow);
587 class CursorOnFrames : public BC_MenuItem
590 CursorOnFrames(MWindow *mwindow);
595 class TypelessKeyframes : public BC_MenuItem
598 TypelessKeyframes(MWindow *mwindow);
603 class ScrubSpeed : public BC_MenuItem
606 ScrubSpeed(MWindow *mwindow);
611 class SaveSettingsNow : public BC_MenuItem
614 SaveSettingsNow(MWindow *mwindow);
619 // ========================================== window
620 class ShowVWindow : public BC_MenuItem
623 ShowVWindow(MWindow *mwindow);
628 class ShowAWindow : public BC_MenuItem
631 ShowAWindow(MWindow *mwindow);
636 class ShowGWindow : public BC_MenuItem
639 ShowGWindow(MWindow *mwindow);
644 class ShowCWindow : public BC_MenuItem
647 ShowCWindow(MWindow *mwindow);
652 class ShowLWindow : public BC_MenuItem
655 ShowLWindow(MWindow *mwindow);
660 class TileWindows : public BC_MenuItem
663 TileWindows(MWindow *mwindow, const char *item_title, int config,
664 const char *hot_keytext="", int hot_key=0);
670 class SplitX : public BC_MenuItem
673 SplitX(MWindow *mwindow);
678 class SplitY : public BC_MenuItem
681 SplitY(MWindow *mwindow);