3 * Copyright (C) 1997-2014 Adam Williams <broadcast at earthling dot net>
4 * Copyright (C) 2003-2016 Cinelerra CV contributors
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #include "apatchgui.h"
30 #include "arraylist.h"
33 #include "audiodevice.inc"
35 #include "awindow.inc"
36 #include "batchrender.inc"
37 #include "bcwindowbase.inc"
38 #include "bdcreate.inc"
39 #include "brender.inc"
41 #include "channel.inc"
42 #include "channeldb.inc"
43 #include "commercials.inc"
44 #include "convert.inc"
45 #include "cwindow.inc"
47 #include "devicedvbinput.inc"
48 #include "devicempeginput.inc"
49 #include "dvdcreate.inc"
52 #include "edlsession.inc"
53 #include "exportedl.inc"
54 #include "filesystem.inc"
55 #include "filexml.inc"
56 #include "framecache.inc"
57 #include "gwindow.inc"
58 #include "indexable.inc"
59 #include "keyframegui.inc"
60 #include "levelwindow.inc"
61 #include "loadmode.inc"
62 #include "mainerror.inc"
63 #include "mainindexes.inc"
64 #include "mainprogress.inc"
65 #include "mainsession.inc"
66 #include "mainundo.inc"
67 #include "maxchannels.h"
68 #include "mixersalign.inc"
70 #include "mwindow.inc"
71 #include "mwindowgui.inc"
73 #include "patchbay.inc"
74 #include "playback3d.inc"
75 #include "playbackengine.inc"
77 #include "pluginclient.inc"
78 #include "pluginfclient.inc"
79 #include "pluginserver.inc"
80 #include "pluginset.inc"
81 #include "preferences.inc"
82 #include "preferencesthread.inc"
85 #include "recordlabel.inc"
87 #include "sharedlocation.inc"
88 #include "sighandler.inc"
89 #include "splashgui.inc"
90 #include "shuttle.inc"
93 #include "threadloader.inc"
94 #include "timebar.inc"
95 #include "tipwindow.inc"
97 #include "tracking.inc"
99 #include "transition.inc"
100 #include "transportque.inc"
101 #include "videowindow.inc"
102 #include "vpatchgui.h"
103 #include "vwindow.inc"
104 #include "zwindow.inc"
105 #include "wwindow.inc"
106 #include "wavecache.inc"
110 #define FONT_SEARCHPATH "fonts"
123 class Stack : public ArrayList<StackItem>
129 #define BEEP_SAMPLE_RATE 48000
131 class Beeper : public Thread
134 typedef int16_t audio_data_t;
135 Beeper(MWindow *mwindow);
141 void tone(double freq, double secs, double gain);
144 double freq, secs, gain;
146 int playing_audio, interrupted;
151 class DrawTrackMovement : public Thread
154 DrawTrackMovement(MWindow *mwindow);
155 ~DrawTrackMovement();
161 class ConfirmRefWindow : public BC_Window
164 ConfirmRefWindow(MWindow *mwindow, char *path,
165 int px, int py, int cw, int ch);
167 void create_objects();
174 class MWindow : public Thread
180 // ======================================== initialization commands
181 void create_objects(int want_gui,
190 int run_script(FileXML *script);
192 int delete_project(int flash = 1);
194 int restart() { return restart_status; }
198 int set_filename(const char *filename);
199 int set_titlebar(const char *filename);
200 // Total vertical pixels in timeline
201 int get_tracks_height();
202 // Total horizontal pixels in timeline
203 int get_tracks_width();
205 void stack_push(EDL *edl, Indexable *idxbl);
207 int save(EDL *edl, char *filename, int stat);
208 int save(int save_as);
210 void clip_to_media();
211 void media_to_clip();
212 int create_ref(Asset *asset, EDL *ref);
214 void show_vwindow(int raise);
215 void hide_vwindow(int raise);
224 void restore_windows();
225 void load_layout(const char *layout);
226 void save_layout(const char *layout);
227 void delete_layout(const char *layout);
228 int tile_windows(int window_config);
229 char *get_cwindow_display();
230 void set_screens(int value);
231 int asset_to_edl(EDL *new_edl,
233 RecordLabels *labels = 0);
235 // Entry point to insert assets and insert edls. Called by TrackCanvas
236 // and AssetPopup when assets are dragged in from AWindow.
237 // Takes the drag vectors from MainSession and
238 // pastes either assets or clips depending on which is full.
239 // Returns 1 if the vectors were full
240 int paste_assets(double position, Track *dest_track, int overwrite);
242 // Insert the assets at a point in the EDL. Called by menueffects,
243 // render, and CWindow drop but recording calls paste_edls directly for
245 void load_assets(ArrayList<Indexable*> *new_assets,
248 Track *first_track /* = 0 */,
249 RecordLabels *labels /* = 0 */,
254 int paste_edls(ArrayList<EDL*> *new_edls,
256 Track *first_track /* = 0 */,
257 double current_position /* = -1 */,
262 void collect_effects();
263 void paste_effects();
265 // Reset everything for a load
266 void update_project(int load_mode);
267 void update_preferences(Preferences *prefs);
268 void update_vwindow();
269 // Fit selected time to horizontal display range
270 void fit_selection();
271 // Fit selected autos to the vertical display range
272 void fit_autos(int all);
273 void change_currentautorange(int autogrouptype, int increment, int changemax);
274 void update_autorange(int type, int increment, int use_max);
275 void expand_autos(int changeall, int domin, int domax);
276 void shrink_autos(int changeall, int domin, int domax);
277 // move the window to include the cursor
279 // Search plugindb and put results in argument
280 static void search_plugindb(int do_audio,
285 ArrayList<PluginServer*> &results);
286 // Find the plugin whose title matches title and return it
287 static PluginServer* scan_plugindb(char *title,
289 static void fix_plugin_title(char *title);
290 static int plugin_exists(const char *plugin_path, ArrayList<PluginServer*> &plugins);
291 static int plugin_exists(char *plugin_path);
292 void dump_plugindb(FILE *fp);
293 void stop_playback(int wait);
294 void stop_transport();
295 void undo_before(const char *description = "", void *creator = 0);
296 void undo_after(const char *description, uint32_t load_flags, int changes_made = 1);
298 void handle_mixers(EDL *edl, int command, int wait_tracking,
299 int use_inout, int toggle_audio, int loop_play, float speed);
300 ZWindow *create_mixer(Indexable *indexable, double position);
301 void create_mixers(double position = 0);
302 void refresh_mixers(int dir=1);
304 void close_mixers(int result=1);
306 ZWindow *get_mixer(Mixer *&mixer);
307 ZWindow *get_mixer(int idx);
308 void close_mixer(ZWindow *zwindow);
309 int mixer_track_active(Track *track);
310 void update_mixer_tracks();
312 int select_zwindow(ZWindow *zwindow);
314 void tile_mixers(int x1, int x2, int y1, int y2);
315 int masters_to_mixers();
317 void set_gang_tracks(int v);
318 int load_filenames(ArrayList<char*> *filenames,
319 int load_mode = LOADMODE_REPLACE,
320 int edl_mode = LOADMODE_EDL_CLIP,
321 // Cause the project filename on the top of the window to be updated.
322 // Not wanted for loading backups.
323 int update_filename = 1);
325 // Print out plugins which are referenced in the EDL but not loaded.
326 void test_plugins(EDL *new_edl, const char *path);
328 int interrupt_indexes(); // Stop index building
330 int redraw_time_dependancies(); // after reconfiguring the time format, sample rate, frame rate
331 void draw_trackmovement(); // after reconfiguring tracks/patchbay guis
332 DrawTrackMovement *redraw_tracks;
334 // =========================================== movement
336 void next_time_format();
337 void prev_time_format();
338 void time_format_common();
339 int reposition_timebar(int new_pixel, int new_height);
341 int zoom_in_sample();
342 int zoom_sample(int64_t zoom_sample);
343 void zoom_autos(float min, float max);
344 void zoom_amp(int64_t zoom_amp);
345 void zoom_atrack(int64_t zoom);
346 void zoom_vtrack(int64_t zoom);
348 int move_left(int64_t distance = 0);
349 int move_right(int64_t distance = 0);
350 void move_up(int64_t distance = 0);
351 void move_down(int64_t distance = 0);
352 int find_selection(double position, int scroll_display = 0);
353 void toggle_camera_xyz();
354 void toggle_projector_xyz();
355 double get_position();
356 void set_position(double position);
357 double get_timecode_offset();
358 void set_timecode_offset(double offset);
359 void align_timecodes();
362 // shift_down must be passed by the caller because different windows call
364 int next_label(int shift_down);
365 int prev_label(int shift_down);
366 // seek to edit handles
367 int next_edit_handle(int shift_down);
368 int prev_edit_handle(int shift_down);
370 int nearest_plugin_keyframe(int shift_down, int dir);
371 int nearest_auto_keyframe(int shift_down, int dir);
372 // offset is pixels to add to track_start
373 void trackmovement(int offset, int pane_number);
374 // view_start is pixels
375 int samplemovement(int64_t view_start, int pane_number);
379 int goto_position(double position);
386 void crop_video(int mode);
387 void update_plugins();
388 void get_backup_path(char *path, int len);
389 void create_timestamped_copy_from_previous_backup(char *previouspath);
390 // Call after every edit operation
393 void show_plugin(Plugin *plugin);
394 void hide_plugin(Plugin *plugin, int lock);
395 void hide_plugin(int plugin_id, int lock);
397 void delete_plugin(PluginServer *plugin);
398 // Update plugins with configuration changes.
399 // Called by TrackCanvas::cursor_motion_event.
400 void update_plugin_guis(int do_keyframe_guis = 1);
401 void update_plugin_states();
402 void update_plugin_titles();
403 // Called by Attachmentpoint during playback.
404 // Searches for matching plugin and renders data in it.
405 void render_plugin_gui(void *data, Plugin *plugin);
406 void render_plugin_gui(void *data, int size, Plugin *plugin);
407 void reset_plugin_gui_frames(Plugin *plugin);
408 void render_plugin_gui_frames(PluginClientFrames *frames, Plugin *plugin);
409 double get_tracking_position();
410 int get_tracking_direction();
412 // Called from PluginVClient::process_buffer
413 // Returns 1 if a GUI for the plugin is open so OpenGL routines can determine if
415 int plugin_gui_open(Plugin *plugin);
416 void stop_plugin_guis();
418 void show_keyframe_gui(Plugin *plugin);
419 void hide_keyframe_guis();
420 void hide_keyframe_gui(Plugin *plugin);
421 void update_keyframe_guis();
422 int get_hash_color(Edit *edit);
423 int get_hash_color(int v);
424 int get_group_color(int v);
425 int get_title_color(Edit *edit);
427 // ============================= editing commands ========================
429 // Map each recordable audio track to the desired pattern
430 void map_audio(int pattern);
431 void remap_audio(int pattern);
437 void add_clip_to_edl(EDL *edl);
438 void add_audio_track_entry(int above, Track *dst);
439 Track *add_audio_track(int above, Track *dst);
440 void add_video_track_entry(int above, Track *dst);
441 Track *add_video_track(int above, Track *dst);
442 void add_subttl_track_entry(int above, Track *dst);
443 Track *add_subttl_track(int above, Track *dst);
446 void asset_to_size();
447 void asset_to_rate();
448 // Entry point for clear operations.
450 // Clears active region in EDL.
451 // If clear_handle, edit boundaries are cleared if the range is 0.
452 // Called by paste, record, menueffects, render, and CWindow drop.
453 void clear(int clear_handle);
455 int clear_labels(double start, double end);
456 void clear_hard_edges();
457 int clear_hard_edges(double start, double end);
459 void select_edits(int v);
460 void concatenate_tracks();
461 int copy_flags(int copy_flags=COPY_CLIPBOARD);
463 int copy(double start, double end);
465 void blade(double position);
466 void cut(double start, double end, double new_position=-1);
467 // cut edit from current position to handle/label
468 void cut_left_edit();
469 void cut_right_edit();
470 void cut_left_label();
471 void cut_right_label();
473 // Calculate aspect ratio from pixel counts
474 static int create_aspect_ratio(float &w, float &h, int width, int height);
475 // Calculate defaults path
476 static void create_defaults_path(char *string, const char *config_file);
478 void delete_track(Track *track);
479 void delete_tracks();
480 int feather_edits(int64_t feather_samples, int audio, int video);
481 int64_t get_feather(int audio, int video);
482 float get_aspect_ratio();
483 void insert(double position, FileXML *file,
484 int edit_labels, int edit_plugins, int edit_autos,
485 EDL *parent_edl, Track *first_track, int overwrite);
487 // TrackCanvas calls this to insert multiple effects from the drag_pluginservers
488 // into pluginset_highlighted.
489 void insert_effects_canvas(Track *dest_track, double start, double length);
491 // CWindow calls this to insert multiple effects from
492 // the drag_pluginservers array.
493 void insert_effects_cwindow(Track *dest_track);
495 // Attach new effect to all recordable tracks
496 // single_standalone - attach 1 standalone on the first track and share it with
498 void insert_effect(char *title,
499 SharedLocation *shared_location,
500 int data_type, int plugin_type, int single_standalone);
502 // This is called multiple times by the above functions.
503 // It can't sync parameters.
504 void insert_effect(char *title,
505 SharedLocation *shared_location,
506 Track *track, PluginSet *plugin_set,
507 double start, double length, int plugin_type);
509 void match_output_size(Track *track);
510 void delete_edit(Edit *edit, const char *msg, int collapse=0);
511 void delete_edits(ArrayList<Edit*> *edits, const char *msg, int collapse=0);
512 void delete_edits(int collapse=0);
513 void cut_selected_edits(int collapse, int packed);
514 // Move edit to new position
515 void move_edits(ArrayList<Edit*> *edits, Track *track, double position,
516 int mode); // mode: 0 - mute and overwrite, 1 - cut and paste
517 void selected_edits_to_clipboard(int packed);
518 void paste_clipboard(Track *first_track, double position, int overwrite,
519 int edit_edits, int edit_labels, int edit_autos, int edit_plugins);
520 void move_group(EDL *group, Track *first_track, double position, int overwrite);
521 // Move effect to position
522 void move_effect(Plugin *plugin, Track *track, int64_t position);
523 void move_effect(Plugin *plugin, PluginSet *plugin_set, int64_t position);
524 void move_plugins_up(PluginSet *plugin_set);
525 void move_plugins_down(PluginSet *plugin_set);
526 void roll_track_down(Track *track);
527 void roll_tracks_down();
528 void roll_track_up(Track *track);
529 void roll_tracks_up();
530 void move_track_down(Track *track);
531 void move_tracks_down();
532 void move_track_up(Track *track);
533 void move_tracks_up();
534 void mute_selection();
535 void new_folder(const char *new_folder, int is_clips);
536 void delete_folder(char *folder);
537 // For clipboard commands
539 void paste(double start, Track *first_track, int clear_selection, int overwrite);
540 // For splice and overwrite
541 void overwrite(EDL *source, int all);
542 void splice(EDL *source, int all);
543 int paste(double start, double end, FileXML *file,
544 int edit_labels, int edit_plugins, int edit_autos,
545 Track *first_track, int overwrite);
546 int paste_output(int64_t startproject, int64_t endproject,
547 int64_t startsource_sample, int64_t endsource_sample,
548 int64_t startsource_frame, int64_t endsource_frame,
549 Asset *asset, RecordLabels *new_labels);
550 void paste_silence();
552 // Detach single transition
553 void detach_transition(Transition *transition);
554 // Detach all transitions in selection
555 void detach_transitions();
556 // Attach dragged transition
557 void paste_transition();
558 // Attach transition to all edits in selection
559 void paste_transitions(int track_type, char *title);
560 // Attach transition dragged onto CWindow
561 void paste_transition_cwindow(Track *dest_track);
562 // Attach default transition to single edit
563 void paste_audio_transition();
564 void paste_video_transition();
565 void shuffle_edits();
566 void reverse_edits();
568 void set_edit_length(double length);
569 // Set length of single transition
570 void set_transition_length(Transition *transition, double length);
571 // Set length in seconds of all transitions in active range
572 void set_transition_length(double length);
574 void remove_indexfile(Indexable *indexable);
575 void rebuild_indices();
576 // Asset removal from caches
577 void reset_caches(int locked);
578 void remove_from_caches(Indexable *idxbl);
579 void remove_assets_from_project(int push_undo, int redraw, int delete_indexes,
580 ArrayList<Indexable*> *drag_assets /* mwindow->session->drag_assets */,
581 ArrayList<EDL*> *drag_clips /* mwindow->session->drag_clips */);
582 void remove_assets_from_disk();
583 void resize_track(Track *track, int w, int h);
585 void set_automation_mode(int mode);
586 void set_keyframe_type(int mode);
587 void set_auto_keyframes(int value);
588 void set_span_keyframes(int value);
589 void set_auto_visibility(Autos *autos, int value);
590 void set_labels_follow_edits(int value);
592 // Update the editing mode
593 int set_editing_mode(int new_editing_mode);
594 void toggle_editing_mode();
597 void unset_inoutpoint();
598 void toggle_loop_playback();
599 void trim_selection();
600 // Synchronize EDL settings with all playback engines depending on current
601 // operation. Doesn't redraw anything.
602 void sync_parameters(int change_type = CHANGE_PARAMS);
603 void save_clip(EDL *new_edl, const char *txt);
604 void to_clip(EDL *edl, const char *txt, int all);
606 void undo_entry(BC_WindowBase *calling_window_gui);
607 void redo_entry(BC_WindowBase *calling_window_gui);
608 void save_undo_data();
609 void load_undo_data();
610 void remove_undo_data();
611 int copy_target(const char *path, const char *target);
612 int link_target(const char *real_path, const char *link_path, int relative);
613 void save_project(const char *dir, int save_mode, int overwrite, int reload);
615 int cut_automation();
616 int copy_automation();
617 int paste_automation();
618 void clear_automation();
619 int cut_default_keyframe();
620 int copy_default_keyframe();
621 // Use paste_automation to paste the default keyframe in other position.
622 // Use paste_default_keyframe to replace the default keyframe with whatever is
624 int paste_default_keyframe();
625 int clear_default_keyframe();
626 void create_keyframes(int mask, int mode);
628 FloatAuto* get_float_auto(PatchGUI *patch,int idx);
629 IntAuto* get_int_auto(PatchGUI *patch,int idx);
630 PanAuto* get_pan_auto(PatchGUI *patch);
631 PatchGUI *get_patchgui(Track *track);
633 int modify_edithandles();
634 int modify_pluginhandles();
635 int modify_transnhandles();
636 void finish_modify_handles();
637 void rescale_proxy(EDL *clip, int orig_scale, int new_scale);
638 void add_proxy(ArrayList<Indexable*> *orig_assets,
639 ArrayList<Indexable*> *proxy_assets);
640 int render_proxy(ArrayList<Indexable *> &new_idxbls);
641 void beep(double freq, double secs, double gain);
644 int to_proxy(Asset *asset, int new_scale, int new_use_scaler);
647 void dump_plugins(FILE *fp=stdout);
648 void dump_edl(FILE *fp=stdout);
649 void dump_undo(FILE *fp=stdout);
650 void dump_exe(FILE *fp=stdout);
651 void dump_caches(FILE *fp=stdout);
652 static void trap_hook(FILE *fp, void *vp);
654 void reset_android_remote();
656 // Send new EDL to caches
658 int optimize_assets(); // delete unused assets from the cache and assets
659 // render edl assets to specified format, then replace in edl
660 void start_convert(Asset *format_asset, const char *suffix,
661 float beep, int to_proxy, int remove_originals);
662 void finish_convert(int remove_originals);
663 ConvertRender *convert_render;
665 void select_point(double position);
666 int set_loop_boundaries(); // toggle loop playback and set boundaries for loop playback
669 Playback3D *playback_3d;
670 SplashGUI *splash_window;
680 // CICaches for drawing timeline only
681 CICache *audio_cache, *video_cache;
682 // Frame cache for drawing timeline only.
683 // Cache drawing doesn't wait for file decoding.
684 FrameCache *frame_cache;
685 WaveCache *wave_cache;
686 Preferences *preferences;
687 PreferencesThread *preferences_thread;
688 MainSession *session;
690 MainIndexes *mainindexes;
691 MainProgress *mainprogress;
695 const char *default_standard;
696 static Commercials *commercials;
697 int commercial_active;
698 int has_commercials();
699 // copy of edl created in speed_before, used in speed_after to normalize_speed
703 ArrayList<ColormodelItem*> colormodels;
704 ArrayList<InterlacemodeItem*> interlace_project_modes;
705 ArrayList<InterlacemodeItem*> interlace_asset_modes;
710 int select_asset(Asset *asset, int vstream, int astream, int delete_tracks);
711 int select_asset(int vtrack, int delete_tracks);
713 // Channel DB for playback only. Record channel DB's are in record.C
714 ChannelDB *channeldb_buz;
715 ChannelDB *channeldb_v4l2jpeg;
717 // ====================================== plugins ==============================
719 // Contains file descriptors for all the dlopens
720 static ArrayList<PluginServer*> *plugindb;
721 // Currently visible plugins
722 int64_t plugin_visibility;
723 PluginGUIs *plugin_guis;
724 // GUI Plugins to delete
725 ArrayList<PluginServer*> *dead_plugins;
727 ArrayList<KeyFrameThread*> *keyframe_threads;
729 // Adjust sample position to line up with frames.
730 int fix_timing(int64_t &samples_out,
735 CreateBD_Thread *create_bd;
736 CreateDVD_Thread *create_dvd;
737 BatchRenderThread *batch_render;
740 ExportEDL *exportedl;
750 Mutex *vwindows_lock;
751 ArrayList<VWindow*> vwindows;
753 Mutex *zwindows_lock;
754 ArrayList<ZWindow*> zwindows;
755 MixersAlign *mixers_align;
765 void show_warning(int *do_warning, const char *text);
768 LevelWindow *lwindow;
770 // Lock during creation and destruction of GUI
771 Mutex *plugin_gui_lock;
772 Mutex *dead_plugin_lock;
773 Mutex *keyframe_gui_lock;
774 // Lock during creation and destruction of brender so playback doesn't use it.
776 // Initialize shared memory
777 void init_shm(const char *pfn, int64_t min);
778 // Initialize channel DB's for playback
779 void init_channeldb();
781 void init_exportedl();
782 // These three happen synchronously with each other
783 // Make sure this is called after synchronizing EDL's.
785 // Restart brender after testing its existence
786 void restart_brender();
787 // Stops brender after testing its existence
789 // This one happens asynchronously of the others. Used by playback to
790 // see what frame is background rendered.
791 int brender_available(int position);
792 void set_brender_active(int v, int update=1);
793 int put_commercial();
794 void activate_commercial() { commercial_active = 1; }
795 void commit_commercial();
796 void undo_commercial();
797 void cut_commercials();
798 void update_gui(int changed_edl);
799 int paste_subtitle_text(char *text, double start, double end);
803 static void init_defaults(BC_Hash* &defaults, char *config_path);
804 void check_language();
805 const char *default_std();
806 void fill_preset_defaults(const char *preset, EDLSession *session);
807 const char *get_preset_name(int index);
811 void init_tipwindow();
812 // Used by MWindow and RenderFarmClient
813 static void get_plugin_path(char *path, const char *plug_dir, const char *fs_path);
814 static int init_plugins(MWindow *mwindow, Preferences *preferences);
815 static int init_ladspa_plugins(MWindow *mwindow, Preferences *preferences);
816 static void init_plugin_tips(ArrayList<PluginServer*> &plugins, const char *lang);
817 static int check_plugin_index(ArrayList<PluginServer*> &plugins,
818 const char *plug_dir, const char *plug_path);
819 static void init_plugin_index(MWindow *mwindow, Preferences *preferences,
820 FILE *fp, const char *plugin_dir);
821 static void scan_plugin_index(MWindow *mwindow, Preferences *preferences,
822 FILE *fp, const char *plug_dir, const char *plug_path, int &idx);
823 static void init_ffmpeg();
824 static void init_ffmpeg_index(MWindow *mwindow, Preferences *preferences, FILE *fp);
825 static int load_plugin_index(MWindow *mwindow, FILE *fp, const char *plugin_dir, const char *index_id);
826 static PluginServer *new_ffmpeg_server(MWindow *mwindow, const char *name);
827 static int init_lv2_index(MWindow *mwindow, Preferences *preferences, FILE *fp);
828 static PluginServer *new_lv2_server(MWindow *mwindow, const char *name);
829 static void remove_plugin_index();
831 void init_preferences();
837 void init_compositor();
838 void init_levelwindow();
839 // Called when creating a new viewer to view footage
840 VWindow* get_viewer(int start_it, int idx=-1);
846 void init_playbackcursor();
847 void init_commercials();
848 static void add_plugins(ArrayList<PluginServer*> &plugins);
849 static void delete_plugins();
851 int speed_after(int done, int edit_speed);
852 int normalize_speed(EDL *old_edl, EDL *new_edl, int edit_speed);
853 int get_cpus(int out_w, int out_h);
856 void clean_indexes();
857 void clean_backups();
858 // TimeBomb timebomb;
859 SigHandler *sighandler;