3 * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
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.
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.
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
27 #include "apatchgui.h"
28 #include "arraylist.h"
31 #include "audiodevice.inc"
33 #include "awindow.inc"
34 #include "batchrender.inc"
35 #include "bcwindowbase.inc"
36 #include "bdcreate.inc"
37 #include "brender.inc"
39 #include "channel.inc"
40 #include "channeldb.inc"
41 #include "commercials.inc"
42 #include "convert.inc"
43 #include "cwindow.inc"
45 #include "devicedvbinput.inc"
46 #include "devicempeginput.inc"
47 #include "dvdcreate.inc"
50 #include "edlsession.inc"
51 #include "exportedl.inc"
52 #include "filesystem.inc"
53 #include "filexml.inc"
54 #include "framecache.inc"
55 #include "gwindow.inc"
56 #include "indexable.inc"
57 #include "keyframegui.inc"
58 #include "levelwindow.inc"
59 #include "loadmode.inc"
60 #include "mainerror.inc"
61 #include "mainindexes.inc"
62 #include "mainprogress.inc"
63 #include "mainsession.inc"
64 #include "mainundo.inc"
65 #include "maxchannels.h"
66 #include "mixersalign.inc"
68 #include "mwindow.inc"
69 #include "mwindowgui.inc"
71 #include "patchbay.inc"
72 #include "playback3d.inc"
73 #include "playbackengine.inc"
75 #include "pluginclient.inc"
76 #include "pluginfclient.inc"
77 #include "pluginserver.inc"
78 #include "pluginset.inc"
79 #include "preferences.inc"
80 #include "preferencesthread.inc"
83 #include "recordlabel.inc"
85 #include "sharedlocation.inc"
86 #include "sighandler.inc"
87 #include "splashgui.inc"
88 #include "shuttle.inc"
91 #include "threadloader.inc"
92 #include "timebar.inc"
93 #include "tipwindow.inc"
95 #include "tracking.inc"
97 #include "transition.inc"
98 #include "transportque.inc"
99 #include "videowindow.inc"
100 #include "vpatchgui.h"
101 #include "vwindow.inc"
102 #include "zwindow.inc"
103 #include "wwindow.inc"
104 #include "wavecache.inc"
108 #define FONT_SEARCHPATH "fonts"
121 class Stack : public ArrayList<StackItem>
127 #define BEEP_SAMPLE_RATE 48000
129 class Beeper : public Thread
132 typedef int16_t audio_data_t;
133 Beeper(MWindow *mwindow);
139 void tone(double freq, double secs, double gain);
142 double freq, secs, gain;
144 int playing_audio, interrupted;
149 class DrawTrackMovement : public Thread
152 DrawTrackMovement(MWindow *mwindow);
153 ~DrawTrackMovement();
159 class ConfirmRefWindow : public BC_Window
162 ConfirmRefWindow(MWindow *mwindow, char *path,
163 int px, int py, int cw, int ch);
165 void create_objects();
172 class MWindow : public Thread
178 // ======================================== initialization commands
179 void create_objects(int want_gui,
188 int run_script(FileXML *script);
190 int delete_project(int flash = 1);
192 int restart() { return restart_status; }
196 int set_filename(const char *filename);
197 int set_titlebar(const char *filename);
198 // Total vertical pixels in timeline
199 int get_tracks_height();
200 // Total horizontal pixels in timeline
201 int get_tracks_width();
203 void stack_push(EDL *edl, Indexable *idxbl);
205 int save(EDL *edl, char *filename, int stat);
206 int save(int save_as);
208 void clip_to_media();
209 void media_to_clip();
210 int create_ref(Asset *asset, EDL *ref);
212 void show_vwindow(int raise);
218 void restore_windows();
219 void load_layout(const char *layout);
220 void save_layout(const char *layout);
221 void delete_layout(const char *layout);
222 int tile_windows(int window_config);
223 char *get_cwindow_display();
224 void set_screens(int value);
225 int asset_to_edl(EDL *new_edl,
227 RecordLabels *labels = 0);
229 // Entry point to insert assets and insert edls. Called by TrackCanvas
230 // and AssetPopup when assets are dragged in from AWindow.
231 // Takes the drag vectors from MainSession and
232 // pastes either assets or clips depending on which is full.
233 // Returns 1 if the vectors were full
234 int paste_assets(double position, Track *dest_track, int overwrite);
236 // Insert the assets at a point in the EDL. Called by menueffects,
237 // render, and CWindow drop but recording calls paste_edls directly for
239 void load_assets(ArrayList<Indexable*> *new_assets,
242 Track *first_track /* = 0 */,
243 RecordLabels *labels /* = 0 */,
248 int paste_edls(ArrayList<EDL*> *new_edls,
250 Track *first_track /* = 0 */,
251 double current_position /* = -1 */,
256 void collect_effects();
257 void paste_effects();
259 // Reset everything for a load
260 void update_project(int load_mode);
261 void update_preferences(Preferences *prefs);
262 void update_vwindow();
263 // Fit selected time to horizontal display range
264 void fit_selection();
265 // Fit selected autos to the vertical display range
266 void fit_autos(int all);
267 void change_currentautorange(int autogrouptype, int increment, int changemax);
268 void update_autorange(int type, int increment, int use_max);
269 void expand_autos(int changeall, int domin, int domax);
270 void shrink_autos(int changeall, int domin, int domax);
271 // move the window to include the cursor
273 // Search plugindb and put results in argument
274 static void search_plugindb(int do_audio,
279 ArrayList<PluginServer*> &results);
280 // Find the plugin whose title matches title and return it
281 static PluginServer* scan_plugindb(char *title,
283 static void fix_plugin_title(char *title);
284 static int plugin_exists(const char *plugin_path, ArrayList<PluginServer*> &plugins);
285 static int plugin_exists(char *plugin_path);
286 void dump_plugindb(FILE *fp);
287 void stop_playback(int wait);
288 void stop_transport();
289 void undo_before(const char *description = "", void *creator = 0);
290 void undo_after(const char *description, uint32_t load_flags, int changes_made = 1);
292 void handle_mixers(EDL *edl, int command, int wait_tracking,
293 int use_inout, int toggle_audio, int loop_play, float speed);
294 ZWindow *create_mixer(Indexable *indexable, double position);
295 void create_mixers(double position = 0);
296 void refresh_mixers(int dir=1);
298 void close_mixers(int result=1);
300 ZWindow *get_mixer(Mixer *&mixer);
301 ZWindow *get_mixer(int idx);
302 void close_mixer(ZWindow *zwindow);
303 int mixer_track_active(Track *track);
304 void update_mixer_tracks();
306 int select_zwindow(ZWindow *zwindow);
308 void tile_mixers(int x1, int x2, int y1, int y2);
309 int masters_to_mixers();
311 void set_gang_tracks(int v);
312 int load_filenames(ArrayList<char*> *filenames,
313 int load_mode = LOADMODE_REPLACE,
314 int edl_mode = LOADMODE_EDL_CLIP,
315 // Cause the project filename on the top of the window to be updated.
316 // Not wanted for loading backups.
317 int update_filename = 1);
319 // Print out plugins which are referenced in the EDL but not loaded.
320 void test_plugins(EDL *new_edl, const char *path);
322 int interrupt_indexes(); // Stop index building
324 int redraw_time_dependancies(); // after reconfiguring the time format, sample rate, frame rate
325 void draw_trackmovement(); // after reconfiguring tracks/patchbay guis
326 DrawTrackMovement *redraw_tracks;
328 // =========================================== movement
330 void next_time_format();
331 void prev_time_format();
332 void time_format_common();
333 int reposition_timebar(int new_pixel, int new_height);
335 int zoom_in_sample();
336 int zoom_sample(int64_t zoom_sample);
337 void zoom_autos(float min, float max);
338 void zoom_amp(int64_t zoom_amp);
339 void zoom_atrack(int64_t zoom);
340 void zoom_vtrack(int64_t zoom);
342 int move_left(int64_t distance = 0);
343 int move_right(int64_t distance = 0);
344 void move_up(int64_t distance = 0);
345 void move_down(int64_t distance = 0);
346 int find_selection(double position, int scroll_display = 0);
347 void toggle_camera_xyz();
348 void toggle_projector_xyz();
349 double get_position();
350 void set_position(double position);
351 double get_timecode_offset();
352 void set_timecode_offset(double offset);
353 void align_timecodes();
356 // shift_down must be passed by the caller because different windows call
358 int next_label(int shift_down);
359 int prev_label(int shift_down);
360 // seek to edit handles
361 int next_edit_handle(int shift_down);
362 int prev_edit_handle(int shift_down);
364 int nearest_plugin_keyframe(int shift_down, int dir);
365 int nearest_auto_keyframe(int shift_down, int dir);
366 // offset is pixels to add to track_start
367 void trackmovement(int offset, int pane_number);
368 // view_start is pixels
369 int samplemovement(int64_t view_start, int pane_number);
373 int goto_position(double position);
380 void crop_video(int mode);
381 void update_plugins();
382 void get_backup_path(char *path, int len);
383 // Call after every edit operation
386 void show_plugin(Plugin *plugin);
387 void hide_plugin(Plugin *plugin, int lock);
388 void hide_plugin(int plugin_id, int lock);
390 void delete_plugin(PluginServer *plugin);
391 // Update plugins with configuration changes.
392 // Called by TrackCanvas::cursor_motion_event.
393 void update_plugin_guis(int do_keyframe_guis = 1);
394 void update_plugin_states();
395 void update_plugin_titles();
396 // Called by Attachmentpoint during playback.
397 // Searches for matching plugin and renders data in it.
398 void render_plugin_gui(void *data, Plugin *plugin);
399 void render_plugin_gui(void *data, int size, Plugin *plugin);
400 void reset_plugin_gui_frames(Plugin *plugin);
401 void render_plugin_gui_frames(PluginClientFrames *frames, Plugin *plugin);
402 double get_tracking_position();
403 int get_tracking_direction();
405 // Called from PluginVClient::process_buffer
406 // Returns 1 if a GUI for the plugin is open so OpenGL routines can determine if
408 int plugin_gui_open(Plugin *plugin);
409 void stop_plugin_guis();
411 void show_keyframe_gui(Plugin *plugin);
412 void hide_keyframe_guis();
413 void hide_keyframe_gui(Plugin *plugin);
414 void update_keyframe_guis();
415 int get_hash_color(Edit *edit);
416 int get_hash_color(int v);
417 int get_group_color(int v);
418 int get_title_color(Edit *edit);
420 // ============================= editing commands ========================
422 // Map each recordable audio track to the desired pattern
423 void map_audio(int pattern);
424 void remap_audio(int pattern);
430 void add_clip_to_edl(EDL *edl);
431 void add_audio_track_entry(int above, Track *dst);
432 Track *add_audio_track(int above, Track *dst);
433 void add_video_track_entry(int above, Track *dst);
434 Track *add_video_track(int above, Track *dst);
435 void add_subttl_track_entry(int above, Track *dst);
436 Track *add_subttl_track(int above, Track *dst);
439 void asset_to_size();
440 void asset_to_rate();
441 // Entry point for clear operations.
443 // Clears active region in EDL.
444 // If clear_handle, edit boundaries are cleared if the range is 0.
445 // Called by paste, record, menueffects, render, and CWindow drop.
446 void clear(int clear_handle);
448 int clear_labels(double start, double end);
449 void clear_hard_edges();
450 int clear_hard_edges(double start, double end);
452 void select_edits(int v);
453 void concatenate_tracks();
454 int copy_flags(int copy_flags=COPY_CLIPBOARD);
456 int copy(double start, double end);
458 void blade(double position);
459 void cut(double start, double end, double new_position=-1);
460 // cut edit from current position to handle/label
461 void cut_left_edit();
462 void cut_right_edit();
463 void cut_left_label();
464 void cut_right_label();
466 // Calculate aspect ratio from pixel counts
467 static int create_aspect_ratio(float &w, float &h, int width, int height);
468 // Calculate defaults path
469 static void create_defaults_path(char *string, const char *config_file);
471 void delete_track(Track *track);
472 void delete_tracks();
473 int feather_edits(int64_t feather_samples, int audio, int video);
474 int64_t get_feather(int audio, int video);
475 float get_aspect_ratio();
476 void insert(double position, FileXML *file,
477 int edit_labels, int edit_plugins, int edit_autos,
478 EDL *parent_edl, Track *first_track, int overwrite);
480 // TrackCanvas calls this to insert multiple effects from the drag_pluginservers
481 // into pluginset_highlighted.
482 void insert_effects_canvas(Track *dest_track, double start, double length);
484 // CWindow calls this to insert multiple effects from
485 // the drag_pluginservers array.
486 void insert_effects_cwindow(Track *dest_track);
488 // Attach new effect to all recordable tracks
489 // single_standalone - attach 1 standalone on the first track and share it with
491 void insert_effect(char *title,
492 SharedLocation *shared_location,
493 int data_type, int plugin_type, int single_standalone);
495 // This is called multiple times by the above functions.
496 // It can't sync parameters.
497 void insert_effect(char *title,
498 SharedLocation *shared_location,
499 Track *track, PluginSet *plugin_set,
500 double start, double length, int plugin_type);
502 void match_output_size(Track *track);
503 void delete_edit(Edit *edit, const char *msg, int collapse=0);
504 void delete_edits(ArrayList<Edit*> *edits, const char *msg, int collapse=0);
505 void delete_edits(int collapse=0);
506 void cut_selected_edits(int collapse, int packed);
507 // Move edit to new position
508 void move_edits(ArrayList<Edit*> *edits, Track *track, double position,
509 int mode); // mode: 0 - mute and overwrite, 1 - cut and paste
510 void selected_edits_to_clipboard(int packed);
511 void paste_clipboard(Track *first_track, double position, int overwrite,
512 int edit_edits, int edit_labels, int edit_autos, int edit_plugins);
513 void move_group(EDL *group, Track *first_track, double position, int overwrite);
514 // Move effect to position
515 void move_effect(Plugin *plugin, Track *track, int64_t position);
516 void move_effect(Plugin *plugin, PluginSet *plugin_set, int64_t position);
517 void move_plugins_up(PluginSet *plugin_set);
518 void move_plugins_down(PluginSet *plugin_set);
519 void roll_track_down(Track *track);
520 void roll_tracks_down();
521 void roll_track_up(Track *track);
522 void roll_tracks_up();
523 void move_track_down(Track *track);
524 void move_tracks_down();
525 void move_track_up(Track *track);
526 void move_tracks_up();
527 void mute_selection();
528 void new_folder(const char *new_folder, int is_clips);
529 void delete_folder(char *folder);
530 // For clipboard commands
532 void paste(double start, Track *first_track, int clear_selection, int overwrite);
533 // For splice and overwrite
534 void overwrite(EDL *source, int all);
535 void splice(EDL *source, int all);
536 int paste(double start, double end, FileXML *file,
537 int edit_labels, int edit_plugins, int edit_autos,
538 Track *first_track, int overwrite);
539 int paste_output(int64_t startproject, int64_t endproject,
540 int64_t startsource_sample, int64_t endsource_sample,
541 int64_t startsource_frame, int64_t endsource_frame,
542 Asset *asset, RecordLabels *new_labels);
543 void paste_silence();
545 // Detach single transition
546 void detach_transition(Transition *transition);
547 // Detach all transitions in selection
548 void detach_transitions();
549 // Attach dragged transition
550 void paste_transition();
551 // Attach transition to all edits in selection
552 void paste_transitions(int track_type, char *title);
553 // Attach transition dragged onto CWindow
554 void paste_transition_cwindow(Track *dest_track);
555 // Attach default transition to single edit
556 void paste_audio_transition();
557 void paste_video_transition();
558 void shuffle_edits();
559 void reverse_edits();
561 void set_edit_length(double length);
562 // Set length of single transition
563 void set_transition_length(Transition *transition, double length);
564 // Set length in seconds of all transitions in active range
565 void set_transition_length(double length);
567 void remove_indexfile(Indexable *indexable);
568 void rebuild_indices();
569 // Asset removal from caches
570 void reset_caches(int locked);
571 void remove_from_caches(Indexable *idxbl);
572 void remove_assets_from_project(int push_undo, int redraw, int delete_indexes,
573 ArrayList<Indexable*> *drag_assets /* mwindow->session->drag_assets */,
574 ArrayList<EDL*> *drag_clips /* mwindow->session->drag_clips */);
575 void remove_assets_from_disk();
576 void resize_track(Track *track, int w, int h);
578 void set_automation_mode(int mode);
579 void set_keyframe_type(int mode);
580 void set_auto_keyframes(int value);
581 void set_span_keyframes(int value);
582 void set_auto_visibility(Autos *autos, int value);
583 void set_labels_follow_edits(int value);
585 // Update the editing mode
586 int set_editing_mode(int new_editing_mode);
587 void toggle_editing_mode();
590 void unset_inoutpoint();
591 void toggle_loop_playback();
592 void trim_selection();
593 // Synchronize EDL settings with all playback engines depending on current
594 // operation. Doesn't redraw anything.
595 void sync_parameters(int change_type = CHANGE_PARAMS);
596 void save_clip(EDL *new_edl, const char *txt);
597 void to_clip(EDL *edl, const char *txt, int all);
599 void undo_entry(BC_WindowBase *calling_window_gui);
600 void redo_entry(BC_WindowBase *calling_window_gui);
601 void save_undo_data();
602 void load_undo_data();
603 void remove_undo_data();
604 int copy_target(const char *path, const char *target);
605 int link_target(const char *real_path, const char *link_path, int relative);
606 void save_project(const char *dir, int save_mode, int overwrite, int reload);
608 int cut_automation();
609 int copy_automation();
610 int paste_automation();
611 void clear_automation();
612 int cut_default_keyframe();
613 int copy_default_keyframe();
614 // Use paste_automation to paste the default keyframe in other position.
615 // Use paste_default_keyframe to replace the default keyframe with whatever is
617 int paste_default_keyframe();
618 int clear_default_keyframe();
619 void create_keyframes(int mask, int mode);
621 FloatAuto* get_float_auto(PatchGUI *patch,int idx);
622 IntAuto* get_int_auto(PatchGUI *patch,int idx);
623 PanAuto* get_pan_auto(PatchGUI *patch);
624 PatchGUI *get_patchgui(Track *track);
626 int modify_edithandles();
627 int modify_pluginhandles();
628 int modify_transnhandles();
629 void finish_modify_handles();
630 void rescale_proxy(EDL *clip, int orig_scale, int new_scale);
631 void add_proxy(ArrayList<Indexable*> *orig_assets,
632 ArrayList<Indexable*> *proxy_assets);
633 int render_proxy(ArrayList<Indexable *> &new_idxbls);
634 void beep(double freq, double secs, double gain);
637 int to_proxy(Asset *asset, int new_scale, int new_use_scaler);
640 void dump_plugins(FILE *fp=stdout);
641 void dump_edl(FILE *fp=stdout);
642 void dump_undo(FILE *fp=stdout);
643 void dump_exe(FILE *fp=stdout);
644 void dump_caches(FILE *fp=stdout);
645 static void trap_hook(FILE *fp, void *vp);
647 void reset_android_remote();
649 // Send new EDL to caches
651 int optimize_assets(); // delete unused assets from the cache and assets
652 // render edl assets to specified format, then replace in edl
653 void start_convert(Asset *format_asset, const char *suffix,
654 float beep, int to_proxy, int remove_originals);
655 void finish_convert(int remove_originals);
656 ConvertRender *convert_render;
658 void select_point(double position);
659 int set_loop_boundaries(); // toggle loop playback and set boundaries for loop playback
662 Playback3D *playback_3d;
663 SplashGUI *splash_window;
673 // CICaches for drawing timeline only
674 CICache *audio_cache, *video_cache;
675 // Frame cache for drawing timeline only.
676 // Cache drawing doesn't wait for file decoding.
677 FrameCache *frame_cache;
678 WaveCache *wave_cache;
679 Preferences *preferences;
680 PreferencesThread *preferences_thread;
681 MainSession *session;
683 MainIndexes *mainindexes;
684 MainProgress *mainprogress;
688 const char *default_standard;
689 static Commercials *commercials;
690 int commercial_active;
691 int has_commercials();
692 // copy of edl created in speed_before, used in speed_after to normalize_speed
696 ArrayList<ColormodelItem*> colormodels;
697 ArrayList<InterlacemodeItem*> interlace_project_modes;
698 ArrayList<InterlacemodeItem*> interlace_asset_modes;
703 int select_asset(Asset *asset, int vstream, int astream, int delete_tracks);
704 int select_asset(int vtrack, int delete_tracks);
706 // Channel DB for playback only. Record channel DB's are in record.C
707 ChannelDB *channeldb_buz;
708 ChannelDB *channeldb_v4l2jpeg;
710 // ====================================== plugins ==============================
712 // Contains file descriptors for all the dlopens
713 static ArrayList<PluginServer*> *plugindb;
714 // Currently visible plugins
715 int64_t plugin_visibility;
716 PluginGUIs *plugin_guis;
717 // GUI Plugins to delete
718 ArrayList<PluginServer*> *dead_plugins;
720 ArrayList<KeyFrameThread*> *keyframe_threads;
722 // Adjust sample position to line up with frames.
723 int fix_timing(int64_t &samples_out,
728 CreateBD_Thread *create_bd;
729 CreateDVD_Thread *create_dvd;
730 BatchRenderThread *batch_render;
733 ExportEDL *exportedl;
743 Mutex *vwindows_lock;
744 ArrayList<VWindow*> vwindows;
746 Mutex *zwindows_lock;
747 ArrayList<ZWindow*> zwindows;
748 MixersAlign *mixers_align;
758 void show_warning(int *do_warning, const char *text);
761 LevelWindow *lwindow;
763 // Lock during creation and destruction of GUI
764 Mutex *plugin_gui_lock;
765 Mutex *dead_plugin_lock;
766 Mutex *keyframe_gui_lock;
767 // Lock during creation and destruction of brender so playback doesn't use it.
769 // Initialize shared memory
770 void init_shm(const char *pfn, int64_t min);
771 // Initialize channel DB's for playback
772 void init_channeldb();
774 void init_exportedl();
775 // These three happen synchronously with each other
776 // Make sure this is called after synchronizing EDL's.
778 // Restart brender after testing its existence
779 void restart_brender();
780 // Stops brender after testing its existence
782 // This one happens asynchronously of the others. Used by playback to
783 // see what frame is background rendered.
784 int brender_available(int position);
785 void set_brender_active(int v, int update=1);
786 int put_commercial();
787 void activate_commercial() { commercial_active = 1; }
788 void commit_commercial();
789 void undo_commercial();
790 void cut_commercials();
791 void update_gui(int changed_edl);
792 int paste_subtitle_text(char *text, double start, double end);
796 static void init_defaults(BC_Hash* &defaults, char *config_path);
797 void check_language();
798 const char *default_std();
799 void fill_preset_defaults(const char *preset, EDLSession *session);
800 const char *get_preset_name(int index);
804 void init_tipwindow();
805 // Used by MWindow and RenderFarmClient
806 static void get_plugin_path(char *path, const char *plug_dir, const char *fs_path);
807 static int init_plugins(MWindow *mwindow, Preferences *preferences);
808 static int init_ladspa_plugins(MWindow *mwindow, Preferences *preferences);
809 static void init_plugin_tips(ArrayList<PluginServer*> &plugins, const char *lang);
810 static int check_plugin_index(ArrayList<PluginServer*> &plugins,
811 const char *plug_dir, const char *plug_path);
812 static void init_plugin_index(MWindow *mwindow, Preferences *preferences,
813 FILE *fp, const char *plugin_dir);
814 static int init_ladspa_index(MWindow *mwindow, Preferences *preferences,
815 FILE *fp, const char *plugin_dir);
816 static void scan_plugin_index(MWindow *mwindow, Preferences *preferences,
817 FILE *fp, const char *plug_dir, const char *plug_path, int &idx);
818 static void init_ffmpeg();
819 static void init_ffmpeg_index(MWindow *mwindow, Preferences *preferences, FILE *fp);
820 static int load_plugin_index(MWindow *mwindow, FILE *fp, const char *plugin_dir);
821 static PluginServer *new_ffmpeg_server(MWindow *mwindow, const char *name);
822 static int init_lv2_index(MWindow *mwindow, Preferences *preferences, FILE *fp);
823 static PluginServer *new_lv2_server(MWindow *mwindow, const char *name);
824 static void remove_plugin_index();
826 void init_preferences();
832 void init_compositor();
833 void init_levelwindow();
834 // Called when creating a new viewer to view footage
835 VWindow* get_viewer(int start_it, int idx=-1);
841 void init_playbackcursor();
842 void init_commercials();
843 static void add_plugins(ArrayList<PluginServer*> &plugins);
844 static void delete_plugins();
846 int speed_after(int done, int edit_speed);
847 int normalize_speed(EDL *old_edl, EDL *new_edl, int edit_speed);
848 int get_cpus(int out_w, int out_h);
851 void clean_indexes();
852 // TimeBomb timebomb;
853 SigHandler *sighandler;