LiVES  2.0.3
 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 {
34 
38 
39 
41 weed_plant_t *weed_bootstrap_func (weed_default_getter_f *value, int num_versions, int *plugin_versions);
42 
43 weed_plant_t *get_weed_filter(int filter_idx);
44 gchar *weed_filter_get_name(int filter_idx) WARN_UNUSED;
45 gchar *make_weed_hashname(int filter_idx, boolean fullname, boolean use_extra_authors) WARN_UNUSED;
46 int weed_get_idx_for_hashname (const gchar *hashname, boolean fullname);
47 int enabled_in_channels (weed_plant_t *plant, boolean count_repeats);
48 int enabled_out_channels (weed_plant_t *plant, boolean count_repeats);
49 weed_plant_t *get_enabled_channel (weed_plant_t *inst, int which, boolean is_in);
50 weed_plant_t *get_mandatory_channel (weed_plant_t *filter, int which, boolean is_in);
51 boolean weed_filter_is_resizer(weed_plant_t *filt);
52 boolean weed_instance_is_resizer(weed_plant_t *filt);
53 weed_plant_t *weed_instance_get_filter(weed_plant_t *inst, boolean get_compound_parent);
54 
55 #define PLUGIN_COMPOUND_EFFECTS_BUILTIN "effects/compound/"
56 #define PLUGIN_COMPOUND_EFFECTS_CUSTOM "plugins/effects/compound/"
57 
58 int num_compound_fx(weed_plant_t *plant);
59 void load_compound_fx(void);
60 
61 boolean has_non_alpha_palette(weed_plant_t *ctmpl);
62 boolean has_alpha_palette(weed_plant_t *ctmpl);
63 
64 boolean is_audio_channel_in(weed_plant_t *inst, int chnum);
65 boolean has_video_chans_in(weed_plant_t *filter, boolean count_opt);
66 boolean has_audio_chans_in(weed_plant_t *filter, boolean count_opt);
67 boolean is_audio_channel_out(weed_plant_t *inst, int chnum);
68 boolean has_video_chans_out(weed_plant_t *filter, boolean count_opt);
69 boolean has_audio_chans_out(weed_plant_t *filter, boolean count_opt);
70 boolean is_pure_audio(weed_plant_t *filter_or_instance, boolean count_opt);
71 
72 boolean has_audio_filters(boolean analysers_only);
73 boolean has_video_filters(boolean analysers_only);
74 
75 #ifdef HAS_LIVES_EFFECTS_H
76 lives_fx_cat_t weed_filter_categorise (weed_plant_t *pl, int in_channels, int out_channels);
77 lives_fx_cat_t weed_filter_subcategorise (weed_plant_t *pl, lives_fx_cat_t category, boolean count_opt);
78 #endif
79 
80 gchar* weed_seed_type_to_text(int seed_type);
81 
82 boolean has_usable_palette(weed_plant_t *chantmpl);
83 int check_weed_palette_list (int *palette_list, int num_palettes, int palette);
84 
85 int weed_call_init_func(weed_plant_t *instance);
86 int weed_call_deinit_func(weed_plant_t *instance);
87 
88 gchar *cd_to_plugin_dir(weed_plant_t *filter);
89 boolean weed_init_effect(int hotkey);
90 void weed_deinit_effect(int hotkey);
91 weed_plant_t *weed_instance_from_filter(weed_plant_t *filter);
92 void weed_instance_ref(weed_plant_t *inst);
93 void weed_instance_unref(weed_plant_t *inst);
94 void weed_in_parameters_free (weed_plant_t *inst);
95 void weed_in_params_free(weed_plant_t **parameters, int num_parameters);
96 void add_param_connections(weed_plant_t *inst);
97 lives_filter_error_t weed_reinit_effect (weed_plant_t *inst, boolean reinit_compound);
98 void weed_reinit_all(void);
99 
100 
101 int weed_flagset_array_count(weed_plant_t **array, boolean set_readonly);
102 
103 int num_alpha_channels(weed_plant_t *filter, boolean out);
104 
105 int num_in_params(weed_plant_t *, boolean skip_hidden, boolean skip_internal);
106 int num_out_params(weed_plant_t *);
107 weed_plant_t *weed_inst_in_param (weed_plant_t *inst, int param_num, boolean skip_hidden, boolean skip_internal);
108 weed_plant_t *weed_inst_out_param (weed_plant_t *inst, int param_num);
109 weed_plant_t *weed_filter_in_paramtmpl (weed_plant_t *filter, int param_num, boolean skip_internal);
110 boolean is_hidden_param(weed_plant_t *, int i);
111 int get_nth_simple_param(weed_plant_t *, int pnum);
112 int count_simple_params(weed_plant_t *);
113 weed_plant_t **weed_params_create (weed_plant_t *filter, boolean in);
114 int get_transition_param(weed_plant_t *filter, boolean skip_internal);
115 int get_master_vol_param(weed_plant_t *filter, boolean skip_internal);
116 boolean is_perchannel_multiw(weed_plant_t *param);
117 boolean has_perchannel_multiw(weed_plant_t *filter);
118 boolean weed_parameter_has_variable_elements_strict(weed_plant_t *inst, weed_plant_t *ptmpl);
119 
120 
122 boolean interpolate_param(weed_plant_t *inst, int i, void *pchain, weed_timecode_t tc);
123 boolean interpolate_params(weed_plant_t *inst, void **pchains, weed_timecode_t tc);
124 
125 boolean weed_plant_serialise(int fd, weed_plant_t *plant, unsigned char **mem);
126 weed_plant_t *weed_plant_deserialise(int fd, unsigned char **mem);
127 
128 
130 void rec_param_change(weed_plant_t *inst, int pnum);
131 
132 // copy values for "copy_value_to" params
133 int set_copy_to(weed_plant_t *inst, int pnum, boolean update);
134 
135 weed_plant_t *get_textparm();
136 
137 void weed_set_blend_factor(int hotkey);
138 int weed_get_blend_factor(int hotkey);
139 
140 void weed_memory_init(void);
141 
142 void weed_load_all (void);
143 void weed_unload_all(void);
144 int get_next_free_key(void);
145 
146 void weed_deinit_all(boolean shutdown);
147 
148 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);
149 lives_filter_error_t weed_apply_instance (weed_plant_t *inst, weed_plant_t *init_event, weed_plant_t **layers,
150  int opwidth, int opheight, weed_timecode_t tc);
151 void weed_apply_audio_effects (weed_plant_t *filter_map, float **abuf, int nbtracks, int nchans, int64_t nsamps, gdouble arate,
152  weed_timecode_t tc, double *vis);
153 void weed_apply_audio_effects_rt(float **abuf, int nchans, int64_t nsamps, gdouble arate, weed_timecode_t tc, boolean analysers_only);
154 
155 lives_filter_error_t weed_apply_audio_instance (weed_plant_t *init_event, float **abuf, int nbtracks, int nchans, int64_t nsamps,
156  gdouble arate, weed_timecode_t tc, double *vis);
157 
158 boolean weed_generator_start (weed_plant_t *inst);
159 weed_plant_t *weed_layer_new_from_generator (weed_plant_t *inst, weed_timecode_t tc);
160 void weed_generator_end (weed_plant_t *inst);
161 boolean weed_playback_gen_start (void);
162 void weed_bg_generator_end (weed_plant_t *inst);
163 
164 
166 void backup_weed_instances(void);
167 void restore_weed_instances(void);
168 
169 
171 // WARNING !! "key" here starts at 1, "mode" starts at 0
172 
173 boolean rte_key_valid (int key, boolean is_userkey);
174 boolean rte_keymode_valid (int key, int mode, boolean is_userkey);
175 int rte_keymode_get_filter_idx(int key, int mode);
176 gchar *rte_keymode_get_filter_name (int key, int mode) WARN_UNUSED;
177 gchar *rte_keymode_get_plugin_name(int key, int mode) WARN_UNUSED;
178 gchar *rte_keymode_get_type (int key, int mode) WARN_UNUSED;
179 
180 #ifdef HAS_LIVES_EFFECTS_H
181 lives_fx_cat_t rte_keymode_get_category (int key, int mode);
182 #endif
183 
184 weed_plant_t *rte_keymode_get_instance(int key, int mode);
185 weed_plant_t *rte_keymode_get_filter(int key, int mode);
186 
187 boolean weed_delete_effectkey (int key, int mode);
188 int weed_add_effectkey (int key, const gchar *hashname, boolean fullname);
189 
190 int weed_add_effectkey_by_idx (int key, int idx);
191 
192 int rte_key_getmode (int key);
193 int rte_key_getmaxmode(int key);
194 
195 weed_plant_t *get_new_inst_for_keymode(int key, int mode);
196 
197 
198 boolean rte_key_setmode (int key, int newmode);
199 
201 int rte_switch_keymode (int key, int mode, const gchar *hashname);
202 
203 
204 
205 
207 
208 int rte_getmodespk (void);
209 GList *weed_get_all_names (gshort list_type);
210 int rte_get_numfilters(boolean inc_dupes);
211 
213 // key starts at 0
214 
215 void free_key_defaults(int key, int mode);
216 void apply_key_defaults(weed_plant_t *inst, int key, int mode);
217 void write_key_defaults(int fd, int key, int mode);
218 boolean read_key_defaults(int fd, int nparams, int key, int mode, int version);
219 void set_key_defaults(weed_plant_t *inst, int key, int mode);
220 boolean has_key_defaults(void);
221 
222 
224 
225 void rte_swap_fg_bg (void);
226 
227 
228 int rte_bg_gen_key (void);
229 int rte_fg_gen_key (void);
230 
231 int rte_bg_gen_mode (void);
232 int rte_fg_gen_mode (void);
233 
234 
235 
237 
238 gchar *get_weed_display_string (weed_plant_t *inst, int pnum);
239 weed_plant_t *add_filter_deinit_events (weed_plant_t *event_list);
240 weed_plant_t *add_filter_init_events (weed_plant_t *event_list, weed_timecode_t tc);
241 void deinit_render_effects (void);
242 
243 boolean write_filter_defaults (int fd, int idx);
244 boolean read_filter_defaults(int fd);
245 
246 boolean write_generator_sizes (int fd, int idx);
247 boolean read_generator_sizes(int fd);
248 
249 int step_val(int val, int step);
250 
251 void set_param_gui_readwrite (weed_plant_t *inst);
252 void set_param_gui_readonly (weed_plant_t *inst);
253 
254 void weed_add_plant_flags (weed_plant_t *plant, int flags);
255 
256 void update_host_info (weed_plant_t *inst);
257 
259 void fill_param_vals_to (weed_plant_t *param, weed_plant_t *ptmpl, int fill_slot);
260 
261 
262 // some general utilities
263 
264 #define WEED_PLANT_IS_PLUGIN_INFO(plant) (weed_get_plant_type(plant)==WEED_PLANT_PLUGIN_INFO?1:0)
265 #define WEED_PLANT_IS_HOST_INFO(plant) (weed_get_plant_type(plant)==WEED_PLANT_HOST_INFO?1:0)
266 #define WEED_PLANT_IS_FILTER_CLASS(plant) (weed_get_plant_type(plant)==WEED_PLANT_FILTER_CLASS?1:0)
267 #define WEED_PLANT_IS_FILTER_INSTANCE(plant) (weed_get_plant_type(plant)==WEED_PLANT_FILTER_INSTANCE?1:0)
268 #define WEED_PLANT_IS_CHANNEL(plant) (weed_get_plant_type(plant)==WEED_PLANT_CHANNEL?1:0)
269 #define WEED_PLANT_IS_CHANNEL_TEMPLATE(plant) (weed_get_plant_type(plant)==WEED_PLANT_CHANNEL_TEMPLATE?1:0)
270 #define WEED_PLANT_IS_PARAMETER(plant) (weed_get_plant_type(plant)==WEED_PLANT_PARAMETER?1:0)
271 #define WEED_PLANT_IS_PARAMETER_TEMPLATE(plant) (weed_get_plant_type(plant)==WEED_PLANT_PARAMETER_TEMPLATE?1:0)
272 #define WEED_PLANT_IS_GUI(plant) (weed_get_plant_type(plant)==WEED_PLANT_GUI?1:0)
273 
274 
275 #endif