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