switch move/swap tracks, add mv trk shortcut, update msg
[goodguy/cinelerra.git] / cinelerra-5.1 / cinelerra / mainmenu.h
index 2e965f41bcda8dd747026e5ae2ce547fbbe05b76..c9127fa8d72b50b8ca381f1e1371b183075fec8f 100644 (file)
 #include "threadloader.inc"
 #include "viewmenu.inc"
 
-#define TOTAL_LOADS 10      // number of files to cache
+#define TOTAL_LOADS 20       // number of files to cache
 #define TOTAL_EFFECTS 10     // number of effects to cache
 
 #define LAYOUT_LOAD 0
 #define LAYOUT_SAVE 1
 
+class LoadRecentItem
+{
+public:
+       LoadRecentItem(const char *path);
+       ~LoadRecentItem();
+       char *path;
+};
+
+class LoadRecentItems : public ArrayList<LoadRecentItem *>
+{
+public:
+       LoadRecentItems();
+       ~LoadRecentItems();
+       int add_load(char *path);
+};
+
+class LoadRecentSubMenu : public BC_SubMenu
+{
+public:
+       LoadRecentSubMenu(LoadRecent *load_recent);
+       ~LoadRecentSubMenu();
+
+       LoadRecent *load_recent;
+};
+
+class LoadRecent : public BC_MenuItem
+{
+public:
+       LoadRecent(MWindow *mwindow, MainMenu *main_menu);
+       ~LoadRecent();
+       void create_objects();
+       LoadPrevious *get_next_item();
+       int activate_submenu();
+       void scan_items(int use_xml);
+
+       MWindow *mwindow;
+       MainMenu *main_menu;
+       LoadRecentSubMenu *submenu;
+       int total_items;
+};
+
+
 class MainMenu : public BC_MenuBar
 {
 public:
@@ -81,8 +123,8 @@ public:
        MenuVEffects *veffects;
 
        Load *load_file;
-       LoadPrevious *load[TOTAL_LOADS];
-       int total_loads;
+       LoadRecentItems load;
+       LoadRecent *load_recent;
 
        RecordMenuItem *record_menu_item;
        RenderItem *render;
@@ -91,13 +133,16 @@ public:
        MenuVEffectItem *veffect[TOTAL_EFFECTS];
        Quit *quit_program;              // affected by save
        MainDumpsMenu *dump_menu;
+       EditClearMenu *clear_menu;
        Undo *undo;
        Redo *redo;
-       int total_aeffects;
-       int total_veffects;
-       BC_Menu *filemenu, *audiomenu, *videomenu;      // needed by most recents
+       BC_Menu *filemenu;
+       BC_Menu *audiomenu, *videomenu;      // needed by most recents
+       int total_aeffects, total_veffects;
 
        KeyframeCurveType *keyframe_curve_type;
+       KeyframeCreate *keyframe_create;
+       SetAutomationCurveMode *set_auto_curves;
        LabelsFollowEdits *labels_follow_edits;
        PluginsFollowEdits *plugins_follow_edits;
        KeyframesFollowEdits *keyframes_follow_edits;
@@ -128,7 +173,7 @@ public:
        ShowLWindow *show_lwindow;
        SplitX *split_x;
        SplitY *split_y;
-       MixerViewer *mixer_viewer;
+       MixerItems *mixer_items;
        LoadLayout *load_layout;
        LoadLayout *save_layout;
 };
@@ -237,6 +282,26 @@ public:
        MWindow *mwindow;
 };
 
+class EditClearSubMenu : public BC_SubMenu
+{
+public:
+       EditClearSubMenu(BC_MenuItem *menu_item);
+       ~EditClearSubMenu();
+
+       BC_MenuItem *menu_item;
+};
+
+class EditClearMenu : public BC_MenuItem
+{
+public:
+       EditClearMenu(MWindow *mwindow);
+       ~EditClearMenu();
+       void create_objects();
+
+       MWindow *mwindow;
+       EditClearSubMenu *clear_sub_menu;
+};
+
 class Clear : public BC_MenuItem
 {
 public:
@@ -278,22 +343,34 @@ public:
        MWindow *mwindow;
 };
 
-class StraightenKeyframes : public BC_MenuItem
+
+class SetAutomationCurveItem : public BC_MenuItem
 {
 public:
-       StraightenKeyframes(MWindow *mwindow);
+       SetAutomationCurveItem(SetAutomationCurveMode *set_curve_mode, int id);
        int handle_event();
-       MWindow *mwindow;
+       SetAutomationCurveMode *set_curve_mode;
+       int id;
 };
 
-class BendKeyframes : public BC_MenuItem
+class SetAutoCurveModeMenu : public BC_SubMenu
 {
 public:
-       BendKeyframes(MWindow *mwindow);
-       int handle_event();
+       SetAutoCurveModeMenu(SetAutomationCurveMode *curve_mode);
+       SetAutomationCurveMode *curve_mode;
+};
+
+class SetAutomationCurveMode : public BC_MenuItem
+{
+public:
+       SetAutomationCurveMode(MWindow *mwindow);
+       void create_objects();
+
        MWindow *mwindow;
+       SetAutoCurveModeMenu *curve_mode_menu;
 };
 
+
 class KeyframeCurveType : public BC_MenuItem
 {
 public:
@@ -329,6 +406,34 @@ public:
        int handle_event();
 };
 
+class KeyframeCreateItem : public BC_MenuItem
+{
+public:
+       KeyframeCreateItem(KeyframeCreate *keyframe_create, const char *text, int mask);
+       int handle_event();
+
+       KeyframeCreate *keyframe_create;
+       int mask;
+};
+
+class KeyframeCreateMenu : public BC_SubMenu
+{
+public:
+       KeyframeCreateMenu(KeyframeCreate *keyframe_create);
+       KeyframeCreate *keyframe_create;
+};
+
+class KeyframeCreate : public BC_MenuItem
+{
+public:
+       KeyframeCreate(MWindow *mwindow);
+       void create_objects();
+
+       MWindow *mwindow;
+       KeyframeCreateMenu *keyframe_create_menu;
+};
+
+
 class CutDefaultKeyframe : public BC_MenuItem
 {
 public:
@@ -377,6 +482,14 @@ public:
        MWindow *mwindow;
 };
 
+class ClearHardEdges : public BC_MenuItem
+{
+public:
+       ClearHardEdges(MWindow *mwindow);
+       int handle_event();
+       MWindow *mwindow;
+};
+
 class ClearLabels : public BC_MenuItem
 {
 public:
@@ -385,6 +498,14 @@ public:
        MWindow *mwindow;
 };
 
+class ClearSelect : public BC_MenuItem
+{
+public:
+       ClearSelect(MWindow *mwindow);
+       int handle_event();
+       MWindow *mwindow;
+};
+
 class CutCommercials : public BC_MenuItem
 {
 public:
@@ -417,10 +538,59 @@ public:
        MWindow *mwindow;
 };
 
-class TileMixers : public BC_MenuItem
+class MixerItems : public BC_MenuItem
 {
 public:
-       TileMixers(MWindow *mwindow);
+       MixerItems(MWindow *mwindow);
+       void create_objects();
+       int activate_submenu();
+
+       MWindow *mwindow;
+};
+
+class MixerItem : public BC_MenuItem
+{
+public:
+       MixerItem(MixerItems *mixer_items, const char *text, int idx);
+       MixerItem(MixerItems *mixer_items, const char *text, const char *hotkey_text, int hotkey);
+       virtual int handle_event();
+
+       MixerItems *mixer_items;
+       int idx;
+};
+
+class MixerViewer : public MixerItem
+{
+public:
+       MixerViewer(MixerItems *mixer_items);
+       int handle_event();
+};
+
+class TileMixers : public MixerItem
+{
+public:
+       TileMixers(MixerItems *mixer_items);
+       int handle_event();
+};
+
+class AlignMixers : public MixerItem
+{
+public:
+       AlignMixers(MixerItems *mixer_items);
+       int handle_event();
+};
+
+class MixMasters : public MixerItem
+{
+public:
+       MixMasters(MixerItems *mixer_items);
+       int handle_event();
+};
+
+class AlignTimecodes : public BC_MenuItem
+{
+public:
+       AlignTimecodes(MWindow *mwindow);
        int handle_event();
        MWindow *mwindow;
 };
@@ -526,6 +696,22 @@ public:
 // ========================================== settings
 
 
+class RollTracksUp : public BC_MenuItem
+{
+public:
+       RollTracksUp(MWindow *mwindow);
+       int handle_event();
+       MWindow *mwindow;
+};
+
+class RollTracksDown : public BC_MenuItem
+{
+public:
+       RollTracksDown(MWindow *mwindow);
+       int handle_event();
+       MWindow *mwindow;
+};
+
 class MoveTracksUp : public BC_MenuItem
 {
 public:
@@ -558,10 +744,18 @@ public:
        MWindow *mwindow;
 };
 
-class DeleteTrack : public BC_MenuItem
+class DeleteFirstTrack : public BC_MenuItem
 {
 public:
-       DeleteTrack(MWindow *mwindow);
+       DeleteFirstTrack(MWindow *mwindow);
+       int handle_event();
+       MWindow *mwindow;
+};
+
+class DeleteLastTrack : public BC_MenuItem
+{
+public:
+       DeleteLastTrack(MWindow *mwindow);
        int handle_event();
        MWindow *mwindow;
 };
@@ -706,14 +900,6 @@ public:
        MWindow *mwindow;
 };
 
-class MixerViewer : public BC_MenuItem
-{
-public:
-       MixerViewer(MWindow *mwindow);
-       int handle_event();
-       MWindow *mwindow;
-};
-
 
 class LoadLayoutItem : public BC_MenuItem
 {
@@ -721,7 +907,9 @@ public:
        LoadLayoutItem(LoadLayout *load_layout, const char *text, int no, int hotkey);
        int handle_event();
 
-       int no;
+       int idx;
+       char layout_text[BCSTRLEN];
+       char layout_file[BCSTRLEN];
        LoadLayout *load_layout;
 };
 
@@ -729,10 +917,53 @@ class LoadLayout : public BC_MenuItem
 {
 public:
        LoadLayout(MWindow *mwindow, const char *text, int action);
+       ~LoadLayout();
        void create_objects();
+       void update();
+       int activate_submenu();
 
        MWindow *mwindow; 
+       LoadLayoutDialog *layout_dialog;
        int action;
 };
 
+class LoadLayoutDialog : public BC_DialogThread
+{
+public:
+       LoadLayoutDialog(LoadLayout *load_layout);
+       ~LoadLayoutDialog();
+
+       void start_confirm_dialog(int wx, int wy, int idx);
+       void handle_done_event(int result);
+       void handle_close_event(int result);
+       BC_Window* new_gui();
+
+       LoadLayout *load_layout;
+       LoadLayoutConfirm *lgui;
+       int wx, wy, idx;
+};
+
+class LoadLayoutNameText : public BC_TextBox
+{
+public:
+       LoadLayoutNameText(LoadLayoutConfirm *confirm,
+               int x, int y, int w, const char *text);
+       ~LoadLayoutNameText();
+
+       int handle_event();
+
+       LoadLayoutConfirm *confirm;
+};
+
+class LoadLayoutConfirm : public BC_Window
+{
+public:
+       LoadLayoutConfirm(LoadLayoutDialog *load_dialog, int x, int y);
+       ~LoadLayoutConfirm();
+       void create_objects();
+
+       LoadLayoutDialog *layout_dialog;
+       LoadLayoutNameText *name_text;
+};
+
 #endif