LiVES 1.4.9

src/effects-weed.h

Go to the documentation of this file.
00001 // effects-weed.h
00002 // LiVES (lives-exe)
00003 // (c) G. Finch 2005 - 2010
00004 // Released under the GPL 3 or later
00005 // see file ../COPYING for licensing details
00006 
00008 typedef enum {
00009   FILTER_NO_ERROR=0,
00010   FILTER_ERROR_MISSING_LAYER=1,
00011   FILTER_ERROR_BLANK_FRAME=2,
00012   FILTER_ERROR_MISSING_FRAME=3,
00013   FILTER_ERROR_INVALID_PALETTE_CONVERSION=4,
00014   FILTER_ERROR_UNABLE_TO_RESIZE=5,
00015   FILTER_ERROR_INVALID_PALETTE_SETTINGS=6,
00016   FILTER_ERROR_COULD_NOT_REINIT=7,
00017   FILTER_ERROR_MUST_RELOAD=8,
00018   FILTER_ERROR_NO_IN_CHANNELS=9,
00019   FILTER_ERROR_INVALID_TRACK=10,
00020   FILTER_ERROR_INTERPOLATION_FAILED=11,
00021   FILTER_ERROR_INVALID_INSTANCE=12,
00022   FILTER_ERROR_INVALID_FILTER=13,
00023   FILTER_ERROR_INVALID_INIT_EVENT=14,
00024   FILTER_ERROR_IS_AUDIO=15,
00025   FILTER_ERROR_IS_SCRAP_FILE=16,
00026 
00027   FILTER_INFO_REINITED=512
00028 } lives_filter_error_t;
00029 
00030 
00031 
00032 weed_plant_t *get_weed_filter(int filter_idx);
00033 gchar *weed_filter_get_name(int filter_idx);
00034 gchar *make_weed_hashname(int filter_idx, gboolean fullname) WARN_UNUSED;  
00035 int weed_get_idx_for_hashname (const gchar *hashname, gboolean fullname); 
00036 gint enabled_in_channels (weed_plant_t *plant, gboolean count_repeats);
00037 gint enabled_out_channels (weed_plant_t *plant, gboolean count_repeats);
00038 weed_plant_t *get_enabled_channel (weed_plant_t *inst, gint which, gboolean is_in); 
00039 weed_plant_t *get_mandatory_channel (weed_plant_t *filter, gint which, gboolean is_in); 
00040 gboolean weed_filter_is_resizer(weed_plant_t *filt);
00041 gboolean weed_instance_is_resizer(weed_plant_t *filt);
00042 
00043 gboolean is_audio_channel_in(weed_plant_t *inst, int chnum);
00044 gboolean has_video_chans_in(weed_plant_t *filter, gboolean count_opt);
00045 gboolean has_audio_chans_in(weed_plant_t *filter, gboolean count_opt);
00046 gboolean is_audio_channel_out(weed_plant_t *inst, int chnum);
00047 gboolean has_video_chans_out(weed_plant_t *filter, gboolean count_opt);
00048 gboolean has_audio_chans_out(weed_plant_t *filter, gboolean count_opt);
00049 gboolean is_pure_audio(weed_plant_t *filter_or_instance, gboolean count_opt); 
00050 
00051 gint weed_filter_categorise (weed_plant_t *pl, int in_channels, int out_channels);
00052 gint weed_filter_subcategorise (weed_plant_t *pl, int category, gboolean count_opt);
00053 gchar *weed_category_to_text(int cat, gboolean plural);
00054 gboolean has_usable_palette(weed_plant_t *chantmpl);
00055 
00056 void weed_call_init_func(weed_plant_t *instance);
00057 void weed_call_deinit_func(weed_plant_t *instance);
00058 
00059 gchar *cd_to_plugin_dir(weed_plant_t *filter);
00060 gboolean weed_init_effect(int hotkey); 
00061 void weed_deinit_effect(int hotkey); 
00062 weed_plant_t *weed_instance_from_filter(weed_plant_t *filter);
00063 void weed_instance_ref(weed_plant_t *inst);
00064 void weed_instance_unref(weed_plant_t *inst);
00065 gint weed_reinit_effect (weed_plant_t *inst, gboolean deinit_first);
00066 void weed_reinit_all(void);
00067 
00068 int num_in_params(weed_plant_t *, gboolean count_reinits, gboolean count_variable);
00069 weed_plant_t *weed_inst_in_param (weed_plant_t *inst, int param_num, gboolean skip_hidden);
00070 gboolean is_hidden_param(weed_plant_t *plant, int i);
00071 int get_nth_simple_param(weed_plant_t *plant, int pnum);
00072 int count_simple_params(weed_plant_t *plant);
00073 weed_plant_t **weed_params_create (weed_plant_t *filter, gboolean in);
00074 int get_transition_param(weed_plant_t *filter);
00075 int get_master_vol_param(weed_plant_t *filter);
00076 gboolean is_perchannel_multiw(weed_plant_t *param);
00077 gboolean has_perchannel_multiw(weed_plant_t *filter);
00078 gboolean weed_parameter_has_variable_elements_strict(weed_plant_t *inst, weed_plant_t *ptmpl);
00079 
00080 
00082 gboolean interpolate_param(weed_plant_t *inst, int i, void *pchain, weed_timecode_t tc);
00083 gboolean interpolate_params(weed_plant_t *inst, void **pchains, weed_timecode_t tc);
00084 
00085 void update_visual_params(lives_rfx_t *rfx, gboolean update_hidden);
00086 
00087 gboolean weed_plant_serialise(int fd, weed_plant_t *plant, unsigned char **mem);
00088 weed_plant_t *weed_plant_deserialise(int fd, unsigned char **mem);
00089 
00090 
00092 void rec_param_change(weed_plant_t *inst, int pnum);
00093 
00094 weed_plant_t *get_textparm();
00095 
00096 void weed_set_blend_factor(int hotkey);
00097 gint weed_get_blend_factor(int hotkey);
00098 
00099 void weed_memory_init(void); 
00100 
00101 void weed_load_all (void); 
00102 void weed_unload_all(void); 
00103 int get_next_free_key(void); 
00104 
00105 void weed_deinit_all(void); 
00106 
00107 weed_plant_t *weed_apply_effects (weed_plant_t **layers, weed_plant_t *filter_map, weed_timecode_t tc, int opwidth, int opheight, void ***pchains);
00108 lives_filter_error_t weed_apply_instance (weed_plant_t *inst, weed_plant_t *init_event, weed_plant_t **layers, int opwidth, int opheight, weed_timecode_t tc);
00109 void weed_apply_audio_effects (weed_plant_t *filter_map, float **abuf, int nbtracks, int nchans, long nsamps, gdouble arate, weed_timecode_t tc, double *vis);
00110 lives_filter_error_t weed_apply_audio_instance (weed_plant_t *init_event, float **abuf, int nbtracks, int nchans, long nsamps, gdouble arate, weed_timecode_t tc, double *vis);
00111 
00112 gboolean weed_generator_start (weed_plant_t *inst);
00113 weed_plant_t *weed_layer_new_from_generator (weed_plant_t *inst, weed_timecode_t tc);
00114 void weed_generator_end (weed_plant_t *inst);
00115 gboolean weed_playback_gen_start (void);
00116 void weed_bg_generator_end (weed_plant_t *inst);
00117 
00118 
00120 void backup_weed_instances(void);
00121 void restore_weed_instances(void);
00122 
00123 
00125 // WARNING !! "key" here starts at 1, "mode" starts at 0
00126 
00127 gboolean rte_key_valid (gint key, gboolean is_userkey); 
00128 gboolean rte_keymode_valid (gint key, gint mode, gboolean is_userkey); 
00129 gint rte_keymode_get_filter_idx(gint key, gint mode); 
00130 gchar *rte_keymode_get_filter_name (gint key, gint mode); 
00131 gchar *rte_keymode_get_plugin_name(gint key, gint mode); 
00132 gchar *rte_keymode_get_type (gint key, gint mode); 
00133 weed_plant_t *rte_keymode_get_instance(gint key, gint mode); 
00134 weed_plant_t *rte_keymode_get_filter(gint key, gint mode); 
00135 
00136 gboolean weed_delete_effectkey (gint key, gint mode); 
00137 int weed_add_effectkey (gint key, const gchar *hashname, gboolean fullname); 
00138 
00139 int weed_add_effectkey_by_idx (gint key, int idx); 
00140 
00141 int rte_key_getmode (gint key); 
00142 int rte_key_getmaxmode(gint key); 
00143 
00144 gboolean rte_key_setmode (gint key, gint newmode); 
00145 
00147 gint rte_switch_keymode (gint key, gint mode, const gchar *hashname);
00148 
00149 
00150 
00151 
00153 
00154 int rte_getmodespk (void);
00155 GList *weed_get_all_names (gshort list_type);
00156 gint rte_get_numfilters(void);
00157 
00159 // key starts at 0
00160 
00161 void free_key_defaults(gint key, gint mode);
00162 void apply_key_defaults(weed_plant_t *inst, gint key, gint mode);
00163 void write_key_defaults(int fd, gint key, gint mode);
00164 gboolean read_key_defaults(int fd, int nparams, int key, int mode, int version);
00165 void set_key_defaults(weed_plant_t *inst, gint key, gint mode);
00166 gboolean has_key_defaults(void);
00167 
00168 
00170 
00171 void rte_swap_fg_bg (void);
00172 
00173 
00174 gint rte_bg_gen_key (void);
00175 gint rte_fg_gen_key (void);
00176 
00177 gint rte_bg_gen_mode (void);
00178 gint rte_fg_gen_mode (void);
00179 
00180 
00181 
00183 
00184 char *get_weed_display_string (weed_plant_t *inst, int pnum);
00185 weed_plant_t *add_filter_deinit_events (weed_plant_t *event_list);
00186 weed_plant_t *add_filter_init_events (weed_plant_t *event_list, weed_timecode_t tc);
00187 void deinit_render_effects (void);
00188 
00189 void write_filter_defaults (int fd, int idx);
00190 void read_filter_defaults(int fd);
00191 
00192 void write_generator_sizes (int fd, int idx);
00193 void read_generator_sizes(int fd);
00194 
00195 gint step_val(gint val, gint step);
00196 
00197 void set_param_gui_readwrite (weed_plant_t *inst);
00198 void set_param_gui_readonly (weed_plant_t *inst);
00199 
00200 void weed_add_plant_flags (weed_plant_t *plant, int flags);
00201 
00202 void update_host_info (weed_plant_t *inst);
00203 
00205 void fill_param_vals_to (weed_plant_t *paramtmpl, weed_plant_t *param, int pnum, int hint, int index);
00206 
00207 
00208 // some general utilities
00209 
00210 #define WEED_PLANT_IS_PLUGIN_INFO(plant) (weed_get_plant_type(plant)==WEED_PLANT_PLUGIN_INFO?1:0)
00211 #define WEED_PLANT_IS_HOST_INFO(plant) (weed_get_plant_type(plant)==WEED_PLANT_HOST_INFO?1:0)
00212 #define WEED_PLANT_IS_FILTER_CLASS(plant) (weed_get_plant_type(plant)==WEED_PLANT_FILTER_CLASS?1:0)
00213 #define WEED_PLANT_IS_FILTER_INSTANCE(plant) (weed_get_plant_type(plant)==WEED_PLANT_FILTER_INSTANCE?1:0)
00214 #define WEED_PLANT_IS_CHANNEL(plant) (weed_get_plant_type(plant)==WEED_PLANT_CHANNEL?1:0)
00215 #define WEED_PLANT_IS_CHANNEL_TEMPLATE(plant) (weed_get_plant_type(plant)==WEED_PLANT_CHANNEL_TEMPLATE?1:0)
00216 #define WEED_PLANT_IS_PARAMETER(plant) (weed_get_plant_type(plant)==WEED_PLANT_PARAMETER?1:0)
00217 #define WEED_PLANT_IS_PARAMETER_TEMPLATE(plant) (weed_get_plant_type(plant)==WEED_PLANT_PARAMETER_TEMPLATE?1:0)
00218 #define WEED_PLANT_IS_GUI(plant) (weed_get_plant_type(plant)==WEED_PLANT_GUI?1:0)
00219 
00220 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines