LiVES  3.2.0
effects-weed.h
Go to the documentation of this file.
1 // effects-weed.h
2 // LiVES (lives-exe)
3 // (c) G. Finch 2005 - 2016 <salsaman@gmail.com>
4 // Released under the GPL 3 or later
5 // see file ../COPYING for licensing details
6 
7 #ifndef HAS_LIVES_EFFECTS_WEED_H
8 #define HAS_LIVES_EFFECTS_WEED_H
9 
10 #define MAX_WEED_STRLEN 65535 // soft limit for LiVES
11 #define MAX_WEED_ELEMENTS 65535 // soft limit for LiVES
12 
14 typedef enum {
38 
43 
44 typedef enum {
45  FX_LIST_NAME, // just name
46  FX_LIST_EXTENDED_NAME, // name + author (if dupe) + subcat + observations
47  FX_LIST_HASHNAME, // hashnames - (packagefilterauthor) author and not extra_authors
49 
50 // set some custom Weed values
51 
52 #define WEED_FLAG_HOST_READONLY (1 << 16)
53 
54 // plugin specific values
55 #define WEED_LEAF_HOST_SUSPICIOUS "host_suspicious" // plugin is badly behaved
56 
57 // internal values
58 #define WEED_LEAF_HOST_AUDIO_PLAYER "host_audio_player" // exported to plugins
59 
60 #define WEED_LEAF_HOST_ORIG_PDATA "host_orig_pdata" // set if we "steal" an alpha channel to chain
61 #define WEED_LEAF_HOST_MENU_HIDE "host_menu_hide" // hide from menus
62 #define WEED_LEAF_HOST_DEFAULT "host_default" // user set default
63 #define WEED_LEAF_HOST_WIDTH "host_width" // user set width
64 #define WEED_LEAF_HOST_HEIGHT "host_height" // user set height
65 #define WEED_LEAF_HOST_FPS "host_fps" // user set fps
66 #define WEED_LEAF_HOST_TAG "host_tag" // internal key mapping (for higher keys)
67 #define WEED_LEAF_HOST_KEY "host_key" // internal key mapping
68 #define WEED_LEAF_HOST_MODE "host_mode" // internal mode mapping
69 #define WEED_LEAF_HOST_INPLACE "host_inplace" // inplace effect
70 #define WEED_LEAF_HOST_DISABLED "host_disabled" // channel is disabled
71 #define WEED_LEAF_HOST_TEMP_DISABLED "host_temp_dis" // channel is temp disabled
72 #define WEED_LEAF_HOST_REFS "host_refs" // host ref counting
73 #define WEED_LEAF_HOST_REPEATS "host_repeats" // host channel repeats
74 #define WEED_LEAF_HOST_INITED "host_inited" // inited or not
75 #define WEED_LEAF_HOST_PLUGIN_PATH "host_plugin_path" // plugin path
76 #define WEED_LEAF_HOST_HANDLE "host_handle" // dll handle
77 #define WEED_LEAF_HOST_FILTER_LIST "host_filter_list" // host usable filters
78 #define WEED_LEAF_HOST_NORECORD "host_norecord" // do not record parameter changes for this instance
79 #define WEED_LEAF_DUPLICATE "host_duplicate"
80 #define WEED_LEAF_HOST_REINITING "host_reiniting"
81 #define WEED_LEAF_HOST_UNUSED "host_unused"
82 
83 #define WEED_LEAF_HOST_INSTANCE "host_instance" // special value for text widgets
84 #define WEED_LEAF_HOST_IDX "host_idx" // special value for text widgets
85 
86 #define WEED_LEAF_FREED_PLANTS "host_freed_plants" // list of freed pointers to avoid freeing dupes during unload
87 
88 #define WEED_LEAF_HOST_SCRAP_FILE_OFFSET "scrap_offset" // special value for scrap_file
89 
90 #define WEED_LEAF_HOST_IDENTIFIER "host_unique_id"
91 
92 #define WEED_LEAF_HOST_EASING_END "host_easing_end"
93 #define WEED_LEAF_HOST_EASE_OUT_COUNT "host_ease_out_count"
94 #define WEED_LEAF_AUTO_EASING "host_auto_easing"
95 
96 #define WEED_LEAF_RFX_STRINGS "layout_rfx_strings"
97 #define WEED_LEAF_RFX_DELIM "layout_rfx_delim"
98 
99 #define WEED_LEAF_HOST_PLUGIN_NAME "host_plugin_name"
100 
101 // compound plugins
102 #define WEED_LEAF_HOST_INTERNAL_CONNECTION "host_internal_connection" // for chain plugins
103 #define WEED_LEAF_HOST_INTERNAL_CONNECTION_AUTOSCALE "host_internal_connection_autoscale" // for chain plugins
104 #define WEED_LEAF_HOST_NEXT_INSTANCE "host_next_instance" // for chain plugins
105 #define WEED_LEAF_HOST_COMPOUND_CLASS "host_compound_class" // for chain plugins
106 #define WEED_LEAF_HOST_CHANNEL_CONNECTION "host_channel_connection" // special value for text widgets
107 
108 // custom leaf flags, may evolve
109 #define LIVES_FLAG_MAINTAIN_VALUE (1 << 16)
110 
111 weed_plant_t *get_weed_filter(int filter_idx); // TODO: make const
112 char *weed_filter_idx_get_package_name(int filter_idx) WARN_UNUSED;
113 char *weed_filter_idx_get_name(int idx, boolean add_subcats, boolean add_notes) WARN_UNUSED;
114 char *weed_instance_get_filter_name(weed_plant_t *inst, boolean get_compound_parent) WARN_UNUSED;
115 char *make_weed_hashname(int filter_idx, boolean fullname,
116  boolean use_extra_authors, char sep, boolean spc_to_underscore) WARN_UNUSED;
117 int weed_get_idx_for_hashname(const char *hashname, boolean fullname) GNU_CONST;
118 int *weed_get_indices_from_template(const char *package_name, const char *filter_name, const char *author, int version);
119 int weed_filter_highest_version(const char *pkg, const char *fxname, const char *auth, int *return_version);
120 int enabled_in_channels(weed_plant_t *plant, boolean count_repeats);
121 int enabled_out_channels(weed_plant_t *plant, boolean count_repeats);
122 weed_plant_t *get_enabled_channel(weed_plant_t *inst, int which, boolean is_in);
123 weed_plant_t *get_enabled_audio_channel(weed_plant_t *inst, int which, boolean is_in);
124 weed_plant_t *get_mandatory_channel(weed_plant_t *filter, int which, boolean is_in);
125 boolean weed_instance_is_resizer(weed_plant_t *filt);
126 weed_plant_t *weed_instance_get_filter(weed_plant_t *inst, boolean get_compound_parent);
127 
128 #define PLUGIN_COMPOUND_EFFECTS_BUILTIN "effects/compound/"
129 #define PLUGIN_COMPOUND_EFFECTS_CUSTOM "plugins/effects/compound/"
130 
131 int num_compound_fx(weed_plant_t
132  *plant);
133 
134 boolean has_non_alpha_palette(weed_plant_t *ctmpl, weed_plant_t *filter);
135 boolean has_alpha_palette(weed_plant_t *ctmpl, weed_plant_t *filter);
136 
137 boolean is_audio_channel_in(weed_plant_t *inst, int chnum);
138 boolean has_video_chans_in(weed_plant_t *filter, boolean count_opt);
139 boolean has_audio_chans_in(weed_plant_t *filter, boolean count_opt);
140 boolean is_audio_channel_out(weed_plant_t *inst, int chnum);
141 boolean has_video_chans_out(weed_plant_t *filter, boolean count_opt);
142 boolean has_audio_chans_out(weed_plant_t *filter, boolean count_opt);
143 boolean is_pure_audio(weed_plant_t *filter_or_instance, boolean count_opt);
144 
145 boolean has_video_filters(boolean analysers_only);
146 
147 #ifdef HAS_LIVES_EFFECTS_H
148 lives_fx_cat_t weed_filter_categorise(weed_plant_t *pl, int in_channels, int out_channels);
149 lives_fx_cat_t weed_filter_subcategorise(weed_plant_t *pl, lives_fx_cat_t category, boolean count_opt);
150 boolean has_audio_filters(lives_af_t af_type);
151 #endif
152 
153 boolean has_usable_palette(weed_plant_t *chantmpl);
154 int best_palette_match(int *palete_list, int num_palettes, int palette);
155 
156 // instances
157 weed_error_t weed_call_init_func(weed_plant_t *instance);
158 weed_error_t weed_call_deinit_func(weed_plant_t *instance);
159 lives_filter_error_t run_process_func(weed_plant_t *instance, weed_timecode_t tc, int key);
160 
161 char *cd_to_plugin_dir(weed_plant_t *filter);
162 boolean weed_init_effect(int hotkey);
163 boolean weed_deinit_effect(int hotkey);
164 weed_plant_t *weed_instance_from_filter(weed_plant_t *filter);
165 int _wood_instance_ref(weed_plant_t *inst);
166 int _wood_instance_unref(weed_plant_t *inst);
167 weed_plant_t *_wood_instance_obtain(int line, char *file, int key, int mode);
168 void weed_in_parameters_free(weed_plant_t *inst);
169 void weed_in_params_free(weed_plant_t **parameters, int num_parameters);
170 void add_param_connections(weed_plant_t *inst);
171 lives_filter_error_t weed_reinit_effect(weed_plant_t *inst, boolean reinit_compound);
172 void weed_reinit_all(void);
173 
174 int weed_flagset_array_count(weed_plant_t **array, boolean set_readonly);
175 
176 int num_alpha_channels(weed_plant_t *filter, boolean out);
177 
178 int num_in_params(weed_plant_t *, boolean skip_hidden, boolean skip_internal);
179 int num_out_params(weed_plant_t *);
180 weed_plant_t *weed_inst_in_param(weed_plant_t *inst, int param_num, boolean skip_hidden, boolean skip_internal);
181 weed_plant_t *weed_inst_out_param(weed_plant_t *inst, int param_num);
182 weed_plant_t *weed_filter_in_paramtmpl(weed_plant_t *filter, int param_num, boolean skip_internal);
183 weed_plant_t *weed_filter_out_paramtmpl(weed_plant_t *filter, int param_num);
184 boolean is_hidden_param(weed_plant_t *, int i);
185 int get_nth_simple_param(weed_plant_t *, int pnum);
186 int count_simple_params(weed_plant_t *);
187 weed_plant_t **weed_params_create(weed_plant_t *filter, boolean in);
188 int get_transition_param(weed_plant_t *filter, boolean skip_internal);
189 int get_master_vol_param(weed_plant_t *filter, boolean skip_internal);
190 boolean is_perchannel_multiw(weed_plant_t *param);
191 boolean has_perchannel_multiw(weed_plant_t *filter);
192 boolean weed_parameter_has_variable_elements_strict(weed_plant_t *inst, weed_plant_t *ptmpl);
193 
195 boolean interpolate_param(weed_plant_t *param, void *pchain, ticks_t tc);
196 boolean interpolate_params(weed_plant_t *inst, void **pchains, ticks_t tc);
197 
198 int filter_mutex_lock(int key); // 0 based key
199 int filter_mutex_trylock(int key); // 0 based key
200 int filter_mutex_unlock(int key); // 0 based key
201 
202 size_t weed_plant_serialise(int fd, weed_plant_t *plant, unsigned char **mem);
203 weed_plant_t *weed_plant_deserialise(int fd, unsigned char **mem, weed_plant_t *plant);
204 
206 void rec_param_change(weed_plant_t *inst, int pnum);
207 
208 // copy values for "copy_value_to" params
209 int set_copy_to(weed_plant_t *inst, int pnum, lives_rfx_t *rfx, boolean update);
210 
211 weed_plant_t *get_textparm();
212 
213 void weed_set_blend_factor(int hotkey); // 0 based key
214 int weed_get_blend_factor(int hotkey); // 0 based key
215 
217 
218 void weed_load_all(void);
219 void weed_unload_all(void);
220 int get_next_free_key(void);
221 
222 void weed_deinit_all(boolean shutdown);
223 
224 weed_plant_t *weed_apply_effects(weed_plant_t **layers, weed_plant_t *filter_map, ticks_t tc, int opwidth, int opheight,
225  void ***pchains);
226 lives_filter_error_t weed_apply_instance(weed_plant_t *inst, weed_plant_t *init_event, weed_plant_t **layers,
227  int opwidth, int opheight, ticks_t tc);
228 void weed_apply_audio_effects(weed_plant_t *filter_map, weed_layer_t **, int nbtracks, int nchans, int64_t nsamps, double arate,
229  ticks_t tc, double *vis);
230 void weed_apply_audio_effects_rt(weed_layer_t *alayer, ticks_t tc, boolean analysers_only, boolean is_audio_thread);
231 
232 lives_filter_error_t weed_apply_audio_instance(weed_plant_t *init_event, weed_layer_t **layers, int nbtracks, int nchans,
233  int64_t nsamps,
234  double arate, ticks_t tc, double *vis);
235 
236 int weed_generator_start(weed_plant_t *inst, int key); // 0 based key
237 void weed_generator_end(weed_plant_t *inst);
238 boolean weed_playback_gen_start(void);
239 void weed_bg_generator_end(weed_plant_t *inst);
240 void wge_inner(weed_plant_t *inst);
241 
242 // layers
243 weed_error_t weed_leaf_copy_or_delete(weed_layer_t *dlayer, const char *key, weed_layer_t *slayer);
244 weed_plant_t *weed_layer_create_from_generator(weed_plant_t *inst, ticks_t tc, int clipno);
245 
247 void backup_weed_instances(void);
248 void restore_weed_instances(void);
249 
251 // WARNING !! "key" here starts at 1, "mode" starts at 0
252 
253 boolean rte_key_valid(int key, boolean is_userkey);
254 boolean rte_keymode_valid(int key, int mode,
255  boolean is_userkey);
256 int rte_keymode_get_filter_idx(int key, int mode);
258 char *rte_keymode_get_filter_name(int key, int mode,
259  boolean add_notes) WARN_UNUSED;
260 char *rte_keymode_get_plugin_name(int key,
261  int mode) WARN_UNUSED;
262 char *rte_keymode_get_type(int key, int mode) WARN_UNUSED;
263 
264 #ifdef HAS_LIVES_EFFECTS_H
265 lives_fx_cat_t rte_keymode_get_category(int key, int mode);
266 #endif
267 
268 weed_plant_t *rte_keymode_get_instance(int key, int mode);
269 weed_plant_t *rte_keymode_get_filter(int key, int mode);
270 
271 boolean weed_delete_effectkey(int key, int mode);
272 int weed_add_effectkey(int key, const char *hashname,
273  boolean fullname);
274 
275 int weed_add_effectkey_by_idx(int key, int idx);
276 
277 int rte_key_getmode(int key);
278 int rte_key_getmaxmode(int key);
279 
280 weed_plant_t *get_new_inst_for_keymode(int key, int mode);
281 
282 boolean rte_key_setmode(int key, int newmode);
283 
285 int rte_switch_keymode(int key, int mode, const char *hashname);
286 
288 
289 LiVESList *weed_get_all_names(lives_fx_list_t list_type);
290 int rte_get_numfilters(void);
291 int weed_get_sorted_filter(int i);
292 
294 // key starts at 0
295 
296 void free_key_defaults(int key, int mode);
297 void apply_key_defaults(weed_plant_t *inst, int key, int mode);
298 void write_key_defaults(int fd, int key, int mode);
299 boolean read_key_defaults(int fd, int nparams, int key, int mode, int version);
300 void set_key_defaults(weed_plant_t *inst, int key, int mode);
301 boolean has_key_defaults(void);
302 
304 // 0 based keys
305 void rte_swap_fg_bg(void);
306 
307 int rte_bg_gen_key(void) GNU_PURE;
308 
309 int rte_fg_gen_key(void) GNU_PURE;
310 
311 int rte_bg_gen_mode(void) GNU_PURE;
312 int rte_fg_gen_mode(void) GNU_PURE;
313 
315 
316 char *get_weed_display_string(weed_plant_t *inst, int pnum);
317 weed_plant_t *add_filter_deinit_events(weed_plant_t *event_list);
318 weed_plant_t *add_filter_init_events(weed_plant_t *event_list, ticks_t tc);
319 void deinit_render_effects(void);
320 void deinit_easing_effects(void);
321 
322 boolean write_filter_defaults(int fd, int idx);
323 boolean read_filter_defaults(int fd);
324 
325 boolean write_generator_sizes(int fd, int idx);
326 boolean read_generator_sizes(int fd);
327 
328 //void set_param_gui_readwrite(weed_plant_t *inst);
329 //void set_param_gui_readonly(weed_plant_t *inst);
330 
331 void update_all_host_info(void);
332 
334 void fill_param_vals_to(weed_plant_t *param, weed_plant_t *ptmpl, int fill_slot);
335 
336 //#define DEBUG_FILTER_MUTEXES
337 #ifdef DEBUG_FILTER_MUTEXES
338 #define filter_mutex_lock(key) {g_print ("lock %d at line %d in file %s\n",key,__LINE__,__FILE__); \
339  if (key >= 0 && key < FX_KEYS_MAX) pthread_mutex_lock(&mainw->fx_mutex[key]); g_print("done\n");}
340 #define filter_mutex_unlock(key) {g_print ("unlock %d at line %d in file %s\n\n",key,__LINE__,__FILE__); \
341  if (key >= 0 && key < FX_KEYS_MAX) pthread_mutex_unlock(&mainw->fx_mutex[key]); g_print("done\n");}
342 #endif
343 
344 //#define DEBUG_REFCOUNT
345 #ifdef DEBUG_REFCOUNT
346 #define weed_instance_ref(a) {g_print ("ref %p at line %d in file %s\n",a,__LINE__,__FILE__); _weed_instance_ref(a);}
347 #define weed_instance_unref(a) {g_print ("unref %p at line %d in file %s\n",a,__LINE__,__FILE__); _weed_instance_unref(a);}
348 #define weed_instance_obtain(a,b) _weed_instance_obtain(__LINE__, __FILE__, a, b)
349 #endif
350 
351 int _weed_instance_ref(weed_plant_t *inst);
352 int _weed_instance_unref(weed_plant_t *inst);
353 weed_plant_t *_weed_instance_obtain(int line, char *file, int key, int mode);
354 
355 #ifndef DEBUG_REFCOUNT
356 int weed_instance_ref(weed_plant_t *inst);
357 int weed_instance_unref(weed_plant_t *inst);
358 weed_plant_t *weed_instance_obtain(int key, int mode);
359 #endif
360 
361 #define WEED_ERROR_NOSUCH_PLANT 65536
362 
363 weed_plant_t *host_info_cb(weed_plant_t *xhost_info, void *data);
364 
365 weed_error_t weed_leaf_set_host(weed_plant_t *plant, const char *key, uint32_t seed_type, weed_size_t num_elems, void *value);
366 weed_error_t weed_leaf_delete_host(weed_plant_t *plant, const char *key);
367 weed_error_t weed_plant_free_host(weed_plant_t *plant);
368 weed_plant_t *weed_plant_new_host(int type);
369 //weed_error_t weed_leaf_get_monitor(weed_plant_t *plant, const char *key, int32_t idx, void *value);
370 
371 void show_weed_stats(weed_plant_t *statsplant);
372 
373 #endif
weed_filter_idx_get_name
char * weed_filter_idx_get_name(int idx, boolean add_subcats, boolean add_notes) WARN_UNUSED
Definition: effects-weed.c:9475
has_perchannel_multiw
boolean has_perchannel_multiw(weed_plant_t *filter)
Definition: effects-weed.c:8706
weed_leaf_copy_or_delete
weed_error_t weed_leaf_copy_or_delete(weed_layer_t *dlayer, const char *key, weed_layer_t *slayer)
Definition: effects-weed.c:68
get_nth_simple_param
int get_nth_simple_param(weed_plant_t *, int pnum)
Definition: effects-weed.c:8850
deinit_render_effects
void deinit_render_effects(void)
switch off effects after render preview during rendering/render preview, we use the "keys" FX_KEYS_MA...
Definition: effects-weed.c:7358
has_audio_chans_in
boolean has_audio_chans_in(weed_plant_t *filter, boolean count_opt)
Definition: effects-weed.c:640
weed_get_all_names
LiVESList * weed_get_all_names(lives_fx_list_t list_type)
Definition: effects-weed.c:9865
_weed_instance_obtain
weed_plant_t * _weed_instance_obtain(int line, char *file, int key, int mode)
Definition: effects-weed.c:6212
has_audio_filters
boolean has_audio_filters(lives_af_t af_type)
Definition: effects-weed.c:3859
_wood_instance_obtain
weed_plant_t * _wood_instance_obtain(int line, char *file, int key, int mode)
add_filter_deinit_events
weed_plant_t * add_filter_deinit_events(weed_plant_t *event_list)
add effect_deinit events to an event_list
Definition: effects-weed.c:803
weed_delete_effectkey
boolean weed_delete_effectkey(int key, int mode)
unbinds a filter_class from a key/mode
Definition: effects-weed.c:9326
FX_LIST_HASHNAME
@ FX_LIST_HASHNAME
Definition: effects-weed.h:47
weed_apply_audio_effects_rt
void weed_apply_audio_effects_rt(weed_layer_t *alayer, ticks_t tc, boolean analysers_only, boolean is_audio_thread)
weed_call_init_func
weed_error_t weed_call_init_func(weed_plant_t *instance)
Definition: effects-weed.c:7044
rte_key_setmode
boolean rte_key_setmode(int key, int newmode)
set mode for a given key; if key==0 then the active key is used
Definition: effects-weed.c:9626
weed_instance_unref
int weed_instance_unref(weed_plant_t *inst)
Definition: effects-weed.c:6234
version
const char * version(void)
rte_fg_gen_mode
int rte_fg_gen_mode(void) GNU_PURE
Definition: effects-weed.c:9568
add_filter_init_events
weed_plant_t * add_filter_init_events(weed_plant_t *event_list, ticks_t tc)
free_key_defaults
void free_key_defaults(int key, int mode)
Definition: effects-weed.c:12396
read_filter_defaults
boolean read_filter_defaults(int fd)
Definition: effects-weed.c:11921
weed_parameter_has_variable_elements_strict
boolean weed_parameter_has_variable_elements_strict(weed_plant_t *inst, weed_plant_t *ptmpl)
Definition: effects-weed.c:724
get_weed_display_string
char * get_weed_display_string(weed_plant_t *inst, int pnum)
weed_filter_in_paramtmpl
weed_plant_t * weed_filter_in_paramtmpl(weed_plant_t *filter, int param_num, boolean skip_internal)
Definition: effects-weed.c:8795
FILTER_ERROR_INVALID_TRACK
@ FILTER_ERROR_INVALID_TRACK
Definition: effects-weed.h:25
weed_call_deinit_func
weed_error_t weed_call_deinit_func(weed_plant_t *instance)
Definition: effects-weed.c:7067
weed_instance_ref
int weed_instance_ref(weed_plant_t *inst)
Definition: effects-weed.c:6230
weed_apply_audio_instance
lives_filter_error_t weed_apply_audio_instance(weed_plant_t *init_event, weed_layer_t **layers, int nbtracks, int nchans, int64_t nsamps, double arate, ticks_t tc, double *vis)
is_perchannel_multiw
boolean is_perchannel_multiw(weed_plant_t *param)
Definition: effects-weed.c:8693
FILTER_ERROR_INVALID_PLUGIN
@ FILTER_ERROR_INVALID_PLUGIN
Definition: effects-weed.h:22
weed_instance_is_resizer
boolean weed_instance_is_resizer(weed_plant_t *filt)
Definition: effects-weed.c:571
FX_LIST_EXTENDED_NAME
@ FX_LIST_EXTENDED_NAME
Definition: effects-weed.h:46
rte_swap_fg_bg
void rte_swap_fg_bg(void)
Definition: effects-weed.c:9844
GNU_PURE
#define GNU_PURE
Definition: main.h:78
rte_keymode_get_category
lives_fx_cat_t rte_keymode_get_category(int key, int mode)
Definition: effects-weed.c:9290
FILTER_ERROR_DONT_THREAD
@ FILTER_ERROR_DONT_THREAD
Definition: effects-weed.h:35
weed_plant_deserialise
weed_plant_t * weed_plant_deserialise(int fd, unsigned char **mem, weed_plant_t *plant)
Definition: effects-weed.c:11770
weed_apply_instance
lives_filter_error_t weed_apply_instance(weed_plant_t *inst, weed_plant_t *init_event, weed_plant_t **layers, int opwidth, int opheight, ticks_t tc)
enabled_in_channels
int enabled_in_channels(weed_plant_t *plant, boolean count_repeats)
Definition: effects-weed.c:3985
weed_in_params_free
void weed_in_params_free(weed_plant_t **parameters, int num_parameters)
Definition: effects-weed.c:6110
FILTER_SUCCESS
@ FILTER_SUCCESS
Definition: effects-weed.h:15
get_next_free_key
int get_next_free_key(void)
next free "key" for the multitrack system
Definition: effects-weed.c:9311
rte_keymode_get_filter_idx
int rte_keymode_get_filter_idx(int key, int mode)
returns filter_class index of key/mode (or -1 if no filter bound)
Definition: effects-weed.c:9416
lives_fx_cat_t
lives_fx_cat_t
Definition: effects.h:11
weed_playback_gen_start
boolean weed_playback_gen_start(void)
Definition: effects-weed.c:8332
lives_fx_list_t
lives_fx_list_t
Definition: effects-weed.h:44
get_weed_filter
weed_plant_t * get_weed_filter(int filter_idx)
Definition: effects-weed.c:11014
weed_apply_effects
weed_plant_t * weed_apply_effects(weed_plant_t **layers, weed_plant_t *filter_map, ticks_t tc, int opwidth, int opheight, void ***pchains)
write_filter_defaults
boolean write_filter_defaults(int fd, int idx)
Definition: effects-weed.c:11874
FILTER_ERROR_IS_SCRAP_FILE
@ FILTER_ERROR_IS_SCRAP_FILE
Definition: effects-weed.h:31
ticks_t
int64_t ticks_t
Definition: main.h:97
weed_instance_from_filter
weed_plant_t * weed_instance_from_filter(weed_plant_t *filter)
Definition: effects-weed.c:6469
run_process_func
lives_filter_error_t run_process_func(weed_plant_t *instance, weed_timecode_t tc, int key)
Definition: effects-weed.c:2799
weed_get_blend_factor
int weed_get_blend_factor(int hotkey)
Definition: effects-weed.c:9169
weed_filter_idx_get_package_name
char * weed_filter_idx_get_package_name(int filter_idx) WARN_UNUSED
Definition: effects-weed.c:9510
apply_key_defaults
void apply_key_defaults(weed_plant_t *inst, int key, int mode)
Definition: effects-weed.c:12342
rte_keymode_get_filter_name
char * rte_keymode_get_filter_name(int key, int mode, boolean add_notes) WARN_UNUSED
returns name of filter_class bound to key/mode (or "")
Definition: effects-weed.c:9531
get_enabled_channel
weed_plant_t * get_enabled_channel(weed_plant_t *inst, int which, boolean is_in)
for FILTER_INST
Definition: effects-weed.c:536
rte_keymode_valid
boolean rte_keymode_valid(int key, int mode, boolean is_userkey)
returns TRUE if a filter_class is bound to key/mode, is_userkey should be set to TRUE
Definition: effects-weed.c:9407
interpolate_params
boolean interpolate_params(weed_plant_t *inst, void **pchains, ticks_t tc)
weed_inst_in_param
weed_plant_t * weed_inst_in_param(weed_plant_t *inst, int param_num, boolean skip_hidden, boolean skip_internal)
Definition: effects-weed.c:8724
is_hidden_param
boolean is_hidden_param(weed_plant_t *, int i)
returns the permanent (structural) state c.f check_hidden_gui() which sets flag values for params lin...
Definition: effects-weed.c:8587
FILTER_ERROR_INVALID_INSTANCE
@ FILTER_ERROR_INVALID_INSTANCE
Definition: effects-weed.h:27
rte_get_numfilters
int rte_get_numfilters(void)
Definition: effects-weed.c:9899
_wood_instance_ref
int _wood_instance_ref(weed_plant_t *inst)
lives_rfx_t
Definition: plugins.h:625
restore_weed_instances
void restore_weed_instances(void)
Definition: effects-weed.c:423
lives_af_t
lives_af_t
audio filter type (any, analyser only, non analyser only)
Definition: effects.h:40
weed_flagset_array_count
int weed_flagset_array_count(weed_plant_t **array, boolean set_readonly)
Definition: effects-weed.c:1136
weed_add_effectkey_by_idx
int weed_add_effectkey_by_idx(int key, int idx)
see description
Definition: effects-weed.c:9747
FILTER_ERROR_MISSING_CHANNEL
@ FILTER_ERROR_MISSING_CHANNEL
Definition: effects-weed.h:32
has_non_alpha_palette
boolean has_non_alpha_palette(weed_plant_t *ctmpl, weed_plant_t *filter)
Definition: effects-weed.c:143
filter_mutex_unlock
int filter_mutex_unlock(int key)
Definition: effects-weed.c:108
get_enabled_audio_channel
weed_plant_t * get_enabled_audio_channel(weed_plant_t *inst, int which, boolean is_in)
for FILTER_INST
Definition: effects-weed.c:542
get_master_vol_param
int get_master_vol_param(weed_plant_t *filter, boolean skip_internal)
Definition: effects-weed.c:8673
weed_plant_free_host
weed_error_t weed_plant_free_host(weed_plant_t *plant)
Definition: effects-weed.c:4339
weed_set_blend_factor
void weed_set_blend_factor(int hotkey)
Definition: effects-weed.c:9039
weed_instance_get_filter
weed_plant_t * weed_instance_get_filter(weed_plant_t *inst, boolean get_compound_parent)
Definition: effects-weed.c:180
get_mandatory_channel
weed_plant_t * get_mandatory_channel(weed_plant_t *filter, int which, boolean is_in)
for FILTER_CLASS
Definition: effects-weed.c:548
get_new_inst_for_keymode
weed_plant_t * get_new_inst_for_keymode(int key, int mode)
get new refcounted inst (during recording playback)
Definition: effects-weed.c:9225
has_video_chans_out
boolean has_video_chans_out(weed_plant_t *filter, boolean count_opt)
Definition: effects-weed.c:676
has_usable_palette
boolean has_usable_palette(weed_plant_t *chantmpl)
Definition: effects-weed.c:3976
weed_instance_obtain
weed_plant_t * weed_instance_obtain(int key, int mode)
Definition: effects-weed.c:6238
weed_leaf_set_host
weed_error_t weed_leaf_set_host(weed_plant_t *plant, const char *key, uint32_t seed_type, weed_size_t num_elems, void *value)
Definition: effects-weed.c:4371
num_out_params
int num_out_params(weed_plant_t *)
Definition: effects-weed.c:3960
rte_bg_gen_key
int rte_bg_gen_key(void) GNU_PURE
Definition: effects-weed.c:9556
has_audio_chans_out
boolean has_audio_chans_out(weed_plant_t *filter, boolean count_opt)
Definition: effects-weed.c:695
GNU_CONST
#define GNU_CONST
Definition: main.h:79
FILTER_ERROR_BLANK_FRAME
@ FILTER_ERROR_BLANK_FRAME
Definition: effects-weed.h:17
read_key_defaults
boolean read_key_defaults(int fd, int nparams, int key, int mode, int version)
Definition: effects-weed.c:12232
rte_keymode_get_instance
weed_plant_t * rte_keymode_get_instance(int key, int mode)
returns refcounted filter_instance bound to key/mode (or NULL)
Definition: effects-weed.c:9450
best_palette_match
int best_palette_match(int *palete_list, int num_palettes, int palette)
check palette vs.
Definition: effects-weed.c:868
filter_mutex_lock
int filter_mutex_lock(int key)
Definition: effects-weed.c:96
rte_fg_gen_key
int rte_fg_gen_key(void) GNU_PURE
Definition: effects-weed.c:9560
rte_key_getmode
int rte_key_getmode(int key)
returns current active mode for a key (or -1)
Definition: effects-weed.c:9424
rte_switch_keymode
int rte_switch_keymode(int key, int mode, const char *hashname)
Definition: effects-weed.c:9791
lives_filter_error_t
lives_filter_error_t
filter apply errors
Definition: effects-weed.h:14
read_generator_sizes
boolean read_generator_sizes(int fd)
Definition: effects-weed.c:12092
_weed_instance_ref
int _weed_instance_ref(weed_plant_t *inst)
Definition: effects-weed.c:6194
FILTER_ERROR_INVALID_PALETTE_CONVERSION
@ FILTER_ERROR_INVALID_PALETTE_CONVERSION
Definition: effects-weed.h:19
FILTER_ERROR_MISSING_LAYER
@ FILTER_ERROR_MISSING_LAYER
Definition: effects-weed.h:16
FILTER_INFO_REDRAWN
@ FILTER_INFO_REDRAWN
Definition: effects-weed.h:41
FILTER_ERROR_COULD_NOT_REINIT
@ FILTER_ERROR_COULD_NOT_REINIT
Definition: effects-weed.h:21
weed_get_idx_for_hashname
int weed_get_idx_for_hashname(const char *hashname, boolean fullname) GNU_CONST
fullname includes author and version
Definition: effects-weed.c:10840
palette
_palette * palette
interface colour settings
Definition: main.c:101
num_compound_fx
int num_compound_fx(weed_plant_t *plant)
return number of filters in a compound fx (1 if it is not compound) - works for filter or inst
Definition: effects-weed.c:132
FILTER_ERROR_TEMPLATE_MISMATCH
@ FILTER_ERROR_TEMPLATE_MISMATCH
Definition: effects-weed.h:33
deinit_easing_effects
void deinit_easing_effects(void)
switch off effects in easing out state after playback ends during playback, some effects don't deinit...
Definition: effects-weed.c:7381
rte_keymode_get_plugin_name
char * rte_keymode_get_plugin_name(int key, int mode) WARN_UNUSED
returns name of plugin package containing filter_class (or "")
Definition: effects-weed.c:9540
num_alpha_channels
int num_alpha_channels(weed_plant_t *filter, boolean out)
Definition: effects-weed.c:321
has_alpha_palette
boolean has_alpha_palette(weed_plant_t *ctmpl, weed_plant_t *filter)
Definition: effects-weed.c:162
weed_filter_subcategorise
lives_fx_cat_t weed_filter_subcategorise(weed_plant_t *pl, lives_fx_cat_t category, boolean count_opt)
Definition: effects-weed.c:290
is_audio_channel_in
boolean is_audio_channel_in(weed_plant_t *inst, int chnum)
Definition: effects-weed.c:577
weed_layer_t
weed_plant_t weed_layer_t
Definition: colourspace.h:71
rte_bg_gen_mode
int rte_bg_gen_mode(void) GNU_PURE
Definition: effects-weed.c:9564
weed_filter_highest_version
int weed_filter_highest_version(const char *pkg, const char *fxname, const char *auth, int *return_version)
Definition: effects-weed.c:10994
weed_get_sorted_filter
int weed_get_sorted_filter(int i)
Definition: effects-weed.c:9862
make_weed_hashname
char * make_weed_hashname(int filter_idx, boolean fullname, boolean use_extra_authors, char sep, boolean spc_to_underscore) WARN_UNUSED
fullname includes author and version
Definition: effects-weed.c:10730
weed_reinit_all
void weed_reinit_all(void)
Definition: effects-weed.c:1288
weed_filter_categorise
lives_fx_cat_t weed_filter_categorise(weed_plant_t *pl, int in_channels, int out_channels)
Definition: effects-weed.c:243
is_audio_channel_out
boolean is_audio_channel_out(weed_plant_t *inst, int chnum)
Definition: effects-weed.c:656
weed_deinit_effect
boolean weed_deinit_effect(int hotkey)
hotkey starts at 1
Definition: effects-weed.c:7094
WARN_UNUSED
#define WARN_UNUSED
Definition: main.h:77
weed_plant_new_host
weed_plant_t * weed_plant_new_host(int type)
weed_params_create
weed_plant_t ** weed_params_create(weed_plant_t *filter, boolean in)
Definition: effects-weed.c:6318
wge_inner
void wge_inner(weed_plant_t *inst)
deinit and instance(s) for generator, reset instance mapping
Definition: effects-weed.c:8154
weed_get_indices_from_template
int * weed_get_indices_from_template(const char *package_name, const char *filter_name, const char *author, int version)
generate a list of filter indices from a given template.
Definition: effects-weed.c:10958
update_all_host_info
void update_all_host_info(void)
Definition: effects-weed.c:478
weed_unload_all
void weed_unload_all(void)
unload all effects
Definition: effects-weed.c:5966
show_weed_stats
void show_weed_stats(weed_plant_t *statsplant)
Definition: effects-weed.c:4476
weed_plant_serialise
size_t weed_plant_serialise(int fd, weed_plant_t *plant, unsigned char **mem)
Definition: effects-weed.c:11198
weed_functions_init
void weed_functions_init(void)
call weed_init() to set our weed core functions
weed_init_effect
boolean weed_init_effect(int hotkey)
hotkey starts at 1
Definition: effects-weed.c:6596
has_key_defaults
boolean has_key_defaults(void)
Definition: effects-weed.c:12450
fill_param_vals_to
void fill_param_vals_to(weed_plant_t *param, weed_plant_t *ptmpl, int fill_slot)
add default filler values to a parameter or pchange.
Definition: effects-weed.c:9913
weed_deinit_all
void weed_deinit_all(boolean shutdown)
deinit all active effects
Definition: effects-weed.c:7404
FILTER_ERROR_BUSY
@ FILTER_ERROR_BUSY
Definition: effects-weed.h:37
FILTER_ERROR_NEEDS_REINIT
@ FILTER_ERROR_NEEDS_REINIT
Definition: effects-weed.h:23
FILTER_ERROR_MISSING_FRAME
@ FILTER_ERROR_MISSING_FRAME
Definition: effects-weed.h:18
weed_leaf_delete_host
weed_error_t weed_leaf_delete_host(weed_plant_t *plant, const char *key)
Definition: effects-weed.c:4357
weed_load_all
void weed_load_all(void)
load effects
Definition: effects-weed.c:5119
weed_filter_out_paramtmpl
weed_plant_t * weed_filter_out_paramtmpl(weed_plant_t *filter, int param_num)
Definition: effects-weed.c:8831
FILTER_ERROR_MEMORY_ERROR
@ FILTER_ERROR_MEMORY_ERROR
Definition: effects-weed.h:34
FILTER_ERROR_INTERPOLATION_FAILED
@ FILTER_ERROR_INTERPOLATION_FAILED
Definition: effects-weed.h:26
set_copy_to
int set_copy_to(weed_plant_t *inst, int pnum, lives_rfx_t *rfx, boolean update)
Definition: effects-weed.c:8918
FILTER_ERROR_INVALID_FILTER
@ FILTER_ERROR_INVALID_FILTER
Definition: effects-weed.h:28
count_simple_params
int count_simple_params(weed_plant_t *)
Definition: effects-weed.c:8892
FILTER_ERROR_IS_AUDIO
@ FILTER_ERROR_IS_AUDIO
Definition: effects-weed.h:30
weed_bg_generator_end
void weed_bg_generator_end(weed_plant_t *inst)
Definition: effects-weed.c:8318
write_generator_sizes
boolean write_generator_sizes(int fd, int idx)
Definition: effects-weed.c:12038
rte_key_getmaxmode
int rte_key_getmaxmode(int key)
returns highest mode which is set
Definition: effects-weed.c:9433
weed_layer_create_from_generator
weed_plant_t * weed_layer_create_from_generator(weed_plant_t *inst, ticks_t tc, int clipno)
weed_generator_start
int weed_generator_start(weed_plant_t *inst, int key)
Definition: effects-weed.c:7911
get_transition_param
int get_transition_param(weed_plant_t *filter, boolean skip_internal)
Definition: effects-weed.c:8656
FILTER_ERROR_COPYING_FAILED
@ FILTER_ERROR_COPYING_FAILED
Definition: effects-weed.h:36
num_in_params
int num_in_params(weed_plant_t *, boolean skip_hidden, boolean skip_internal)
Definition: effects-weed.c:3920
weed_instance_get_filter_name
char * weed_instance_get_filter_name(weed_plant_t *inst, boolean get_compound_parent) WARN_UNUSED
Definition: effects-weed.c:9519
add_param_connections
void add_param_connections(weed_plant_t *inst)
Definition: effects-weed.c:6431
FX_LIST_NAME
@ FX_LIST_NAME
Definition: effects-weed.h:45
weed_add_effectkey
int weed_add_effectkey(int key, const char *hashname, boolean fullname)
bind a filter_class to key/mode using its hashname
Definition: effects-weed.c:9784
_weed_instance_unref
int _weed_instance_unref(weed_plant_t *inst)
Definition: effects-weed.c:6158
rte_key_valid
boolean rte_key_valid(int key, boolean is_userkey)
returns TRUE if there is a filter bound to active mode of hotkey
Definition: effects-weed.c:9397
interpolate_param
boolean interpolate_param(weed_plant_t *param, void *pchain, ticks_t tc)
parameter interpolation
FILTER_ERROR_NO_IN_CHANNELS
@ FILTER_ERROR_NO_IN_CHANNELS
Definition: effects-weed.h:24
backup_weed_instances
void backup_weed_instances(void)
for multitrack
Definition: effects-weed.c:410
filter_mutex_trylock
int filter_mutex_trylock(int key)
Definition: effects-weed.c:74
set_key_defaults
void set_key_defaults(weed_plant_t *inst, int key, int mode)
Definition: effects-weed.c:12418
has_video_chans_in
boolean has_video_chans_in(weed_plant_t *filter, boolean count_opt)
Definition: effects-weed.c:620
cd_to_plugin_dir
char * cd_to_plugin_dir(weed_plant_t *filter)
change directory to plugin installation dir so it can find any data files
Definition: effects-weed.c:1148
rte_keymode_get_filter
weed_plant_t * rte_keymode_get_filter(int key, int mode)
returns filter_class bound to key/mode (or NULL)
Definition: effects-weed.c:9465
is_pure_audio
boolean is_pure_audio(weed_plant_t *filter_or_instance, boolean count_opt)
TRUE if audio in or out and no vid in/out.
Definition: effects-weed.c:714
enabled_out_channels
int enabled_out_channels(weed_plant_t *plant, boolean count_repeats)
Definition: effects-weed.c:4043
weed_in_parameters_free
void weed_in_parameters_free(weed_plant_t *inst)
Definition: effects-weed.c:6121
get_textparm
weed_plant_t * get_textparm()
for rte textmode, get first string parameter for current key/mode instance we will then forward all k...
Definition: effects-weed.c:9579
has_video_filters
boolean has_video_filters(boolean analysers_only)
Definition: effects-weed.c:3886
rec_param_change
void rec_param_change(weed_plant_t *inst, int pnum)
record a parameter value change in our event_list
Definition: effects-weed.c:9000
write_key_defaults
void write_key_defaults(int fd, int key, int mode)
Definition: effects-weed.c:12369
FILTER_INFO_REINITED
@ FILTER_INFO_REINITED
values >= 512 are info
Definition: effects-weed.h:40
weed_apply_audio_effects
void weed_apply_audio_effects(weed_plant_t *filter_map, weed_layer_t **, int nbtracks, int nchans, int64_t nsamps, double arate, ticks_t tc, double *vis)
FILTER_ERROR_INVALID_INIT_EVENT
@ FILTER_ERROR_INVALID_INIT_EVENT
Definition: effects-weed.h:29
weed_inst_out_param
weed_plant_t * weed_inst_out_param(weed_plant_t *inst, int param_num)
Definition: effects-weed.c:8771
host_info_cb
weed_plant_t * host_info_cb(weed_plant_t *xhost_info, void *data)
Definition: effects-weed.c:4522
weed_generator_end
void weed_generator_end(weed_plant_t *inst)
Definition: effects-weed.c:8176
weed_reinit_effect
lives_filter_error_t weed_reinit_effect(weed_plant_t *inst, boolean reinit_compound)
Definition: effects-weed.c:1169
FILTER_ERROR_UNABLE_TO_RESIZE
@ FILTER_ERROR_UNABLE_TO_RESIZE
Definition: effects-weed.h:20
rte_keymode_get_type
char * rte_keymode_get_type(int key, int mode) WARN_UNUSED
returns a string filter/instance type (or "")
Definition: effects-weed.c:9264
_wood_instance_unref
int _wood_instance_unref(weed_plant_t *inst)