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