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;
51 #include "arraylist.h"
54 #include "loadfile.inc"
55 #include "mwindow.inc"
56 #include "mwindowgui.inc"
57 #include "maxchannels.h"
58 #include "menuaeffects.inc"
59 #include "menuveffects.inc"
62 #include "plugindialog.inc"
66 #include "threadloader.inc"
67 #include "viewmenu.inc"
69 #define TOTAL_LOADS 10 // number of files to cache
70 #define TOTAL_EFFECTS 10 // number of effects to cache
75 class MainMenu : public BC_MenuBar
78 MainMenu(MWindow *mwindow, MWindowGUI *gui, int w);
80 void create_objects();
81 int load_defaults(BC_Hash *defaults);
82 int save_defaults(BC_Hash *defaults);
85 int add_load(char *path);
86 void init_loads(BC_Hash *defaults);
88 // most recent effects
89 int init_aeffects(BC_Hash *defaults);
90 int save_aeffects(BC_Hash *defaults);
91 int add_aeffect(char *title);
92 int init_veffects(BC_Hash *defaults);
93 int save_veffects(BC_Hash *defaults);
94 int save_loads(BC_Hash *defaults);
95 int add_veffect(char *title);
98 // show only one of these at a time
100 void update_toggles(int use_lock);
104 ThreadLoader *threadloader;
105 MenuAEffects *aeffects;
106 MenuVEffects *veffects;
109 LoadPrevious *load[TOTAL_LOADS];
112 RecordMenuItem *record_menu_item;
114 NewProject *new_project;
115 MenuAEffectItem *aeffect[TOTAL_EFFECTS];
116 MenuVEffectItem *veffect[TOTAL_EFFECTS];
117 Quit *quit_program; // affected by save
122 BC_Menu *filemenu, *audiomenu, *videomenu; // needed by most recents
124 KeyframeCurveType *keyframe_curve_type;
125 LabelsFollowEdits *labels_follow_edits;
126 PluginsFollowEdits *plugins_follow_edits;
127 KeyframesFollowEdits *keyframes_follow_edits;
128 CursorOnFrames *cursor_on_frames;
129 TypelessKeyframes *typeless_keyframes;
130 SetBRenderActive *brender_active;
131 LoopPlayback *loop_playback;
132 ShowAssets *show_assets;
133 ShowTitles *show_titles;
134 ShowTransitions *show_transitions;
135 ShowAutomation *fade_automation;
136 ShowAutomation *mute_automation;
137 ShowAutomation *pan_automation;
138 ShowAutomation *camera_x;
139 ShowAutomation *camera_y;
140 ShowAutomation *camera_z;
141 ShowAutomation *project_x;
142 ShowAutomation *project_y;
143 ShowAutomation *project_z;
144 PluginAutomation *plugin_automation;
145 ShowAutomation *mask_automation;
146 ShowAutomation *mode_automation;
147 ShowAutomation *speed_automation;
148 ShowVWindow *show_vwindow;
149 ShowAWindow *show_awindow;
150 ShowCWindow *show_cwindow;
151 ShowGWindow *show_gwindow;
152 ShowLWindow *show_lwindow;
155 MixerViewer *mixer_viewer;
156 LoadLayout *load_layout;
157 LoadLayout *save_layout;
160 // ========================================= edit
162 class Undo : public BC_MenuItem
165 Undo(MWindow *mwindow);
167 int update_caption(const char *new_caption = "");
173 class DumpCICache : public BC_MenuItem
176 DumpCICache(MWindow *mwindow);
181 class DumpEDL : public BC_MenuItem
184 DumpEDL(MWindow *mwindow);
189 class DumpPlugins : public BC_MenuItem
192 DumpPlugins(MWindow *mwindow);
197 class DumpAssets : public BC_MenuItem
200 DumpAssets(MWindow *mwindow);
205 class Redo : public BC_MenuItem
208 Redo(MWindow *mwindow);
210 int update_caption(const char *new_caption = "");
214 class Cut : public BC_MenuItem
217 Cut(MWindow *mwindow);
222 class Copy : public BC_MenuItem
225 Copy(MWindow *mwindow);
230 class Paste : public BC_MenuItem
233 Paste(MWindow *mwindow);
238 class Clear : public BC_MenuItem
241 Clear(MWindow *mwindow);
246 class CutKeyframes : public BC_MenuItem
249 CutKeyframes(MWindow *mwindow);
254 class CopyKeyframes : public BC_MenuItem
257 CopyKeyframes(MWindow *mwindow);
262 class PasteKeyframes : public BC_MenuItem
265 PasteKeyframes(MWindow *mwindow);
271 class ClearKeyframes : public BC_MenuItem
274 ClearKeyframes(MWindow *mwindow);
279 class StraightenKeyframes : public BC_MenuItem
282 StraightenKeyframes(MWindow *mwindow);
287 class BendKeyframes : public BC_MenuItem
290 BendKeyframes(MWindow *mwindow);
295 class KeyframeCurveType : public BC_MenuItem
298 KeyframeCurveType(MWindow *mwindow);
299 ~KeyframeCurveType();
301 void create_objects();
302 void update(int curve_type);
306 KeyframeCurveTypeMenu *curve_menu;
309 class KeyframeCurveTypeMenu : public BC_SubMenu
312 KeyframeCurveTypeMenu(KeyframeCurveType *menu_item);
313 ~KeyframeCurveTypeMenu();
315 KeyframeCurveType *menu_item;
318 class KeyframeCurveTypeItem : public BC_MenuItem
321 KeyframeCurveTypeItem(int type, KeyframeCurveType *main_item);
322 ~KeyframeCurveTypeItem();
324 KeyframeCurveType *main_item;
330 class CutDefaultKeyframe : public BC_MenuItem
333 CutDefaultKeyframe(MWindow *mwindow);
338 class CopyDefaultKeyframe : public BC_MenuItem
341 CopyDefaultKeyframe(MWindow *mwindow);
346 class PasteDefaultKeyframe : public BC_MenuItem
349 PasteDefaultKeyframe(MWindow *mwindow);
354 class ClearDefaultKeyframe : public BC_MenuItem
357 ClearDefaultKeyframe(MWindow *mwindow);
362 class PasteSilence : public BC_MenuItem
365 PasteSilence(MWindow *mwindow);
370 class SelectAll : public BC_MenuItem
373 SelectAll(MWindow *mwindow);
378 class ClearLabels : public BC_MenuItem
381 ClearLabels(MWindow *mwindow);
386 class CutCommercials : public BC_MenuItem
389 CutCommercials(MWindow *mwindow);
394 class DetachTransitions : public BC_MenuItem
397 DetachTransitions(MWindow *mwindow);
402 class MuteSelection : public BC_MenuItem
405 MuteSelection(MWindow *mwindow);
410 class TrimSelection : public BC_MenuItem
413 TrimSelection(MWindow *mwindow);
418 class TileMixers : public BC_MenuItem
421 TileMixers(MWindow *mwindow);
426 // ======================================== audio
428 class AddAudioTrack : public BC_MenuItem
431 AddAudioTrack(MWindow *mwindow);
436 class DeleteAudioTrack : public BC_MenuItem
439 DeleteAudioTrack(MWindow *mwindow);
444 class DefaultATransition : public BC_MenuItem
447 DefaultATransition(MWindow *mwindow);
452 class MapAudio1 : public BC_MenuItem
455 MapAudio1(MWindow *mwindow);
460 class MapAudio2 : public BC_MenuItem
463 MapAudio2(MWindow *mwindow);
468 // ========================================== video
471 class AddVideoTrack : public BC_MenuItem
474 AddVideoTrack(MWindow *mwindow);
480 class DeleteVideoTrack : public BC_MenuItem
483 DeleteVideoTrack(MWindow *mwindow);
488 class ResetTranslation : public BC_MenuItem
491 ResetTranslation(MWindow *mwindow);
496 class DefaultVTransition : public BC_MenuItem
499 DefaultVTransition(MWindow *mwindow);
505 // ========================================== subtitle
507 class AddSubttlTrack : public BC_MenuItem
510 AddSubttlTrack(MWindow *mwindow);
515 class PasteSubttl : public BC_MenuItem
518 PasteSubttl(MWindow *mwindow);
524 // ========================================== settings
527 class MoveTracksUp : public BC_MenuItem
530 MoveTracksUp(MWindow *mwindow);
535 class MoveTracksDown : public BC_MenuItem
538 MoveTracksDown(MWindow *mwindow);
543 class DeleteTracks : public BC_MenuItem
546 DeleteTracks(MWindow *mwindow);
551 class ConcatenateTracks : public BC_MenuItem
554 ConcatenateTracks(MWindow *mwindow);
559 class DeleteTrack : public BC_MenuItem
562 DeleteTrack(MWindow *mwindow);
567 class LoopPlayback : public BC_MenuItem
570 LoopPlayback(MWindow *mwindow);
576 class SetBRenderActive : public BC_MenuItem
579 SetBRenderActive(MWindow *mwindow);
584 class LabelsFollowEdits : public BC_MenuItem
587 LabelsFollowEdits(MWindow *mwindow);
592 class PluginsFollowEdits : public BC_MenuItem
595 PluginsFollowEdits(MWindow *mwindow);
600 class KeyframesFollowEdits : public BC_MenuItem
603 KeyframesFollowEdits(MWindow *mwindow);
608 class CursorOnFrames : public BC_MenuItem
611 CursorOnFrames(MWindow *mwindow);
616 class TypelessKeyframes : public BC_MenuItem
619 TypelessKeyframes(MWindow *mwindow);
624 class ScrubSpeed : public BC_MenuItem
627 ScrubSpeed(MWindow *mwindow);
632 class SaveSettingsNow : public BC_MenuItem
635 SaveSettingsNow(MWindow *mwindow);
640 // ========================================== window
641 class ShowVWindow : public BC_MenuItem
644 ShowVWindow(MWindow *mwindow);
649 class ShowAWindow : public BC_MenuItem
652 ShowAWindow(MWindow *mwindow);
657 class ShowGWindow : public BC_MenuItem
660 ShowGWindow(MWindow *mwindow);
665 class ShowCWindow : public BC_MenuItem
668 ShowCWindow(MWindow *mwindow);
673 class ShowLWindow : public BC_MenuItem
676 ShowLWindow(MWindow *mwindow);
681 class TileWindows : public BC_MenuItem
684 TileWindows(MWindow *mwindow, const char *item_title, int config,
685 const char *hot_keytext="", int hot_key=0);
691 class SplitX : public BC_MenuItem
694 SplitX(MWindow *mwindow);
699 class SplitY : public BC_MenuItem
702 SplitY(MWindow *mwindow);
707 class MixerViewer : public BC_MenuItem
710 MixerViewer(MWindow *mwindow);
716 class LoadLayoutItem : public BC_MenuItem
719 LoadLayoutItem(LoadLayout *load_layout, const char *text, int no, int hotkey);
723 LoadLayout *load_layout;
726 class LoadLayout : public BC_MenuItem
729 LoadLayout(MWindow *mwindow, const char *text, int action);
730 void create_objects();