rework undo compression, add shift viewer overwr/copy/clip/splice, fix paste edl...
[goodguy/history.git] / cinelerra-5.1 / cinelerra / mwindow.h
index 5a21221303a41196095ef0bf17f5f90d06b70983..8482dc06f16606211503255bed9cf785580975c7 100644 (file)
 #include <stdio.h>
 #include <stdint.h>
 
+#include "apatchgui.h"
 #include "arraylist.h"
 #include "asset.inc"
 #include "assets.inc"
 #include "audiodevice.inc"
+#include "autos.inc"
 #include "awindow.inc"
 #include "batchrender.inc"
 #include "bcwindowbase.inc"
@@ -91,7 +93,9 @@
 #include "transition.inc"
 #include "transportque.inc"
 #include "videowindow.inc"
+#include "vpatchgui.h"
 #include "vwindow.inc"
+#include "zwindow.inc"
 #include "wwindow.inc"
 #include "wavecache.inc"
 
@@ -118,7 +122,7 @@ public:
        int run_script(FileXML *script);
        int new_project();
        int delete_project(int flash = 1);
-       void quit(int unlock);
+       void quit();
        int restart() { return restart_status; }
 
        int load_defaults();
@@ -134,6 +138,7 @@ public:
        void show_lwindow();
        void show_cwindow();
        void show_gwindow();
+       void hide_gwindow();
        int tile_windows(int window_config);
        char *get_cwindow_display();
 //     void set_titles(int value);
@@ -141,10 +146,6 @@ public:
        int asset_to_edl(EDL *new_edl,
                Asset *new_asset,
                RecordLabels *labels = 0);
-// Convert nested_edl to a nested EDL in new_edl
-// suitable for pasting in paste_edls
-       int edl_to_nested(EDL *new_edl,
-               EDL *nested_edl);
 
 // Entry point to insert assets and insert edls.  Called by TrackCanvas
 // and AssetPopup when assets are dragged in from AWindow.
@@ -194,13 +195,27 @@ public:
 // Find the plugin whose title matches title and return it
        static PluginServer* scan_plugindb(char *title,
                int data_type);
+       static void fix_plugin_title(char *title);
        static int plugin_exists(const char *plugin_path, ArrayList<PluginServer*> &plugins);
        static int plugin_exists(char *plugin_path);
        void dump_plugindb(FILE *fp);
-       void stop_playback(int wait=0);
-
-
-
+       void stop_playback(int wait);
+       void stop_transport();
+
+       void queue_mixers(EDL *edl, int command, int wait_tracking,
+               int use_inout, int update_refresh, int toggle_audio, int loop_play);
+       void create_mixers();
+       void refresh_mixers();
+       void stop_mixers();
+       void close_mixers();
+       void open_mixers();
+       ZWindow *get_mixer(Mixer *&mixer);
+       void del_mixer(ZWindow *zwindow);
+       int mixer_track_active(Track *track);
+       void update_mixer_tracks();
+       void start_mixer();
+       int select_zwindow(ZWindow *zwindow);
+       void tile_mixers();
 
        int load_filenames(ArrayList<char*> *filenames,
                int load_mode = LOADMODE_REPLACE,
@@ -233,6 +248,7 @@ public:
        int move_right(int64_t distance = 0);
        void move_up(int64_t distance = 0);
        void move_down(int64_t distance = 0);
+       int find_selection(double position, int scroll_display = 0);
 
 // seek to labels
 // shift_down must be passed by the caller because different windows call
@@ -242,6 +258,8 @@ public:
 // seek to edit handles
        int next_edit_handle(int shift_down);
        int prev_edit_handle(int shift_down);
+// seek to keyframes
+       int nearest_plugin_keyframe(int shift_down, int dir);
 // offset is pixels to add to track_start
        void trackmovement(int offset, int pane_number);
 // view_start is pixels
@@ -319,6 +337,13 @@ public:
        void copy();
        int copy(double start, double end);
        void cut();
+       void blade(double position);
+       void cut(double start, double end, double new_position=-1);
+// cut edit from current position to handle/label
+       void cut_left_edit();
+       void cut_right_edit();
+       void cut_left_label();
+       void cut_right_label();
 
 // Calculate aspect ratio from pixel counts
        static int create_aspect_ratio(float &w, float &h, int width, int height);
@@ -326,8 +351,6 @@ public:
        static void create_defaults_path(char *string, const char *config_file);
 
        void delete_folder(char *folder);
-       void delete_inpoint();
-       void delete_outpoint();
 
        void delete_track();
        void delete_track(Track *track);
@@ -391,24 +414,17 @@ public:
        void move_tracks_up();
        void mute_selection();
        void new_folder(const char *new_folder);
-       void overwrite(EDL *source);
 // For clipboard commands
        void paste();
 // For splice and overwrite
-       int paste(double start,
-               double end,
-               FileXML *file,
-               int edit_labels,
-               int edit_plugins,
-               int edit_autos);
-       int paste_output(int64_t startproject,
-                               int64_t endproject,
-                               int64_t startsource_sample,
-                               int64_t endsource_sample,
-                               int64_t startsource_frame,
-                               int64_t endsource_frame,
-                               Asset *asset,
-                               RecordLabels *new_labels);
+       void overwrite(EDL *source, int all);
+       void splice(EDL *source, int all);
+       int paste(double start, double end, FileXML *file,
+               int edit_labels, int edit_plugins, int edit_autos);
+       int paste_output(int64_t startproject, int64_t endproject,
+               int64_t startsource_sample, int64_t endsource_sample,
+               int64_t startsource_frame, int64_t endsource_frame,
+               Asset *asset, RecordLabels *new_labels);
        void paste_silence();
 
 // Detach single transition
@@ -448,6 +464,7 @@ public:
        void set_automation_mode(int mode);
        void set_keyframe_type(int mode);
        void set_auto_keyframes(int value, int lock_mwindow, int lock_cwindow);
+       void set_auto_visibility(Autos *autos, int value);
        void set_labels_follow_edits(int value);
 
 // Update the editing mode
@@ -455,13 +472,14 @@ public:
        void toggle_editing_mode();
        void set_inpoint(int is_mwindow);
        void set_outpoint(int is_mwindow);
-       void splice(EDL *source);
+       void unset_inoutpoint(int is_mwindow);
        void toggle_loop_playback();
        void trim_selection();
 // Synchronize EDL settings with all playback engines depending on current
 // operation.  Doesn't redraw anything.
        void sync_parameters(int change_type = CHANGE_PARAMS);
-       void to_clip();
+       void save_clip(EDL *new_edl, const char *txt);
+       void to_clip(EDL *edl, const char *txt, int all);
        int toggle_label(int is_mwindow);
        void undo_entry(BC_WindowBase *calling_window_gui);
        void redo_entry(BC_WindowBase *calling_window_gui);
@@ -479,9 +497,21 @@ public:
        int paste_default_keyframe();
        int clear_default_keyframe();
 
+       FloatAuto* get_float_auto(PatchGUI *patch,int idx);
+       IntAuto* get_int_auto(PatchGUI *patch,int idx);
+       PanAuto* get_pan_auto(PatchGUI *patch);
+       PatchGUI *get_patchgui(Track *track);
+
        int modify_edithandles();
        int modify_pluginhandles();
        void finish_modify_handles();
+       void set_proxy(int use_scaler, int new_scale, int auto_scale,
+               ArrayList<Indexable*> *orig_assets,
+               ArrayList<Indexable*> *proxy_assets);
+       void add_proxy(int use_scaler,
+               ArrayList<Indexable*> *orig_assets,
+               ArrayList<Indexable*> *proxy_assets);
+       void render_proxy(ArrayList<Indexable *> &new_idxbls);
 
        void dump_plugins(FILE *fp=stdout);
        void dump_edl(FILE *fp=stdout);
@@ -519,6 +549,8 @@ public:
        MainIndexes *mainindexes;
        MainProgress *mainprogress;
        BRender *brender;
+       char cin_lang[4];
+       int brender_active;
        const char *default_standard;
        static Commercials *commercials;
        int commercial_active;
@@ -575,6 +607,9 @@ public:
 // Viewer
        Mutex *vwindows_lock;
        ArrayList<VWindow*> vwindows;
+// Mixer
+       Mutex *zwindows_lock;
+       ArrayList<ZWindow*> zwindows;
 // Asset manager
        AWindow *awindow;
 // Automation window
@@ -587,6 +622,7 @@ public:
        int wait_warning();
 // Levels
        LevelWindow *lwindow;
+       Mutex *run_lock;
 // Lock during creation and destruction of GUI
        Mutex *plugin_gui_lock;
        Mutex *dead_plugin_lock;
@@ -611,7 +647,7 @@ public:
 // This one happens asynchronously of the others.  Used by playback to
 // see what frame is background rendered.
        int brender_available(int position);
-       void set_brender_start();
+       void set_brender_active(int v, int update=1);
        int put_commercial();
        void activate_commercial() { commercial_active = 1; }
        void commit_commercial();
@@ -622,6 +658,7 @@ public:
        void init_error();
        void finit_error();
        static void init_defaults(BC_Hash* &defaults, char *config_path);
+       void check_language();
        const char *default_std();
        void fill_preset_defaults(const char *preset, EDLSession *session);
        const char *get_preset_name(int index);
@@ -633,6 +670,7 @@ public:
        static void get_plugin_path(char *path, const char *plug_dir, const char *fs_path);
        static int init_plugins(MWindow *mwindow, Preferences *preferences);
        static int init_ladspa_plugins(MWindow *mwindow, Preferences *preferences);
+       static void init_plugin_tips(ArrayList<PluginServer*> &plugins, const char *lang);
        static int check_plugin_index(ArrayList<PluginServer*> &plugins,
                const char *plug_dir, const char *plug_path);
        static void init_plugin_index(MWindow *mwindow, Preferences *preferences,
@@ -662,14 +700,13 @@ public:
        void init_commercials();
        static void add_plugins(ArrayList<PluginServer*> &plugins);
        static void delete_plugins();
-// 
+//
        void clean_indexes();
 //     TimeBomb timebomb;
        SigHandler *sighandler;
        int restart_status;
        int screens;
        int in_destructor;
-       int warn_version;
 };
 
 #endif