rename save project as export project, update shortcuts xyz
[goodguy/history.git] / cinelerra-5.1 / cinelerra / mwindow.h
1 /*
2  * CINELERRA
3  * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  *
19  */
20
21 #ifndef MWINDOW_H
22 #define MWINDOW_H
23
24 #include <stdio.h>
25 #include <stdint.h>
26
27 #include "apatchgui.h"
28 #include "arraylist.h"
29 #include "asset.inc"
30 #include "assets.inc"
31 #include "audiodevice.inc"
32 #include "autos.inc"
33 #include "awindow.inc"
34 #include "batchrender.inc"
35 #include "bcwindowbase.inc"
36 #include "bdcreate.inc"
37 #include "brender.inc"
38 #include "cache.inc"
39 #include "channel.inc"
40 #include "channeldb.inc"
41 #include "commercials.inc"
42 #include "cwindow.inc"
43 #include "bchash.inc"
44 #include "devicedvbinput.inc"
45 #include "devicempeginput.inc"
46 #include "dvdcreate.inc"
47 #include "edit.inc"
48 #include "edl.inc"
49 #include "edlsession.inc"
50 #include "exportedl.inc"
51 #include "filesystem.inc"
52 #include "filexml.inc"
53 #include "framecache.inc"
54 #include "gwindow.inc"
55 #include "indexable.inc"
56 #include "keyframegui.inc"
57 #include "levelwindow.inc"
58 #include "loadmode.inc"
59 #include "mainerror.inc"
60 #include "mainindexes.inc"
61 #include "mainprogress.inc"
62 #include "mainsession.inc"
63 #include "mainundo.inc"
64 #include "maxchannels.h"
65 #include "mutex.inc"
66 #include "mwindow.inc"
67 #include "mwindowgui.inc"
68 #include "new.inc"
69 #include "patchbay.inc"
70 #include "playback3d.inc"
71 #include "playbackengine.inc"
72 #include "plugin.inc"
73 #include "pluginfclient.inc"
74 #include "pluginserver.inc"
75 #include "pluginset.inc"
76 #include "preferences.inc"
77 #include "preferencesthread.inc"
78 #include "proxy.inc"
79 #include "record.inc"
80 #include "recordlabel.inc"
81 #include "render.inc"
82 #include "sharedlocation.inc"
83 #include "sighandler.inc"
84 #include "splashgui.inc"
85 #include "theme.inc"
86 #include "thread.h"
87 #include "threadloader.inc"
88 #include "timebar.inc"
89 #include "timebomb.h"
90 #include "tipwindow.inc"
91 #include "track.inc"
92 #include "tracking.inc"
93 #include "tracks.inc"
94 #include "transition.inc"
95 #include "transportque.inc"
96 #include "videowindow.inc"
97 #include "vpatchgui.h"
98 #include "vwindow.inc"
99 #include "zwindow.inc"
100 #include "wwindow.inc"
101 #include "wavecache.inc"
102
103 #define FONT_SEARCHPATH "fonts"
104
105 // All entry points for commands except for window locking should be here.
106 // This allows scriptability.
107
108 class MWindow : public Thread
109 {
110 public:
111         MWindow();
112         ~MWindow();
113
114 // ======================================== initialization commands
115         void create_objects(int want_gui,
116                 int want_new,
117                 char *config_path);
118         void show_splash();
119         void hide_splash();
120         void start();
121         void run();
122
123         int run_script(FileXML *script);
124         int new_project();
125         int delete_project(int flash = 1);
126         void quit();
127         int restart() { return restart_status; }
128
129         int load_defaults();
130         int save_defaults();
131         int set_filename(const char *filename);
132 // Total vertical pixels in timeline
133         int get_tracks_height();
134 // Total horizontal pixels in timeline
135         int get_tracks_width();
136 // Show windows
137         void show_vwindow();
138         void show_awindow();
139         void show_lwindow();
140         void show_cwindow();
141         void show_gwindow();
142         void hide_gwindow();
143         int tile_windows(int window_config);
144         char *get_cwindow_display();
145         void set_screens(int value);
146         int asset_to_edl(EDL *new_edl,
147                 Asset *new_asset,
148                 RecordLabels *labels = 0);
149
150 // Entry point to insert assets and insert edls.  Called by TrackCanvas
151 // and AssetPopup when assets are dragged in from AWindow.
152 // Takes the drag vectors from MainSession and
153 // pastes either assets or clips depending on which is full.
154 // Returns 1 if the vectors were full
155         int paste_assets(double position, Track *dest_track, int overwrite);
156
157 // Insert the assets at a point in the EDL.  Called by menueffects,
158 // render, and CWindow drop but recording calls paste_edls directly for
159 // labels.
160         void load_assets(ArrayList<Indexable*> *new_assets,
161                 double position,
162                 int load_mode,
163                 Track *first_track /* = 0 */,
164                 RecordLabels *labels /* = 0 */,
165                 int edit_labels,
166                 int edit_plugins,
167                 int edit_autos,
168                 int overwrite);
169         int paste_edls(ArrayList<EDL*> *new_edls,
170                 int load_mode,
171                 Track *first_track /* = 0 */,
172                 double current_position /* = -1 */,
173                 int edit_labels,
174                 int edit_plugins,
175                 int edit_autos,
176                 int overwrite);
177 // Reset everything for a load
178         void update_project(int load_mode);
179 // Fit selected time to horizontal display range
180         void fit_selection();
181 // Fit selected autos to the vertical display range
182         void fit_autos(int doall);
183         void change_currentautorange(int autogrouptype, int increment, int changemax);
184         void expand_autos(int changeall, int domin, int domax);
185         void shrink_autos(int changeall, int domin, int domax);
186 // move the window to include the cursor
187         void find_cursor();
188 // Search plugindb and put results in argument
189         static void search_plugindb(int do_audio,
190                 int do_video,
191                 int is_realtime,
192                 int is_transition,
193                 int is_theme,
194                 ArrayList<PluginServer*> &results);
195 // Find the plugin whose title matches title and return it
196         static PluginServer* scan_plugindb(char *title,
197                 int data_type);
198         static void fix_plugin_title(char *title);
199         static int plugin_exists(const char *plugin_path, ArrayList<PluginServer*> &plugins);
200         static int plugin_exists(char *plugin_path);
201         void dump_plugindb(FILE *fp);
202         void stop_playback(int wait);
203         void stop_transport();
204
205         void queue_mixers(EDL *edl, int command, int wait_tracking,
206                 int use_inout, int update_refresh, int toggle_audio, int loop_play);
207         ZWindow *create_mixer(Indexable *indexable);
208         void create_mixers();
209         void refresh_mixers(int dir=1);
210         void stop_mixers();
211         void close_mixers(int destroy=1);
212         void open_mixers();
213         ZWindow *get_mixer(Mixer *&mixer);
214         void del_mixer(ZWindow *zwindow);
215         int mixer_track_active(Track *track);
216         void update_mixer_tracks();
217         void start_mixer();
218         int select_zwindow(ZWindow *zwindow);
219         void tile_mixers();
220
221         int load_filenames(ArrayList<char*> *filenames,
222                 int load_mode = LOADMODE_REPLACE,
223 // Cause the project filename on the top of the window to be updated.
224 // Not wanted for loading backups.
225                 int update_filename = 1);
226
227
228 // Print out plugins which are referenced in the EDL but not loaded.
229         void test_plugins(EDL *new_edl, char *path);
230
231         int interrupt_indexes();  // Stop index building
232
233         int redraw_time_dependancies();     // after reconfiguring the time format, sample rate, frame rate
234
235 // =========================================== movement
236
237         void next_time_format();
238         void prev_time_format();
239         void time_format_common();
240         int reposition_timebar(int new_pixel, int new_height);
241         int expand_sample();
242         int zoom_in_sample();
243         int zoom_sample(int64_t zoom_sample);
244         void zoom_autos(float min, float max);
245         void zoom_amp(int64_t zoom_amp);
246         void zoom_track(int64_t zoom_track);
247         int fit_sample();
248         int move_left(int64_t distance = 0);
249         int move_right(int64_t distance = 0);
250         void move_up(int64_t distance = 0);
251         void move_down(int64_t distance = 0);
252         int find_selection(double position, int scroll_display = 0);
253         void toggle_camera_xyz();
254         void toggle_projector_xyz();
255
256 // seek to labels
257 // shift_down must be passed by the caller because different windows call
258 // into this
259         int next_label(int shift_down);
260         int prev_label(int shift_down);
261 // seek to edit handles
262         int next_edit_handle(int shift_down);
263         int prev_edit_handle(int shift_down);
264 // seek to keyframes
265         int nearest_plugin_keyframe(int shift_down, int dir);
266 // offset is pixels to add to track_start
267         void trackmovement(int offset, int pane_number);
268 // view_start is pixels
269         int samplemovement(int64_t view_start, int pane_number);
270         void select_all();
271         int goto_start();
272         int goto_end();
273         int goto_position(double position);
274         int expand_y();
275         int zoom_in_y();
276         int expand_t();
277         int zoom_in_t();
278         void split_x();
279         void split_y();
280         void crop_video();
281         void update_plugins();
282 // Call after every edit operation
283         void save_backup();
284         void load_backup();
285         void show_plugin(Plugin *plugin);
286         void hide_plugin(Plugin *plugin, int lock);
287         void hide_plugins();
288         void delete_plugin(PluginServer *plugin);
289 // Update plugins with configuration changes.
290 // Called by TrackCanvas::cursor_motion_event.
291         void update_plugin_guis(int do_keyframe_guis = 1);
292         void update_plugin_states();
293         void update_plugin_titles();
294 // Called by Attachmentpoint during playback.
295 // Searches for matching plugin and renders data in it.
296         void render_plugin_gui(void *data, Plugin *plugin);
297         void render_plugin_gui(void *data, int size, Plugin *plugin);
298
299 // Called from PluginVClient::process_buffer
300 // Returns 1 if a GUI for the plugin is open so OpenGL routines can determine if
301 // they can run.
302         int plugin_gui_open(Plugin *plugin);
303
304         void show_keyframe_gui(Plugin *plugin);
305         void hide_keyframe_guis();
306         void hide_keyframe_gui(Plugin *plugin);
307         void update_keyframe_guis();
308
309
310 // ============================= editing commands ========================
311
312 // Map each recordable audio track to the desired pattern
313         void map_audio(int pattern);
314         void remap_audio(int pattern);
315         enum
316         {
317                 AUDIO_5_1_TO_2,
318                 AUDIO_1_TO_1
319         };
320         void add_audio_track_entry(int above, Track *dst);
321         int add_audio_track(int above, Track *dst);
322         void add_clip_to_edl(EDL *edl);
323         void add_video_track_entry(Track *dst = 0);
324         int add_video_track(int above, Track *dst);
325         void add_subttl_track_entry(Track *dst = 0);
326         int add_subttl_track(int above, Track *dst);
327
328         void asset_to_all();
329         void asset_to_size();
330         void asset_to_rate();
331 // Entry point for clear operations.
332         void clear_entry();
333 // Clears active region in EDL.
334 // If clear_handle, edit boundaries are cleared if the range is 0.
335 // Called by paste, record, menueffects, render, and CWindow drop.
336         void clear(int clear_handle);
337         void clear_labels();
338         int clear_labels(double start, double end);
339         void concatenate_tracks();
340         void copy();
341         int copy(double start, double end);
342         void cut();
343         void blade(double position);
344         void cut(double start, double end, double new_position=-1);
345 // cut edit from current position to handle/label
346         void cut_left_edit();
347         void cut_right_edit();
348         void cut_left_label();
349         void cut_right_label();
350
351 // Calculate aspect ratio from pixel counts
352         static int create_aspect_ratio(float &w, float &h, int width, int height);
353 // Calculate defaults path
354         static void create_defaults_path(char *string, const char *config_file);
355
356         void delete_track();
357         void delete_track(Track *track);
358         void delete_tracks();
359         int feather_edits(int64_t feather_samples, int audio, int video);
360         int64_t get_feather(int audio, int video);
361         float get_aspect_ratio();
362         void insert(double position,
363                 FileXML *file,
364                 int edit_labels,
365                 int edit_plugins,
366                 int edit_autos,
367                 EDL *parent_edl /* = 0 */);
368
369 // TrackCanvas calls this to insert multiple effects from the drag_pluginservers
370 // into pluginset_highlighted.
371         void insert_effects_canvas(double start,
372                 double length);
373
374 // CWindow calls this to insert multiple effects from
375 // the drag_pluginservers array.
376         void insert_effects_cwindow(Track *dest_track);
377
378 // Attach new effect to all recordable tracks
379 // single_standalone - attach 1 standalone on the first track and share it with
380 // other tracks
381         void insert_effect(char *title,
382                 SharedLocation *shared_location,
383                 int data_type,
384                 int plugin_type,
385                 int single_standalone);
386
387 // This is called multiple times by the above functions.
388 // It can't sync parameters.
389         void insert_effect(char *title,
390                 SharedLocation *shared_location,
391                 Track *track,
392                 PluginSet *plugin_set,
393                 double start,
394                 double length,
395                 int plugin_type);
396
397         void match_output_size(Track *track);
398 // Move edit to new position
399         void move_edits(ArrayList<Edit*> *edits,
400                 Track *track,
401                 double position,
402                 int behaviour);       // behaviour: 0 - old style (cut and insert elswhere), 1- new style - (clear and overwrite elsewere)
403 // Move effect to position
404         void move_effect(Plugin *plugin,
405                 Track *track,
406                 int64_t position);
407         void move_effect(Plugin *plugin,
408                 PluginSet *plugin_set,
409                 int64_t position);
410         void move_plugins_up(PluginSet *plugin_set);
411         void move_plugins_down(PluginSet *plugin_set);
412         void move_track_down(Track *track);
413         void move_tracks_down();
414         void move_track_up(Track *track);
415         void move_tracks_up();
416         void mute_selection();
417         void new_folder(const char *new_folder, int is_clips);
418         void delete_folder(char *folder);
419 // For clipboard commands
420         void paste();
421 // For splice and overwrite
422         void overwrite(EDL *source, int all);
423         void splice(EDL *source, int all);
424         int paste(double start, double end, FileXML *file,
425                 int edit_labels, int edit_plugins, int edit_autos);
426         int paste_output(int64_t startproject, int64_t endproject,
427                 int64_t startsource_sample, int64_t endsource_sample,
428                 int64_t startsource_frame, int64_t endsource_frame,
429                 Asset *asset, RecordLabels *new_labels);
430         void paste_silence();
431
432 // Detach single transition
433         void detach_transition(Transition *transition);
434 // Detach all transitions in selection
435         void detach_transitions();
436 // Attach dragged transition
437         void paste_transition();
438 // Attach transition to all edits in selection
439         void paste_transitions(int track_type, char *title);
440 // Attach transition dragged onto CWindow
441         void paste_transition_cwindow(Track *dest_track);
442 // Attach default transition to single edit
443         void paste_audio_transition();
444         void paste_video_transition();
445         void shuffle_edits();
446         void reverse_edits();
447         void align_edits();
448         void set_edit_length(double length);
449 // Set length of single transition
450         void set_transition_length(Transition *transition, double length);
451 // Set length in seconds of all transitions in active range
452         void set_transition_length(double length);
453
454         void remove_indexfile(Indexable *indexable);
455         void rebuild_indices();
456 // Asset removal from caches
457         void reset_caches();
458         void remove_asset_from_caches(Asset *asset);
459         void remove_assets_from_project(int push_undo /* = 0 */,
460                 int redraw /* 1 */,
461                 ArrayList<Indexable*> *drag_assets /* mwindow->session->drag_assets */,
462                 ArrayList<EDL*> *drag_clips /* mwindow->session->drag_clips */);
463         void remove_assets_from_disk();
464         void resize_track(Track *track, int w, int h);
465
466         void set_automation_mode(int mode);
467         void set_keyframe_type(int mode);
468         void set_auto_keyframes(int value, int lock_mwindow, int lock_cwindow);
469         void set_auto_visibility(Autos *autos, int value);
470         void set_labels_follow_edits(int value);
471
472 // Update the editing mode
473         int set_editing_mode(int new_editing_mode, int lock_mwindow, int lock_cwindow);
474         void toggle_editing_mode();
475         void set_inpoint(int is_mwindow);
476         void set_outpoint(int is_mwindow);
477         void unset_inoutpoint(int is_mwindow);
478         void toggle_loop_playback();
479         void trim_selection();
480 // Synchronize EDL settings with all playback engines depending on current
481 // operation.  Doesn't redraw anything.
482         void sync_parameters(int change_type = CHANGE_PARAMS);
483         void save_clip(EDL *new_edl, const char *txt);
484         void to_clip(EDL *edl, const char *txt, int all);
485         int toggle_label(int is_mwindow);
486         void undo_entry(BC_WindowBase *calling_window_gui);
487         void redo_entry(BC_WindowBase *calling_window_gui);
488         void save_undo_data();
489         void load_undo_data();
490         int copy_target(const char *path, const char *target);
491         int link_target(const char *real_path, const char *link_path, int relative);
492         void save_project(const char *dir, int save_mode, int overwrite, int reload);
493
494         int cut_automation();
495         int copy_automation();
496         int paste_automation();
497         void clear_automation();
498         int cut_default_keyframe();
499         int copy_default_keyframe();
500 // Use paste_automation to paste the default keyframe in other position.
501 // Use paste_default_keyframe to replace the default keyframe with whatever is
502 // in the clipboard.
503         int paste_default_keyframe();
504         int clear_default_keyframe();
505
506         FloatAuto* get_float_auto(PatchGUI *patch,int idx);
507         IntAuto* get_int_auto(PatchGUI *patch,int idx);
508         PanAuto* get_pan_auto(PatchGUI *patch);
509         PatchGUI *get_patchgui(Track *track);
510
511         int modify_edithandles();
512         int modify_pluginhandles();
513         void finish_modify_handles();
514         void rescale_proxy(EDL *clip, int orig_scale, int new_scale);
515         void add_proxy(int use_scaler,
516                 ArrayList<Indexable*> *orig_assets,
517                 ArrayList<Indexable*> *proxy_assets);
518         int render_proxy(ArrayList<Indexable *> &new_idxbls);
519         void beep(double freq, double secs, double gain);
520         int enable_proxy();
521         int disable_proxy();
522         int to_proxy(Asset *asset, int new_scale, int new_use_scaler);
523         ProxyBeep *proxy_beep;
524
525         void dump_plugins(FILE *fp=stdout);
526         void dump_edl(FILE *fp=stdout);
527         void dump_undo(FILE *fp=stdout);
528         void dump_exe(FILE *fp=stdout);
529         static void trap_hook(FILE *fp, void *vp);
530
531         void reset_android_remote();
532
533 // Send new EDL to caches
534         void age_caches();
535         int optimize_assets();            // delete unused assets from the cache and assets
536
537         void select_point(double position);
538         int set_loop_boundaries();         // toggle loop playback and set boundaries for loop playback
539
540
541         Playback3D *playback_3d;
542         SplashGUI *splash_window;
543
544 // Main undo stack
545         MainUndo *undo;
546         BC_Hash *defaults;
547         Assets *assets;
548 // CICaches for drawing timeline only
549         CICache *audio_cache, *video_cache;
550 // Frame cache for drawing timeline only.
551 // Cache drawing doesn't wait for file decoding.
552         FrameCache *frame_cache;
553         WaveCache *wave_cache;
554         Preferences *preferences;
555         PreferencesThread *preferences_thread;
556         MainSession *session;
557         Theme *theme;
558         MainIndexes *mainindexes;
559         MainProgress *mainprogress;
560         BRender *brender;
561         char cin_lang[4];
562         int brender_active;
563         const char *default_standard;
564         static Commercials *commercials;
565         int commercial_active;
566         int has_commercials();
567 // copy of edl created in speed_before, used in speed_after to normalize_speed
568         EDL *speed_edl;
569
570 // Menu items
571         ArrayList<ColormodelItem*> colormodels;
572         ArrayList<InterlacemodeItem*>          interlace_project_modes;
573         ArrayList<InterlacemodeItem*>          interlace_asset_modes;
574         ArrayList<InterlacefixmethodItem*>     interlace_asset_fixmethods;
575
576         int reset_meters();
577         void resync_guis();
578
579         int select_asset(Asset *asset, int vstream, int astream, int delete_tracks);
580         int select_asset(int vtrack, int delete_tracks);
581
582 // Channel DB for playback only.  Record channel DB's are in record.C
583         ChannelDB *channeldb_buz;
584         ChannelDB *channeldb_v4l2jpeg;
585
586 // ====================================== plugins ==============================
587
588 // Contains file descriptors for all the dlopens
589         static ArrayList<PluginServer*> *plugindb;
590 // Currently visible plugins
591         int64_t plugin_visibility;
592         ArrayList<PluginServer*> *plugin_guis;
593 // GUI Plugins to delete
594         ArrayList<PluginServer*> *dead_plugins;
595 // Keyframe editors
596         ArrayList<KeyFrameThread*> *keyframe_threads;
597
598 // Adjust sample position to line up with frames.
599         int fix_timing(int64_t &samples_out,
600                 int64_t &frames_out,
601                 int64_t samples_in);
602
603
604         CreateBD_Thread *create_bd;
605         CreateDVD_Thread *create_dvd;
606         BatchRenderThread *batch_render;
607         Render *render;
608
609         ExportEDL *exportedl;
610
611
612 // Master edl
613         EDL *edl;
614 // Main Window GUI
615         MWindowGUI *gui;
616 // Compositor
617         CWindow *cwindow;
618 // Viewer
619         Mutex *vwindows_lock;
620         ArrayList<VWindow*> vwindows;
621 // Mixer
622         Mutex *zwindows_lock;
623         ArrayList<ZWindow*> zwindows;
624 // Asset manager
625         AWindow *awindow;
626 // Automation window
627         GWindow *gwindow;
628 // Tip of the day
629         TipWindow *twindow;
630 // Warning window
631         WWindow *wwindow;
632         void show_warning(int *do_warning, const char *text);
633         int wait_warning();
634 // Levels
635         LevelWindow *lwindow;
636         Mutex *run_lock;
637 // Lock during creation and destruction of GUI
638         Mutex *plugin_gui_lock;
639         Mutex *dead_plugin_lock;
640         Mutex *keyframe_gui_lock;
641 // Lock during creation and destruction of brender so playback doesn't use it.
642         Mutex *brender_lock;
643 // Initialize shared memory
644         void init_shm(const char *pfn, int64_t min);
645 // Initialize channel DB's for playback
646         void init_channeldb();
647         void init_render();
648         void init_exportedl();
649 // These three happen synchronously with each other
650 // Make sure this is called after synchronizing EDL's.
651         void init_brender();
652 // Restart brender after testing its existence
653         void restart_brender();
654 // Stops brender after testing its existence
655         void stop_brender();
656 // This one happens asynchronously of the others.  Used by playback to
657 // see what frame is background rendered.
658         int brender_available(int position);
659         void set_brender_active(int v, int update=1);
660         int put_commercial();
661         void activate_commercial() { commercial_active = 1; }
662         void commit_commercial();
663         void undo_commercial();
664         void cut_commercials();
665         void update_gui(int changed_edl);
666         int paste_subtitle_text(char *text, double start, double end);
667
668         void init_error();
669         void finit_error();
670         static void init_defaults(BC_Hash* &defaults, char *config_path);
671         void check_language();
672         const char *default_std();
673         void fill_preset_defaults(const char *preset, EDLSession *session);
674         const char *get_preset_name(int index);
675         void init_edl();
676         void init_awindow();
677         void init_gwindow();
678         void init_tipwindow();
679 // Used by MWindow and RenderFarmClient
680         static void get_plugin_path(char *path, const char *plug_dir, const char *fs_path);
681         static int init_plugins(MWindow *mwindow, Preferences *preferences);
682         static int init_ladspa_plugins(MWindow *mwindow, Preferences *preferences);
683         static void init_plugin_tips(ArrayList<PluginServer*> &plugins, const char *lang);
684         static int check_plugin_index(ArrayList<PluginServer*> &plugins,
685                 const char *plug_dir, const char *plug_path);
686         static void init_plugin_index(MWindow *mwindow, Preferences *preferences,
687                 FILE *fp, const char *plugin_dir);
688         static int init_ladspa_index(MWindow *mwindow, Preferences *preferences,
689                 FILE *fp, const char *plugin_dir);
690         static void scan_plugin_index(MWindow *mwindow, Preferences *preferences,
691                 FILE *fp, const char *plug_dir, const char *plug_path, int &idx);
692         static void init_ffmpeg();
693         static void init_ffmpeg_index(MWindow *mwindow, Preferences *preferences, FILE *fp);
694         static int load_plugin_index(MWindow *mwindow, FILE *fp, const char *plugin_dir);
695         static PluginServer *new_ffmpeg_server(MWindow *mwindow, const char *name);
696         static int init_lv2_index(MWindow *mwindow, Preferences *preferences, FILE *fp);
697         static PluginServer *new_lv2_server(MWindow *mwindow, const char *name);
698         static void remove_plugin_index();
699
700         void init_preferences();
701         void init_signals();
702         void init_theme();
703         void init_compositor();
704         void init_levelwindow();
705 // Called when creating a new viewer to view footage
706         VWindow* get_viewer(int start_it, int idx=-1);
707         void init_cache();
708         void init_menus();
709         void init_indexes();
710         void init_gui();
711         void init_3d();
712         void init_playbackcursor();
713         void init_commercials();
714         static void add_plugins(ArrayList<PluginServer*> &plugins);
715         static void delete_plugins();
716         void speed_before();
717         int speed_after(int done);
718         int normalize_speed(EDL *old_edl, EDL *new_edl);
719 //
720         void clean_indexes();
721 //      TimeBomb timebomb;
722         SigHandler *sighandler;
723         int restart_status;
724         int screens;
725         int in_destructor;
726 };
727
728 #endif