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
25 #include "arraylist.h"
28 #include "loadfile.inc"
29 #include "mainmenu.inc"
30 #include "mwindow.inc"
31 #include "mwindowgui.inc"
32 #include "maxchannels.h"
33 #include "menuaeffects.inc"
34 #include "menuveffects.inc"
37 #include "plugindialog.inc"
41 #include "threadloader.inc"
42 #include "viewmenu.inc"
44 #define TOTAL_LOADS 10 // number of files to cache
45 #define TOTAL_EFFECTS 10 // number of effects to cache
50 class MainMenu : public BC_MenuBar
53 MainMenu(MWindow *mwindow, MWindowGUI *gui, int w);
55 void create_objects();
56 int load_defaults(BC_Hash *defaults);
57 int save_defaults(BC_Hash *defaults);
60 int add_load(char *path);
61 void init_loads(BC_Hash *defaults);
63 // most recent effects
64 int init_aeffects(BC_Hash *defaults);
65 int save_aeffects(BC_Hash *defaults);
66 int add_aeffect(char *title);
67 int init_veffects(BC_Hash *defaults);
68 int save_veffects(BC_Hash *defaults);
69 int save_loads(BC_Hash *defaults);
70 int add_veffect(char *title);
73 // show only one of these at a time
75 void update_toggles(int use_lock);
79 ThreadLoader *threadloader;
80 MenuAEffects *aeffects;
81 MenuVEffects *veffects;
84 LoadPrevious *load[TOTAL_LOADS];
87 RecordMenuItem *record_menu_item;
89 NewProject *new_project;
90 MenuAEffectItem *aeffect[TOTAL_EFFECTS];
91 MenuVEffectItem *veffect[TOTAL_EFFECTS];
92 Quit *quit_program; // affected by save
93 MainDumpsMenu *dump_menu;
98 BC_Menu *filemenu, *audiomenu, *videomenu; // needed by most recents
100 KeyframeCurveType *keyframe_curve_type;
101 LabelsFollowEdits *labels_follow_edits;
102 PluginsFollowEdits *plugins_follow_edits;
103 KeyframesFollowEdits *keyframes_follow_edits;
104 CursorOnFrames *cursor_on_frames;
105 TypelessKeyframes *typeless_keyframes;
106 SetBRenderActive *brender_active;
107 LoopPlayback *loop_playback;
108 ShowAssets *show_assets;
109 ShowTitles *show_titles;
110 ShowTransitions *show_transitions;
111 ShowAutomation *fade_automation;
112 ShowAutomation *mute_automation;
113 ShowAutomation *pan_automation;
114 ShowAutomation *camera_x;
115 ShowAutomation *camera_y;
116 ShowAutomation *camera_z;
117 ShowAutomation *project_x;
118 ShowAutomation *project_y;
119 ShowAutomation *project_z;
120 PluginAutomation *plugin_automation;
121 ShowAutomation *mask_automation;
122 ShowAutomation *mode_automation;
123 ShowAutomation *speed_automation;
124 ShowVWindow *show_vwindow;
125 ShowAWindow *show_awindow;
126 ShowCWindow *show_cwindow;
127 ShowGWindow *show_gwindow;
128 ShowLWindow *show_lwindow;
131 MixerItems *mixer_items;
132 LoadLayout *load_layout;
133 LoadLayout *save_layout;
136 // ========================================= edit
138 class Undo : public BC_MenuItem
141 Undo(MWindow *mwindow);
143 int update_caption(const char *new_caption = "");
147 class MainDumpsSubMenu : public BC_SubMenu
150 MainDumpsSubMenu(BC_MenuItem *menu_item);
153 BC_MenuItem *menu_item;
156 class MainDumpsMenu : public BC_MenuItem
159 MainDumpsMenu(MWindow *mwindow);
161 void create_objects();
164 MainDumpsSubMenu *dumps_menu;
167 class DumpCICache : public BC_MenuItem
170 DumpCICache(MWindow *mwindow);
175 class DumpEDL : public BC_MenuItem
178 DumpEDL(MWindow *mwindow);
183 class DumpPlugins : public BC_MenuItem
186 DumpPlugins(MWindow *mwindow);
191 class DumpAssets : public BC_MenuItem
194 DumpAssets(MWindow *mwindow);
199 class DumpUndo : public BC_MenuItem
202 DumpUndo(MWindow *mwindow);
207 class Redo : public BC_MenuItem
210 Redo(MWindow *mwindow);
212 int update_caption(const char *new_caption = "");
216 class Cut : public BC_MenuItem
219 Cut(MWindow *mwindow);
224 class Copy : public BC_MenuItem
227 Copy(MWindow *mwindow);
232 class Paste : public BC_MenuItem
235 Paste(MWindow *mwindow);
240 class Clear : public BC_MenuItem
243 Clear(MWindow *mwindow);
248 class CutKeyframes : public BC_MenuItem
251 CutKeyframes(MWindow *mwindow);
256 class CopyKeyframes : public BC_MenuItem
259 CopyKeyframes(MWindow *mwindow);
264 class PasteKeyframes : public BC_MenuItem
267 PasteKeyframes(MWindow *mwindow);
273 class ClearKeyframes : public BC_MenuItem
276 ClearKeyframes(MWindow *mwindow);
281 class StraightenKeyframes : public BC_MenuItem
284 StraightenKeyframes(MWindow *mwindow);
289 class BendKeyframes : public BC_MenuItem
292 BendKeyframes(MWindow *mwindow);
297 class KeyframeCurveType : public BC_MenuItem
300 KeyframeCurveType(MWindow *mwindow);
301 ~KeyframeCurveType();
303 void create_objects();
304 void update(int curve_type);
308 KeyframeCurveTypeMenu *curve_menu;
311 class KeyframeCurveTypeMenu : public BC_SubMenu
314 KeyframeCurveTypeMenu(KeyframeCurveType *menu_item);
315 ~KeyframeCurveTypeMenu();
317 KeyframeCurveType *menu_item;
320 class KeyframeCurveTypeItem : public BC_MenuItem
323 KeyframeCurveTypeItem(int type, KeyframeCurveType *main_item);
324 ~KeyframeCurveTypeItem();
326 KeyframeCurveType *main_item;
332 class CutDefaultKeyframe : public BC_MenuItem
335 CutDefaultKeyframe(MWindow *mwindow);
340 class CopyDefaultKeyframe : public BC_MenuItem
343 CopyDefaultKeyframe(MWindow *mwindow);
348 class PasteDefaultKeyframe : public BC_MenuItem
351 PasteDefaultKeyframe(MWindow *mwindow);
356 class ClearDefaultKeyframe : public BC_MenuItem
359 ClearDefaultKeyframe(MWindow *mwindow);
364 class PasteSilence : public BC_MenuItem
367 PasteSilence(MWindow *mwindow);
372 class SelectAll : public BC_MenuItem
375 SelectAll(MWindow *mwindow);
380 class ClearLabels : public BC_MenuItem
383 ClearLabels(MWindow *mwindow);
388 class CutCommercials : public BC_MenuItem
391 CutCommercials(MWindow *mwindow);
396 class DetachTransitions : public BC_MenuItem
399 DetachTransitions(MWindow *mwindow);
404 class MuteSelection : public BC_MenuItem
407 MuteSelection(MWindow *mwindow);
412 class TrimSelection : public BC_MenuItem
415 TrimSelection(MWindow *mwindow);
420 class MixerItems : public BC_MenuItem
423 MixerItems(MWindow *mwindow);
424 void create_objects();
428 class MixerViewer : public BC_MenuItem
431 MixerViewer(MWindow *mwindow);
436 class TileMixers : public BC_MenuItem
439 TileMixers(MWindow *mwindow);
444 class AlignMixers : public BC_MenuItem
447 AlignMixers(MWindow *mwindow);
452 // ======================================== audio
454 class AddAudioTrack : public BC_MenuItem
457 AddAudioTrack(MWindow *mwindow);
462 class DeleteAudioTrack : public BC_MenuItem
465 DeleteAudioTrack(MWindow *mwindow);
470 class DefaultATransition : public BC_MenuItem
473 DefaultATransition(MWindow *mwindow);
478 class MapAudio1 : public BC_MenuItem
481 MapAudio1(MWindow *mwindow);
486 class MapAudio2 : public BC_MenuItem
489 MapAudio2(MWindow *mwindow);
494 // ========================================== video
497 class AddVideoTrack : public BC_MenuItem
500 AddVideoTrack(MWindow *mwindow);
506 class DeleteVideoTrack : public BC_MenuItem
509 DeleteVideoTrack(MWindow *mwindow);
514 class ResetTranslation : public BC_MenuItem
517 ResetTranslation(MWindow *mwindow);
522 class DefaultVTransition : public BC_MenuItem
525 DefaultVTransition(MWindow *mwindow);
531 // ========================================== subtitle
533 class AddSubttlTrack : public BC_MenuItem
536 AddSubttlTrack(MWindow *mwindow);
541 class PasteSubttl : public BC_MenuItem
544 PasteSubttl(MWindow *mwindow);
550 // ========================================== settings
553 class MoveTracksUp : public BC_MenuItem
556 MoveTracksUp(MWindow *mwindow);
561 class MoveTracksDown : public BC_MenuItem
564 MoveTracksDown(MWindow *mwindow);
569 class DeleteTracks : public BC_MenuItem
572 DeleteTracks(MWindow *mwindow);
577 class ConcatenateTracks : public BC_MenuItem
580 ConcatenateTracks(MWindow *mwindow);
585 class DeleteFirstTrack : public BC_MenuItem
588 DeleteFirstTrack(MWindow *mwindow);
593 class DeleteLastTrack : public BC_MenuItem
596 DeleteLastTrack(MWindow *mwindow);
601 class LoopPlayback : public BC_MenuItem
604 LoopPlayback(MWindow *mwindow);
610 class SetBRenderActive : public BC_MenuItem
613 SetBRenderActive(MWindow *mwindow);
618 class LabelsFollowEdits : public BC_MenuItem
621 LabelsFollowEdits(MWindow *mwindow);
626 class PluginsFollowEdits : public BC_MenuItem
629 PluginsFollowEdits(MWindow *mwindow);
634 class KeyframesFollowEdits : public BC_MenuItem
637 KeyframesFollowEdits(MWindow *mwindow);
642 class CursorOnFrames : public BC_MenuItem
645 CursorOnFrames(MWindow *mwindow);
650 class TypelessKeyframes : public BC_MenuItem
653 TypelessKeyframes(MWindow *mwindow);
658 class ScrubSpeed : public BC_MenuItem
661 ScrubSpeed(MWindow *mwindow);
666 class SaveSettingsNow : public BC_MenuItem
669 SaveSettingsNow(MWindow *mwindow);
674 // ========================================== window
675 class ShowVWindow : public BC_MenuItem
678 ShowVWindow(MWindow *mwindow);
683 class ShowAWindow : public BC_MenuItem
686 ShowAWindow(MWindow *mwindow);
691 class ShowGWindow : public BC_MenuItem
694 ShowGWindow(MWindow *mwindow);
699 class ShowCWindow : public BC_MenuItem
702 ShowCWindow(MWindow *mwindow);
707 class ShowLWindow : public BC_MenuItem
710 ShowLWindow(MWindow *mwindow);
715 class TileWindows : public BC_MenuItem
718 TileWindows(MWindow *mwindow, const char *item_title, int config,
719 const char *hot_keytext="", int hot_key=0);
725 class SplitX : public BC_MenuItem
728 SplitX(MWindow *mwindow);
733 class SplitY : public BC_MenuItem
736 SplitY(MWindow *mwindow);
742 class LoadLayoutItem : public BC_MenuItem
745 LoadLayoutItem(LoadLayout *load_layout, const char *text, int no, int hotkey);
749 char layout_text[BCSTRLEN];
750 char layout_file[BCSTRLEN];
751 LoadLayout *load_layout;
754 class LoadLayout : public BC_MenuItem
757 LoadLayout(MWindow *mwindow, const char *text, int action);
759 void create_objects();
761 int activate_submenu();
764 LoadLayoutDialog *layout_dialog;
768 class LoadLayoutDialog : public BC_DialogThread
771 LoadLayoutDialog(LoadLayout *load_layout);
774 void start_confirm_dialog(int wx, int wy, int idx);
775 void handle_done_event(int result);
776 void handle_close_event(int result);
777 BC_Window* new_gui();
779 LoadLayout *load_layout;
780 LoadLayoutConfirm *lgui;
784 class LoadLayoutNameText : public BC_TextBox
787 LoadLayoutNameText(LoadLayoutConfirm *confirm,
788 int x, int y, int w, const char *text);
789 ~LoadLayoutNameText();
793 LoadLayoutConfirm *confirm;
796 class LoadLayoutConfirm : public BC_Window
799 LoadLayoutConfirm(LoadLayoutDialog *load_dialog, int x, int y);
800 ~LoadLayoutConfirm();
801 void create_objects();
803 LoadLayoutDialog *layout_dialog;
804 LoadLayoutNameText *name_text;