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