undo/redo mixer, freds vp9, next/prev kfrm, ruleof3rds
[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 "record.inc"
79 #include "recordlabel.inc"
80 #include "render.inc"
81 #include "sharedlocation.inc"
82 #include "sighandler.inc"
83 #include "splashgui.inc"
84 #include "theme.inc"
85 #include "thread.h"
86 #include "threadloader.inc"
87 #include "timebar.inc"
88 #include "timebomb.h"
89 #include "tipwindow.inc"
90 #include "track.inc"
91 #include "tracking.inc"
92 #include "tracks.inc"
93 #include "transition.inc"
94 #include "transportque.inc"
95 #include "videowindow.inc"
96 #include "vpatchgui.h"
97 #include "vwindow.inc"
98 #include "zwindow.inc"
99 #include "wwindow.inc"
100 #include "wavecache.inc"
101
102 #define FONT_SEARCHPATH "fonts"
103
104 // All entry points for commands except for window locking should be here.
105 // This allows scriptability.
106
107 class MWindow : public Thread
108 {
109 public:
110         MWindow();
111         ~MWindow();
112
113 // ======================================== initialization commands
114         void create_objects(int want_gui,
115                 int want_new,
116                 char *config_path);
117         void show_splash();
118         void hide_splash();
119         void start();
120         void run();
121
122         int run_script(FileXML *script);
123         int new_project();
124         int delete_project(int flash = 1);
125         void quit();
126         int restart() { return restart_status; }
127
128         int load_defaults();
129         int save_defaults();
130         int set_filename(const char *filename);
131 // Total vertical pixels in timeline
132         int get_tracks_height();
133 // Total horizontal pixels in timeline
134         int get_tracks_width();
135 // Show windows
136         void show_vwindow();
137         void show_awindow();
138         void show_lwindow();
139         void show_cwindow();
140         void show_gwindow();
141         void hide_gwindow();
142         int tile_windows(int window_config);
143         char *get_cwindow_display();
144 //      void set_titles(int value);
145         void set_screens(int value);
146         int asset_to_edl(EDL *new_edl,
147                 Asset *new_asset,
148                 RecordLabels *labels = 0);
149 // Convert nested_edl to a nested EDL in new_edl
150 // suitable for pasting in paste_edls
151         int edl_to_nested(EDL *new_edl,
152                 EDL *nested_edl);
153
154 // Entry point to insert assets and insert edls.  Called by TrackCanvas
155 // and AssetPopup when assets are dragged in from AWindow.
156 // Takes the drag vectors from MainSession and
157 // pastes either assets or clips depending on which is full.
158 // Returns 1 if the vectors were full
159         int paste_assets(double position, Track *dest_track, int overwrite);
160
161 // Insert the assets at a point in the EDL.  Called by menueffects,
162 // render, and CWindow drop but recording calls paste_edls directly for
163 // labels.
164         void load_assets(ArrayList<Indexable*> *new_assets,
165                 double position,
166                 int load_mode,
167                 Track *first_track /* = 0 */,
168                 RecordLabels *labels /* = 0 */,
169                 int edit_labels,
170                 int edit_plugins,
171                 int edit_autos,
172                 int overwrite);
173         int paste_edls(ArrayList<EDL*> *new_edls,
174                 int load_mode,
175                 Track *first_track /* = 0 */,
176                 double current_position /* = -1 */,
177                 int edit_labels,
178                 int edit_plugins,
179                 int edit_autos,
180                 int overwrite);
181 // Reset everything for a load
182         void update_project(int load_mode);
183 // Fit selected time to horizontal display range
184         void fit_selection();
185 // Fit selected autos to the vertical display range
186         void fit_autos(int doall);
187         void change_currentautorange(int autogrouptype, int increment, int changemax);
188         void expand_autos(int changeall, int domin, int domax);
189         void shrink_autos(int changeall, int domin, int domax);
190 // move the window to include the cursor
191         void find_cursor();
192 // Search plugindb and put results in argument
193         static void search_plugindb(int do_audio,
194                 int do_video,
195                 int is_realtime,
196                 int is_transition,
197                 int is_theme,
198                 ArrayList<PluginServer*> &results);
199 // Find the plugin whose title matches title and return it
200         static PluginServer* scan_plugindb(char *title,
201                 int data_type);
202         static int plugin_exists(const char *plugin_path, ArrayList<PluginServer*> &plugins);
203         static int plugin_exists(char *plugin_path);
204         void dump_plugindb(FILE *fp);
205         void stop_playback(int wait);
206
207         void queue_mixers(EDL *edl, int command, int wait_tracking,
208                 int use_inout, int update_refresh, int toggle_audio);
209         void refresh_mixers();
210         void stop_mixers();
211         void close_mixers();
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
254 // seek to labels
255 // shift_down must be passed by the caller because different windows call
256 // into this
257         int next_label(int shift_down);
258         int prev_label(int shift_down);
259 // seek to edit handles
260         int next_edit_handle(int shift_down);
261         int prev_edit_handle(int shift_down);
262 // seek to keyframes
263         int nearest_plugin_keyframe(int shift_down, int dir);
264 // offset is pixels to add to track_start
265         void trackmovement(int offset, int pane_number);
266 // view_start is pixels
267         int samplemovement(int64_t view_start, int pane_number);
268         void select_all();
269         int goto_start();
270         int goto_end();
271         int goto_position(double position);
272         int expand_y();
273         int zoom_in_y();
274         int expand_t();
275         int zoom_in_t();
276         void split_x();
277         void split_y();
278         void crop_video();
279         void update_plugins();
280 // Call after every edit operation
281         void save_backup();
282         void load_backup();
283         void show_plugin(Plugin *plugin);
284         void hide_plugin(Plugin *plugin, int lock);
285         void hide_plugins();
286         void delete_plugin(PluginServer *plugin);
287 // Update plugins with configuration changes.
288 // Called by TrackCanvas::cursor_motion_event.
289         void update_plugin_guis(int do_keyframe_guis = 1);
290         void update_plugin_states();
291         void update_plugin_titles();
292 // Called by Attachmentpoint during playback.
293 // Searches for matching plugin and renders data in it.
294         void render_plugin_gui(void *data, Plugin *plugin);
295         void render_plugin_gui(void *data, int size, Plugin *plugin);
296
297 // Called from PluginVClient::process_buffer
298 // Returns 1 if a GUI for the plugin is open so OpenGL routines can determine if
299 // they can run.
300         int plugin_gui_open(Plugin *plugin);
301
302         void show_keyframe_gui(Plugin *plugin);
303         void hide_keyframe_guis();
304         void hide_keyframe_gui(Plugin *plugin);
305         void update_keyframe_guis();
306
307
308 // ============================= editing commands ========================
309
310 // Map each recordable audio track to the desired pattern
311         void map_audio(int pattern);
312         void remap_audio(int pattern);
313         enum
314         {
315                 AUDIO_5_1_TO_2,
316                 AUDIO_1_TO_1
317         };
318         void add_audio_track_entry(int above, Track *dst);
319         int add_audio_track(int above, Track *dst);
320         void add_clip_to_edl(EDL *edl);
321         void add_video_track_entry(Track *dst = 0);
322         int add_video_track(int above, Track *dst);
323         void add_subttl_track_entry(Track *dst = 0);
324         int add_subttl_track(int above, Track *dst);
325
326         void asset_to_all();
327         void asset_to_size();
328         void asset_to_rate();
329 // Entry point for clear operations.
330         void clear_entry();
331 // Clears active region in EDL.
332 // If clear_handle, edit boundaries are cleared if the range is 0.
333 // Called by paste, record, menueffects, render, and CWindow drop.
334         void clear(int clear_handle);
335         void clear_labels();
336         int clear_labels(double start, double end);
337         void concatenate_tracks();
338         void copy();
339         int copy(double start, double end);
340         void cut();
341         void blade(double position);
342         void cut(double start, double end, double new_position=-1);
343 // snap off edit from current position to handle/label
344         void snap_left_edit();
345         void snap_right_edit();
346         void snap_left_label();
347         void snap_right_label();
348
349 // Calculate aspect ratio from pixel counts
350         static int create_aspect_ratio(float &w, float &h, int width, int height);
351 // Calculate defaults path
352         static void create_defaults_path(char *string, const char *config_file);
353
354         void delete_folder(char *folder);
355         void delete_inpoint();
356         void delete_outpoint();
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);
420         void overwrite(EDL *source);
421 // For clipboard commands
422         void paste();
423 // For splice and overwrite
424         int paste(double start,
425                 double end,
426                 FileXML *file,
427                 int edit_labels,
428                 int edit_plugins,
429                 int edit_autos);
430         int paste_output(int64_t startproject,
431                                 int64_t endproject,
432                                 int64_t startsource_sample,
433                                 int64_t endsource_sample,
434                                 int64_t startsource_frame,
435                                 int64_t endsource_frame,
436                                 Asset *asset,
437                                 RecordLabels *new_labels);
438         void paste_silence();
439
440 // Detach single transition
441         void detach_transition(Transition *transition);
442 // Detach all transitions in selection
443         void detach_transitions();
444 // Attach dragged transition
445         void paste_transition();
446 // Attach transition to all edits in selection
447         void paste_transitions(int track_type, char *title);
448 // Attach transition dragged onto CWindow
449         void paste_transition_cwindow(Track *dest_track);
450 // Attach default transition to single edit
451         void paste_audio_transition();
452         void paste_video_transition();
453         void shuffle_edits();
454         void reverse_edits();
455         void align_edits();
456         void set_edit_length(double length);
457 // Set length of single transition
458         void set_transition_length(Transition *transition, double length);
459 // Set length in seconds of all transitions in active range
460         void set_transition_length(double length);
461
462         void remove_indexfile(Indexable *indexable);
463         void rebuild_indices();
464 // Asset removal from caches
465         void reset_caches();
466         void remove_asset_from_caches(Asset *asset);
467         void remove_assets_from_project(int push_undo /* = 0 */,
468                 int redraw /* 1 */,
469                 ArrayList<Indexable*> *drag_assets /* mwindow->session->drag_assets */,
470                 ArrayList<EDL*> *drag_clips /* mwindow->session->drag_clips */);
471         void remove_assets_from_disk();
472         void resize_track(Track *track, int w, int h);
473
474         void set_automation_mode(int mode);
475         void set_keyframe_type(int mode);
476         void set_auto_keyframes(int value, int lock_mwindow, int lock_cwindow);
477         void set_auto_visibility(Autos *autos, int value);
478         void set_labels_follow_edits(int value);
479
480 // Update the editing mode
481         int set_editing_mode(int new_editing_mode, int lock_mwindow, int lock_cwindow);
482         void toggle_editing_mode();
483         void set_inpoint(int is_mwindow);
484         void set_outpoint(int is_mwindow);
485         void splice(EDL *source);
486         void toggle_loop_playback();
487         void trim_selection();
488 // Synchronize EDL settings with all playback engines depending on current
489 // operation.  Doesn't redraw anything.
490         void sync_parameters(int change_type = CHANGE_PARAMS);
491         void save_clip(EDL *new_edl, const char *txt);
492         void to_clip(EDL *edl, const char *txt);
493         int toggle_label(int is_mwindow);
494         void undo_entry(BC_WindowBase *calling_window_gui);
495         void redo_entry(BC_WindowBase *calling_window_gui);
496
497
498         int cut_automation();
499         int copy_automation();
500         int paste_automation();
501         void clear_automation();
502         int cut_default_keyframe();
503         int copy_default_keyframe();
504 // Use paste_automation to paste the default keyframe in other position.
505 // Use paste_default_keyframe to replace the default keyframe with whatever is
506 // in the clipboard.
507         int paste_default_keyframe();
508         int clear_default_keyframe();
509
510         FloatAuto* get_float_auto(PatchGUI *patch,int idx);
511         IntAuto* get_int_auto(PatchGUI *patch,int idx);
512         PanAuto* get_pan_auto(PatchGUI *patch);
513         PatchGUI *get_patchgui(Track *track);
514
515         int modify_edithandles();
516         int modify_pluginhandles();
517         void finish_modify_handles();
518         void set_proxy(int use_scaler, int new_scale, int auto_scale,
519                 ArrayList<Indexable*> *orig_assets,
520                 ArrayList<Indexable*> *proxy_assets);
521         void add_proxy(int use_scaler,
522                 ArrayList<Indexable*> *orig_assets,
523                 ArrayList<Indexable*> *proxy_assets);
524         void render_proxy(ArrayList<Indexable *> &new_idxbls);
525
526         void dump_plugins(FILE *fp=stdout);
527         void dump_edl(FILE *fp=stdout);
528         void dump_undo(FILE *fp=stdout);
529         void dump_exe(FILE *fp=stdout);
530         static void trap_hook(FILE *fp, void *vp);
531
532         void reset_android_remote();
533
534 // Send new EDL to caches
535         void age_caches();
536         int optimize_assets();            // delete unused assets from the cache and assets
537
538         void select_point(double position);
539         int set_loop_boundaries();         // toggle loop playback and set boundaries for loop playback
540
541
542         Playback3D *playback_3d;
543         SplashGUI *splash_window;
544
545 // Main undo stack
546         MainUndo *undo;
547         BC_Hash *defaults;
548         Assets *assets;
549 // CICaches for drawing timeline only
550         CICache *audio_cache, *video_cache;
551 // Frame cache for drawing timeline only.
552 // Cache drawing doesn't wait for file decoding.
553         FrameCache *frame_cache;
554         WaveCache *wave_cache;
555         Preferences *preferences;
556         PreferencesThread *preferences_thread;
557         MainSession *session;
558         Theme *theme;
559         MainIndexes *mainindexes;
560         MainProgress *mainprogress;
561         BRender *brender;
562         char cin_lang[4];
563         int brender_active;
564         const char *default_standard;
565         static Commercials *commercials;
566         int commercial_active;
567         int has_commercials();
568
569 // Menu items
570         ArrayList<ColormodelItem*> colormodels;
571         ArrayList<InterlacemodeItem*>          interlace_project_modes;
572         ArrayList<InterlacemodeItem*>          interlace_asset_modes;
573         ArrayList<InterlacefixmethodItem*>     interlace_asset_fixmethods;
574
575         int reset_meters();
576         void resync_guis();
577
578         int select_asset(Asset *asset, int vstream, int astream, int delete_tracks);
579         int select_asset(int vtrack, int delete_tracks);
580
581 // Channel DB for playback only.  Record channel DB's are in record.C
582         ChannelDB *channeldb_buz;
583         ChannelDB *channeldb_v4l2jpeg;
584
585 // ====================================== plugins ==============================
586
587 // Contains file descriptors for all the dlopens
588         static ArrayList<PluginServer*> *plugindb;
589 // Currently visible plugins
590         int64_t plugin_visibility;
591         ArrayList<PluginServer*> *plugin_guis;
592 // GUI Plugins to delete
593         ArrayList<PluginServer*> *dead_plugins;
594 // Keyframe editors
595         ArrayList<KeyFrameThread*> *keyframe_threads;
596
597 // Adjust sample position to line up with frames.
598         int fix_timing(int64_t &samples_out,
599                 int64_t &frames_out,
600                 int64_t samples_in);
601
602
603         CreateBD_Thread *create_bd;
604         CreateDVD_Thread *create_dvd;
605         BatchRenderThread *batch_render;
606         Render *render;
607
608         ExportEDL *exportedl;
609
610
611 // Master edl
612         EDL *edl;
613 // Main Window GUI
614         MWindowGUI *gui;
615 // Compositor
616         CWindow *cwindow;
617 // Viewer
618         Mutex *vwindows_lock;
619         ArrayList<VWindow*> vwindows;
620 // Mixer
621         Mutex *zwindows_lock;
622         ArrayList<ZWindow*> zwindows;
623 // Asset manager
624         AWindow *awindow;
625 // Automation window
626         GWindow *gwindow;
627 // Tip of the day
628         TipWindow *twindow;
629 // Warning window
630         WWindow *wwindow;
631         void show_warning(int *do_warning, const char *text);
632         int wait_warning();
633 // Levels
634         LevelWindow *lwindow;
635         Mutex *run_lock;
636 // Lock during creation and destruction of GUI
637         Mutex *plugin_gui_lock;
638         Mutex *dead_plugin_lock;
639         Mutex *keyframe_gui_lock;
640 // Lock during creation and destruction of brender so playback doesn't use it.
641         Mutex *brender_lock;
642
643 // Initialize shared memory
644         void init_shm();
645
646 // Initialize channel DB's for playback
647         void init_channeldb();
648         void init_render();
649         void init_exportedl();
650 // These three happen synchronously with each other
651 // Make sure this is called after synchronizing EDL's.
652         void init_brender();
653 // Restart brender after testing its existence
654         void restart_brender();
655 // Stops brender after testing its existence
656         void stop_brender();
657 // This one happens asynchronously of the others.  Used by playback to
658 // see what frame is background rendered.
659         int brender_available(int position);
660         void set_brender_active(int v, int update=1);
661         int put_commercial();
662         void activate_commercial() { commercial_active = 1; }
663         void commit_commercial();
664         void undo_commercial();
665         void cut_commercials();
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                 const char *index_path, 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, const char *index_path,
695                 const char *plugin_dir);
696         static PluginServer* new_ffmpeg_server(MWindow *mwindow, const char *name);
697         void init_preferences();
698         void init_signals();
699         void init_theme();
700         void init_compositor();
701         void init_levelwindow();
702 // Called when creating a new viewer to view footage
703         VWindow* get_viewer(int start_it, int idx=-1);
704         void init_cache();
705         void init_menus();
706         void init_indexes();
707         void init_gui();
708         void init_3d();
709         void init_playbackcursor();
710         void init_commercials();
711         static void add_plugins(ArrayList<PluginServer*> &plugins);
712         static void delete_plugins();
713 //
714         void clean_indexes();
715 //      TimeBomb timebomb;
716         SigHandler *sighandler;
717         int restart_status;
718         int screens;
719         int in_destructor;
720 };
721
722 #endif