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