LiVES  1.6.4-svn
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
effects-weed.h
Go to the documentation of this file.
1 // effects-weed.h
2 // LiVES (lives-exe)
3 // (c) G. Finch 2005 - 2012 <salsaman@gmail.com>
4 // Released under the GPL 3 or later
5 // see file ../COPYING for licensing details
6 
7 
8 #ifndef HAS_LIVES_EFFECTS_WEED_H
9 #define HAS_LIVES_EFFECTS_WEED_H
10 
12 typedef enum {
33 
37 
38 
39 // bootstrap function for weed plugins
40 weed_plant_t *weed_bootstrap_func (weed_default_getter_f *value, int num_versions, int *plugin_versions);
41 
42 weed_plant_t *get_weed_filter(int filter_idx);
43 gchar *weed_filter_get_name(int filter_idx);
44 gchar *make_weed_hashname(int filter_idx, gboolean fullname) WARN_UNUSED;
45 int weed_get_idx_for_hashname (const gchar *hashname, gboolean fullname);
46 gint enabled_in_channels (weed_plant_t *plant, gboolean count_repeats);
47 gint enabled_out_channels (weed_plant_t *plant, gboolean count_repeats);
48 weed_plant_t *get_enabled_channel (weed_plant_t *inst, gint which, gboolean is_in);
49 weed_plant_t *get_mandatory_channel (weed_plant_t *filter, gint which, gboolean is_in);
50 gboolean weed_filter_is_resizer(weed_plant_t *filt);
51 gboolean weed_instance_is_resizer(weed_plant_t *filt);
52 weed_plant_t *weed_instance_get_filter(weed_plant_t *inst);
53 
54 gboolean is_audio_channel_in(weed_plant_t *inst, int chnum);
55 gboolean has_video_chans_in(weed_plant_t *filter, gboolean count_opt);
56 gboolean has_audio_chans_in(weed_plant_t *filter, gboolean count_opt);
57 gboolean is_audio_channel_out(weed_plant_t *inst, int chnum);
58 gboolean has_video_chans_out(weed_plant_t *filter, gboolean count_opt);
59 gboolean has_audio_chans_out(weed_plant_t *filter, gboolean count_opt);
60 gboolean is_pure_audio(weed_plant_t *filter_or_instance, gboolean count_opt);
61 
62 boolean has_audio_filters(boolean analysers_only);
63 
64 #ifdef HAS_LIVES_EFFECTS_H
65 lives_fx_cat_t weed_filter_categorise (weed_plant_t *pl, int in_channels, int out_channels);
66 lives_fx_cat_t weed_filter_subcategorise (weed_plant_t *pl, lives_fx_cat_t category, gboolean count_opt);
67 #endif
68 
69 gboolean has_usable_palette(weed_plant_t *chantmpl);
70 int check_weed_palette_list (int *palette_list, int num_palettes, int palette);
71 
72 int weed_call_init_func(weed_plant_t *instance);
73 int weed_call_deinit_func(weed_plant_t *instance);
74 
75 gchar *cd_to_plugin_dir(weed_plant_t *filter);
76 gboolean weed_init_effect(int hotkey);
77 void weed_deinit_effect(int hotkey);
78 weed_plant_t *weed_instance_from_filter(weed_plant_t *filter);
79 void weed_instance_ref(weed_plant_t *inst);
80 void weed_instance_unref(weed_plant_t *inst);
81 void weed_in_parameters_free (weed_plant_t *inst);
82 lives_filter_error_t weed_reinit_effect (weed_plant_t *inst);
83 void weed_reinit_all(void);
84 
85 
86 int weed_flagset_array_count(weed_plant_t **array, gboolean set_readonly);
87 
88 int num_in_params(weed_plant_t *, gboolean count_reinits, gboolean count_variable);
89 int num_out_params(weed_plant_t *);
90 weed_plant_t *weed_inst_in_param (weed_plant_t *inst, int param_num, gboolean skip_hidden);
91 gboolean is_hidden_param(weed_plant_t *plant, int i);
92 int get_nth_simple_param(weed_plant_t *plant, int pnum);
93 int count_simple_params(weed_plant_t *plant);
94 weed_plant_t **weed_params_create (weed_plant_t *filter, gboolean in);
95 int get_transition_param(weed_plant_t *filter);
96 int get_master_vol_param(weed_plant_t *filter);
97 gboolean is_perchannel_multiw(weed_plant_t *param);
98 gboolean has_perchannel_multiw(weed_plant_t *filter);
99 gboolean weed_parameter_has_variable_elements_strict(weed_plant_t *inst, weed_plant_t *ptmpl);
100 
101 
103 gboolean interpolate_param(weed_plant_t *inst, int i, void *pchain, weed_timecode_t tc);
104 gboolean interpolate_params(weed_plant_t *inst, void **pchains, weed_timecode_t tc);
105 
106 gboolean weed_plant_serialise(int fd, weed_plant_t *plant, unsigned char **mem);
107 weed_plant_t *weed_plant_deserialise(int fd, unsigned char **mem);
108 
109 
111 void rec_param_change(weed_plant_t *inst, int pnum);
112 
113 // copy values for "copy_value_to" params
114 int set_copy_to(weed_plant_t *inst, int pnum, boolean update);
115 
116 weed_plant_t *get_textparm();
117 
118 void weed_set_blend_factor(int hotkey);
119 gint weed_get_blend_factor(int hotkey);
120 
121 void weed_memory_init(void);
122 
123 void weed_load_all (void);
124 void weed_unload_all(void);
125 int get_next_free_key(void);
126 
127 void weed_deinit_all(gboolean shutdown);
128 
129 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);
130 lives_filter_error_t weed_apply_instance (weed_plant_t *inst, weed_plant_t *init_event, weed_plant_t **layers,
131  int opwidth, int opheight, weed_timecode_t tc);
132 void weed_apply_audio_effects (weed_plant_t *filter_map, float **abuf, int nbtracks, int nchans, int64_t nsamps, gdouble arate,
133  weed_timecode_t tc, double *vis);
134 void weed_apply_audio_effects_rt(float **abuf, int nchans, int64_t nsamps, gdouble arate, weed_timecode_t tc, boolean analysers_only);
135 
136 lives_filter_error_t weed_apply_audio_instance (weed_plant_t *init_event, float **abuf, int nbtracks, int nchans, int64_t nsamps,
137  gdouble arate, weed_timecode_t tc, double *vis);
138 
139 gboolean weed_generator_start (weed_plant_t *inst);
140 weed_plant_t *weed_layer_new_from_generator (weed_plant_t *inst, weed_timecode_t tc);
141 void weed_generator_end (weed_plant_t *inst);
142 gboolean weed_playback_gen_start (void);
143 void weed_bg_generator_end (weed_plant_t *inst);
144 
145 
147 void backup_weed_instances(void);
148 void restore_weed_instances(void);
149 
150 
152 // WARNING !! "key" here starts at 1, "mode" starts at 0
153 
154 gboolean rte_key_valid (gint key, gboolean is_userkey);
155 gboolean rte_keymode_valid (gint key, gint mode, gboolean is_userkey);
156 gint rte_keymode_get_filter_idx(gint key, gint mode);
157 gchar *rte_keymode_get_filter_name (gint key, gint mode);
158 gchar *rte_keymode_get_plugin_name(gint key, gint mode);
159 gchar *rte_keymode_get_type (gint key, gint mode, gboolean get_subtype);
160 
161 #ifdef HAS_LIVES_EFFECTS_H
162 lives_fx_cat_t rte_keymode_get_category (gint key, gint mode);
163 #endif
164 
165 weed_plant_t *rte_keymode_get_instance(gint key, gint mode);
166 weed_plant_t *rte_keymode_get_filter(gint key, gint mode);
167 
168 gboolean weed_delete_effectkey (gint key, gint mode);
169 int weed_add_effectkey (gint key, const gchar *hashname, gboolean fullname);
170 
171 int weed_add_effectkey_by_idx (gint key, int idx);
172 
173 int rte_key_getmode (gint key);
174 int rte_key_getmaxmode(gint key);
175 
176 weed_plant_t *get_new_inst_for_keymode(int key, int mode);
177 
178 
179 gboolean rte_key_setmode (gint key, gint newmode);
180 
182 gint rte_switch_keymode (gint key, gint mode, const gchar *hashname);
183 
184 
185 
186 
188 
189 int rte_getmodespk (void);
190 GList *weed_get_all_names (gshort list_type);
191 gint rte_get_numfilters(void);
192 
194 // key starts at 0
195 
196 void free_key_defaults(gint key, gint mode);
197 void apply_key_defaults(weed_plant_t *inst, gint key, gint mode);
198 void write_key_defaults(int fd, gint key, gint mode);
199 gboolean read_key_defaults(int fd, int nparams, int key, int mode, int version);
200 void set_key_defaults(weed_plant_t *inst, gint key, gint mode);
201 gboolean has_key_defaults(void);
202 
203 
205 
206 void rte_swap_fg_bg (void);
207 
208 
209 gint rte_bg_gen_key (void);
210 gint rte_fg_gen_key (void);
211 
212 gint rte_bg_gen_mode (void);
213 gint rte_fg_gen_mode (void);
214 
215 
216 
218 
219 char *get_weed_display_string (weed_plant_t *inst, int pnum);
220 weed_plant_t *add_filter_deinit_events (weed_plant_t *event_list);
221 weed_plant_t *add_filter_init_events (weed_plant_t *event_list, weed_timecode_t tc);
222 void deinit_render_effects (void);
223 
224 gboolean write_filter_defaults (int fd, int idx);
225 gboolean read_filter_defaults(int fd);
226 
227 gboolean write_generator_sizes (int fd, int idx);
228 gboolean read_generator_sizes(int fd);
229 
230 gint step_val(gint val, gint step);
231 
232 void set_param_gui_readwrite (weed_plant_t *inst);
233 void set_param_gui_readonly (weed_plant_t *inst);
234 
235 void weed_add_plant_flags (weed_plant_t *plant, int flags);
236 
237 void update_host_info (weed_plant_t *inst);
238 
240 void fill_param_vals_to (weed_plant_t *paramtmpl, weed_plant_t *param, int pnum, int hint, int index);
241 
242 
243 // some general utilities
244 
245 #define WEED_PLANT_IS_PLUGIN_INFO(plant) (weed_get_plant_type(plant)==WEED_PLANT_PLUGIN_INFO?1:0)
246 #define WEED_PLANT_IS_HOST_INFO(plant) (weed_get_plant_type(plant)==WEED_PLANT_HOST_INFO?1:0)
247 #define WEED_PLANT_IS_FILTER_CLASS(plant) (weed_get_plant_type(plant)==WEED_PLANT_FILTER_CLASS?1:0)
248 #define WEED_PLANT_IS_FILTER_INSTANCE(plant) (weed_get_plant_type(plant)==WEED_PLANT_FILTER_INSTANCE?1:0)
249 #define WEED_PLANT_IS_CHANNEL(plant) (weed_get_plant_type(plant)==WEED_PLANT_CHANNEL?1:0)
250 #define WEED_PLANT_IS_CHANNEL_TEMPLATE(plant) (weed_get_plant_type(plant)==WEED_PLANT_CHANNEL_TEMPLATE?1:0)
251 #define WEED_PLANT_IS_PARAMETER(plant) (weed_get_plant_type(plant)==WEED_PLANT_PARAMETER?1:0)
252 #define WEED_PLANT_IS_PARAMETER_TEMPLATE(plant) (weed_get_plant_type(plant)==WEED_PLANT_PARAMETER_TEMPLATE?1:0)
253 #define WEED_PLANT_IS_GUI(plant) (weed_get_plant_type(plant)==WEED_PLANT_GUI?1:0)
254 
255 
256 #endif