LiVES 1.3.11-svn
Defines | Functions | Variables
src/effects-weed.c File Reference
#include <dlfcn.h>
#include "../libweed/weed.h"
#include "../libweed/weed-palettes.h"
#include "../libweed/weed-effects.h"
#include "../libweed/weed-utils.h"
#include "../libweed/weed-host.h"
#include "main.h"
#include "effects-weed.h"
#include "callbacks.h"
#include "support.h"
#include "rte_window.h"
#include "resample.h"
#include "audio.h"

Defines

#define OIL_MEMCPY_MAX_BYTES   1024
#define MAX_WEED_FILTERS   65536
#define MAX_WEED_INSTANCES   65536
#define KEYSCALE   255.

Functions

void * w_memcpy (void *dest, const void *src, size_t n)
G_GNUC_MALLOC void * lives_weed_malloc (size_t size)
void lives_weed_free (void *ptr)
void * lives_weed_memset (void *s, int c, size_t n)
void * lives_weed_memcpy (void *dest, const void *src, size_t n)
void weed_add_plant_flags (weed_plant_t *plant, int flags)
weed_plant_t * weed_bootstrap_func (weed_default_getter_f *value, int num_versions, int *plugin_versions)
gint weed_filter_categorise (weed_plant_t *pl, int in_channels, int out_channels)
gint weed_filter_subcategorise (weed_plant_t *pl, int category, gboolean count_opt)
gchar * weed_category_to_text (int cat, gboolean plural)
void backup_weed_instances (void)
 for multitrack
void restore_weed_instances (void)
gint step_val (gint val, gint step)
gchar * weed_filter_get_type (gint idx)
void update_host_info (weed_plant_t *inst)
weed_plant_t * get_enabled_channel (weed_plant_t *inst, gint which, gboolean is_in)
 for FILTER_INST
weed_plant_t * get_mandatory_channel (weed_plant_t *filter, gint which, gboolean is_in)
 for FILTER_CLASS
gboolean weed_filter_is_resizer (weed_plant_t *filt)
gboolean weed_instance_is_resizer (weed_plant_t *inst)
gboolean is_audio_channel_in (weed_plant_t *inst, int chnum)
gboolean has_video_chans_in (weed_plant_t *filter, gboolean count_opt)
gboolean has_audio_chans_in (weed_plant_t *filter, gboolean count_opt)
gboolean is_audio_channel_out (weed_plant_t *inst, int chnum)
gboolean has_video_chans_out (weed_plant_t *filter, gboolean count_opt)
gboolean has_audio_chans_out (weed_plant_t *filter, gboolean count_opt)
weed_plant_t * add_filter_deinit_events (weed_plant_t *event_list)
weed_plant_t * add_filter_init_events (weed_plant_t *event_list, weed_timecode_t tc)
int check_weed_palette_list (int *palette_list, int num_palettes, int palette)
void set_param_gui_readonly (weed_plant_t *inst)
void set_param_gui_readwrite (weed_plant_t *inst)
gchar * cd_to_plugin_dir (weed_plant_t *filter)
gint weed_reinit_effect (weed_plant_t *inst, gboolean deinit_first)
void weed_reinit_all (void)
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)
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)
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)
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)
gint num_in_params (weed_plant_t *plant, gboolean count_reinits, gboolean count_variable)
gboolean has_usable_palette (weed_plant_t *chantmpl)
gint enabled_in_channels (weed_plant_t *plant, gboolean count_repeats)
gint enabled_out_channels (weed_plant_t *plant, gboolean count_repeats)
void weed_memory_init (void)
 call weed_init() with mem functions
void weed_load_all (void)
 load effects
void weed_filter_free (weed_plant_t *filter)
void weed_unload_all (void)
 unload all effects
void weed_instance_unref (weed_plant_t *inst)
void weed_instance_ref (weed_plant_t *inst)
void weed_generator_end (weed_plant_t *inst)
weed_plant_t ** weed_params_create (weed_plant_t *filter, gboolean in)
weed_plant_t * weed_instance_from_filter (weed_plant_t *filter)
gboolean weed_init_effect (int hotkey)
 hotkey starts at 1
void weed_call_init_func (weed_plant_t *inst)
void weed_call_deinit_func (weed_plant_t *instance)
void weed_deinit_effect (int hotkey)
 hotkey starts at 1
void deinit_render_effects (void)
void weed_deinit_all (void)
 deinit all active effects
weed_plant_t * weed_layer_new_from_generator (weed_plant_t *inst, weed_timecode_t tc)
gboolean weed_generator_start (weed_plant_t *inst)
void weed_bg_generator_end (weed_plant_t *inst)
gboolean weed_playback_gen_start (void)
gboolean is_hidden_param (weed_plant_t *plant, int i)
int get_transition_param (weed_plant_t *filter)
int get_master_vol_param (weed_plant_t *filter)
gboolean is_perchannel_multiw (weed_plant_t *param)
gboolean has_perchannel_multiw (weed_plant_t *filter)
weed_plant_t * weed_inst_in_param (weed_plant_t *inst, int param_num, gboolean skip_hidden)
int get_nth_simple_param (weed_plant_t *plant, int pnum)
int count_simple_params (weed_plant_t *plant)
char * get_weed_display_string (weed_plant_t *inst, int pnum)
void rec_param_change (weed_plant_t *inst, int pnum)
 record a parameter value change in our event_list
void weed_set_blend_factor (int hotkey)
gint weed_get_blend_factor (int hotkey)
gchar * rte_keymode_get_type (gint key, gint mode)
 returns a string filter/instance type (or "")
int get_next_free_key (void)
 next free "key" for the multitrack system
gboolean weed_delete_effectkey (gint key, gint mode)
 unbinds a filter_class from a key/mode
gboolean rte_key_valid (int key, gboolean is_userkey)
gboolean rte_keymode_valid (gint key, gint mode, gboolean is_userkey)
 returns TRUE if a filter_class is bound to key/mode
gint rte_keymode_get_filter_idx (gint key, gint mode)
 returns filter_class index of key/mode (or -1 if no filter bound)
int rte_key_getmode (gint key)
 returns current active mode for a key (or -1)
int rte_key_getmaxmode (gint key)
 returns highest mode which is set
weed_plant_t * rte_keymode_get_instance (gint key, gint mode)
 returns filter_instance bound to key/mode (or NULL)
weed_plant_t * rte_keymode_get_filter (gint key, gint mode)
 returns filter_class bound to key/mode (or NULL)
gchar * weed_filter_get_name (gint idx)
gchar * rte_keymode_get_filter_name (gint key, gint mode)
 returns name of filter_class bound to key/mode (or "")
gchar * rte_keymode_get_plugin_name (gint key, gint mode)
 returns name of plugin package containing filter_class (or "")
G_GNUC_PURE int rte_getmodespk (void)
G_GNUC_PURE gint rte_bg_gen_key (void)
G_GNUC_PURE gint rte_fg_gen_key (void)
G_GNUC_PURE gint rte_bg_gen_mode (void)
G_GNUC_PURE gint rte_fg_gen_mode (void)
weed_plant_t * get_textparm ()
gboolean rte_key_setmode (gint key, gint newmode)
 set mode for a given key; if key==0 then the active key is used
int weed_add_effectkey_by_idx (gint key, int idx)
 see description
int weed_add_effectkey (gint key, const gchar *hashname, gboolean fullname)
 bind a filter_class to key/mode using its hashname
gint rte_switch_keymode (gint key, gint mode, const gchar *hashname)
void rte_swap_fg_bg (void)
GList * weed_get_all_names (gshort list_type)
gint rte_get_numfilters (void)
void fill_param_vals_to (weed_plant_t *paramtmpl, weed_plant_t *param, int pnum, int hint, int index)
 add default filler values to a parameter or pchange.
gboolean interpolate_param (weed_plant_t *inst, int i, void *pchain, weed_timecode_t tc)
 parameter interpolation
gboolean interpolate_params (weed_plant_t *inst, void **pchains, weed_timecode_t tc)
gchar * make_weed_hashname (int filter_idx, gboolean fullname)
 fullname includes author and version
int weed_get_idx_for_hashname (const gchar *hashname, gboolean fullname)
 fullname includes author and version
weed_plant_t * get_weed_filter (int idx)
gboolean weed_plant_serialise (int fd, weed_plant_t *plant, unsigned char **mem)
weed_plant_t * weed_plant_deserialise (int fd, unsigned char **mem)
void write_filter_defaults (int fd, int idx)
void read_filter_defaults (int fd)
void write_generator_sizes (int fd, int idx)
void read_generator_sizes (int fd)
void reset_frame_and_clip_index (void)
void read_key_defaults (int fd, int nparams, int key, int mode, int ver)
void apply_key_defaults (weed_plant_t *inst, gint key, gint mode)
void write_key_defaults (int fd, gint key, gint mode)
void free_key_defaults (gint key, gint mode)
void set_key_defaults (weed_plant_t *inst, gint key, gint mode)
gboolean has_key_defaults (void)

Variables

weed_default_getter_f wdg
weed_leaf_get_f wlg
weed_plant_new_f wpn
weed_plant_list_leaves_f wpll
weed_leaf_num_elements_f wlne
weed_leaf_element_size_f wles
weed_leaf_seed_type_f wlst
weed_leaf_get_flags_f wlgf
weed_leaf_set_f wls
weed_malloc_f weedmalloc
weed_free_f weedfree
weed_memcpy_f weedmemcpy
weed_memset_f weedmemset
weed_plant_t *** key_defaults [FX_KEYS_MAX_VIRTUAL]

Define Documentation

#define KEYSCALE   255.
#define MAX_WEED_FILTERS   65536
#define MAX_WEED_INSTANCES   65536
#define OIL_MEMCPY_MAX_BYTES   1024

Function Documentation

weed_plant_t* add_filter_deinit_events ( weed_plant_t *  event_list)
weed_plant_t* add_filter_init_events ( weed_plant_t *  event_list,
weed_timecode_t  tc 
)
void apply_key_defaults ( weed_plant_t *  inst,
gint  key,
gint  mode 
)
void backup_weed_instances ( void  )

for multitrack

gchar* cd_to_plugin_dir ( weed_plant_t *  filter)

change directory to plugin installation dir so it can find any data files

returns copy of current directory (before directory change) which should be freed after use

int check_weed_palette_list ( int *  palette_list,
int  num_palettes,
int  palette 
)
int count_simple_params ( weed_plant_t *  plant)
void deinit_render_effects ( void  )
gint enabled_in_channels ( weed_plant_t *  plant,
gboolean  count_repeats 
)
gint enabled_out_channels ( weed_plant_t *  plant,
gboolean  count_repeats 
)
void fill_param_vals_to ( weed_plant_t *  paramtmpl,
weed_plant_t *  param,
int  pnum,
int  hint,
int  index 
)

add default filler values to a parameter or pchange.

void free_key_defaults ( gint  key,
gint  mode 
)
weed_plant_t* get_enabled_channel ( weed_plant_t *  inst,
gint  which,
gboolean  is_in 
)

for FILTER_INST

weed_plant_t* get_mandatory_channel ( weed_plant_t *  filter,
gint  which,
gboolean  is_in 
)

for FILTER_CLASS

int get_master_vol_param ( weed_plant_t *  filter)
int get_next_free_key ( void  )

next free "key" for the multitrack system

int get_nth_simple_param ( weed_plant_t *  plant,
int  pnum 
)
weed_plant_t* get_textparm ( )
int get_transition_param ( weed_plant_t *  filter)
char* get_weed_display_string ( weed_plant_t *  inst,
int  pnum 
)
weed_plant_t* get_weed_filter ( int  idx)
gboolean has_audio_chans_in ( weed_plant_t *  filter,
gboolean  count_opt 
)
gboolean has_audio_chans_out ( weed_plant_t *  filter,
gboolean  count_opt 
)
gboolean has_key_defaults ( void  )
gboolean has_perchannel_multiw ( weed_plant_t *  filter)
gboolean has_usable_palette ( weed_plant_t *  chantmpl)
gboolean has_video_chans_in ( weed_plant_t *  filter,
gboolean  count_opt 
)
gboolean has_video_chans_out ( weed_plant_t *  filter,
gboolean  count_opt 
)
gboolean interpolate_param ( weed_plant_t *  inst,
int  i,
void *  pchain,
weed_timecode_t  tc 
)

parameter interpolation

gboolean interpolate_params ( weed_plant_t *  inst,
void **  pchains,
weed_timecode_t  tc 
)
gboolean is_audio_channel_in ( weed_plant_t *  inst,
int  chnum 
)
gboolean is_audio_channel_out ( weed_plant_t *  inst,
int  chnum 
)
gboolean is_hidden_param ( weed_plant_t *  plant,
int  i 
)
gboolean is_perchannel_multiw ( weed_plant_t *  param)
void lives_weed_free ( void *  ptr)
G_GNUC_MALLOC void* lives_weed_malloc ( size_t  size)
void* lives_weed_memcpy ( void *  dest,
const void *  src,
size_t  n 
)
void* lives_weed_memset ( void *  s,
int  c,
size_t  n 
)
gchar* make_weed_hashname ( int  filter_idx,
gboolean  fullname 
)

fullname includes author and version

gint num_in_params ( weed_plant_t *  plant,
gboolean  count_reinits,
gboolean  count_variable 
)
void read_filter_defaults ( int  fd)
void read_generator_sizes ( int  fd)
void read_key_defaults ( int  fd,
int  nparams,
int  key,
int  mode,
int  ver 
)
void rec_param_change ( weed_plant_t *  inst,
int  pnum 
)

record a parameter value change in our event_list

void reset_frame_and_clip_index ( void  )
void restore_weed_instances ( void  )
G_GNUC_PURE gint rte_bg_gen_key ( void  )
G_GNUC_PURE gint rte_bg_gen_mode ( void  )
G_GNUC_PURE gint rte_fg_gen_key ( void  )
G_GNUC_PURE gint rte_fg_gen_mode ( void  )
gint rte_get_numfilters ( void  )
G_GNUC_PURE int rte_getmodespk ( void  )
int rte_key_getmaxmode ( gint  key)

returns highest mode which is set

int rte_key_getmode ( gint  key)

returns current active mode for a key (or -1)

gboolean rte_key_setmode ( gint  key,
gint  newmode 
)

set mode for a given key; if key==0 then the active key is used

returns -1 if the filter is not found; it will match the first name found - returns -2 if you try to switch a generator/non-generator

gboolean rte_key_valid ( int  key,
gboolean  is_userkey 
)
weed_plant_t* rte_keymode_get_filter ( gint  key,
gint  mode 
)

returns filter_class bound to key/mode (or NULL)

gint rte_keymode_get_filter_idx ( gint  key,
gint  mode 
)

returns filter_class index of key/mode (or -1 if no filter bound)

gchar* rte_keymode_get_filter_name ( gint  key,
gint  mode 
)

returns name of filter_class bound to key/mode (or "")

weed_plant_t* rte_keymode_get_instance ( gint  key,
gint  mode 
)

returns filter_instance bound to key/mode (or NULL)

gchar* rte_keymode_get_plugin_name ( gint  key,
gint  mode 
)

returns name of plugin package containing filter_class (or "")

gchar* rte_keymode_get_type ( gint  key,
gint  mode 
)

returns a string filter/instance type (or "")

gboolean rte_keymode_valid ( gint  key,
gint  mode,
gboolean  is_userkey 
)

returns TRUE if a filter_class is bound to key/mode

void rte_swap_fg_bg ( void  )
gint rte_switch_keymode ( gint  key,
gint  mode,
const gchar *  hashname 
)
void set_key_defaults ( weed_plant_t *  inst,
gint  key,
gint  mode 
)
void set_param_gui_readonly ( weed_plant_t *  inst)
void set_param_gui_readwrite ( weed_plant_t *  inst)
gint step_val ( gint  val,
gint  step 
) [inline]
void update_host_info ( weed_plant_t *  inst)
void* w_memcpy ( void *  dest,
const void *  src,
size_t  n 
) [inline]
int weed_add_effectkey ( gint  key,
const gchar *  hashname,
gboolean  fullname 
)

bind a filter_class to key/mode using its hashname

int weed_add_effectkey_by_idx ( gint  key,
int  idx 
)

see description

void weed_add_plant_flags ( weed_plant_t *  plant,
int  flags 
)
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 
)
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 
)
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 
)
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 
)
void weed_bg_generator_end ( weed_plant_t *  inst)
weed_plant_t* weed_bootstrap_func ( weed_default_getter_f *  value,
int  num_versions,
int *  plugin_versions 
)
void weed_call_deinit_func ( weed_plant_t *  instance)
void weed_call_init_func ( weed_plant_t *  inst)
gchar* weed_category_to_text ( int  cat,
gboolean  plural 
)
void weed_deinit_all ( void  )

deinit all active effects

void weed_deinit_effect ( int  hotkey)

hotkey starts at 1

gboolean weed_delete_effectkey ( gint  key,
gint  mode 
)

unbinds a filter_class from a key/mode

gint weed_filter_categorise ( weed_plant_t *  pl,
int  in_channels,
int  out_channels 
)
void weed_filter_free ( weed_plant_t *  filter)
gchar* weed_filter_get_name ( gint  idx)
gchar* weed_filter_get_type ( gint  idx)
gboolean weed_filter_is_resizer ( weed_plant_t *  filt)
gint weed_filter_subcategorise ( weed_plant_t *  pl,
int  category,
gboolean  count_opt 
)
void weed_generator_end ( weed_plant_t *  inst)
gboolean weed_generator_start ( weed_plant_t *  inst)
GList* weed_get_all_names ( gshort  list_type)
gint weed_get_blend_factor ( int  hotkey)
int weed_get_idx_for_hashname ( const gchar *  hashname,
gboolean  fullname 
)

fullname includes author and version

gboolean weed_init_effect ( int  hotkey)

hotkey starts at 1

weed_plant_t* weed_inst_in_param ( weed_plant_t *  inst,
int  param_num,
gboolean  skip_hidden 
)
weed_plant_t* weed_instance_from_filter ( weed_plant_t *  filter)
gboolean weed_instance_is_resizer ( weed_plant_t *  inst)
void weed_instance_ref ( weed_plant_t *  inst)
void weed_instance_unref ( weed_plant_t *  inst)
weed_plant_t* weed_layer_new_from_generator ( weed_plant_t *  inst,
weed_timecode_t  tc 
)
void weed_load_all ( void  )

load effects

void weed_memory_init ( void  )

call weed_init() with mem functions

weed_plant_t** weed_params_create ( weed_plant_t *  filter,
gboolean  in 
)
weed_plant_t* weed_plant_deserialise ( int  fd,
unsigned char **  mem 
)
gboolean weed_plant_serialise ( int  fd,
weed_plant_t *  plant,
unsigned char **  mem 
)
gboolean weed_playback_gen_start ( void  )
void weed_reinit_all ( void  )
gint weed_reinit_effect ( weed_plant_t *  inst,
gboolean  deinit_first 
)
void weed_set_blend_factor ( int  hotkey)
void weed_unload_all ( void  )

unload all effects

void write_filter_defaults ( int  fd,
int  idx 
)
void write_generator_sizes ( int  fd,
int  idx 
)
void write_key_defaults ( int  fd,
gint  key,
gint  mode 
)

Variable Documentation

weed_plant_t*** key_defaults[FX_KEYS_MAX_VIRTUAL]
weed_default_getter_f wdg
weed_free_f weedfree
weed_malloc_f weedmalloc
weed_memcpy_f weedmemcpy
weed_memset_f weedmemset
weed_leaf_element_size_f wles
weed_leaf_get_f wlg
weed_leaf_get_flags_f wlgf
weed_leaf_num_elements_f wlne
weed_leaf_set_f wls
weed_leaf_seed_type_f wlst
weed_plant_list_leaves_f wpll
weed_plant_new_f wpn
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines