1 // effects.h
2 // LiVES (lives-exe)
3 // (c) G. Finch 2003 - 2012
4 // Released under the GPL 3 or later
5 // see file ../COPYING for licensing details
6 
7 #ifndef HAS_LIVES_EFFECTS_H
8 #define HAS_LIVES_EFFECTS_H
9 
10 // general effects
11 typedef enum {
12   LIVES_FX_CAT_NONE = 0,
13   LIVES_FX_CAT_VIDEO_GENERATOR,
14   LIVES_FX_CAT_AV_GENERATOR,
15   LIVES_FX_CAT_AUDIO_GENERATOR,
16   LIVES_FX_CAT_DATA_GENERATOR,
17   LIVES_FX_CAT_DATA_VISUALISER,
18   LIVES_FX_CAT_DATA_PROCESSOR,
19   LIVES_FX_CAT_DATA_SOURCE,
20   LIVES_FX_CAT_TRANSITION,
21   LIVES_FX_CAT_AV_TRANSITION,
22   LIVES_FX_CAT_VIDEO_TRANSITION,
23   LIVES_FX_CAT_AUDIO_TRANSITION,
24   LIVES_FX_CAT_EFFECT,
25   LIVES_FX_CAT_VIDEO_EFFECT,
26   LIVES_FX_CAT_AUDIO_EFFECT,
27   LIVES_FX_CAT_UTILITY,
28   LIVES_FX_CAT_COMPOSITOR,
29   LIVES_FX_CAT_AUDIO_MIXER,
30   LIVES_FX_CAT_TAP,
31   LIVES_FX_CAT_SPLITTER,
32   LIVES_FX_CAT_CONVERTER,
33   LIVES_FX_CAT_AUDIO_VOL,
34   LIVES_FX_CAT_ANALYSER,
35   LIVES_FX_CAT_VIDEO_ANALYSER,
36   LIVES_FX_CAT_AUDIO_ANALYSER
37 } lives_fx_cat_t;
38 
39 /// audio filter type (any, analyser only, non analyser only)
40 typedef enum {
41   AF_TYPE_ANY,
42   AF_TYPE_A,
43   AF_TYPE_NONA
44 } lives_af_t;
45 
46 char *lives_fx_cat_to_text(lives_fx_cat_t cat, boolean plural) WARN_UNUSED;
47 
48 #include "effects-weed.h"
49 
50 boolean do_effect(lives_rfx_t *rfx, boolean is_preview); ///< defined as extern in paramwindow.c
51 
52 void on_render_fx_activate(LiVESMenuItem *menuitem, lives_rfx_t *rfx);
53 
54 ///////////////// real time effects
55 
56 // render
57 void on_realfx_activate(LiVESMenuItem *, livespointer rfx);
58 boolean on_realfx_activate_inner(int type, lives_rfx_t *rfx);
59 
60 lives_render_error_t realfx_progress(boolean reset);
61 
62 // key callbacks
63 
64 boolean textparm_callback(LiVESAccelGroup *group, LiVESWidgetObject *obj, uint32_t keyval, LiVESXModifierType mod,
65                           livespointer user_data);
66 
67 boolean grabkeys_callback(LiVESAccelGroup *, LiVESWidgetObject *, uint32_t, LiVESXModifierType,
68                           livespointer user_data);  ///< for accel groups
69 boolean grabkeys_callback_hook(LiVESToggleButton *button, livespointer user_data);  ///< for widgets
70 
71 boolean rte_on_off_callback(LiVESAccelGroup *, LiVESWidgetObject *, uint32_t, LiVESXModifierType,
72                             livespointer user_data);  ///< for accel groups
73 boolean rte_on_off_callback_hook(LiVESToggleButton *, livespointer user_data);  ///< for widgets
74 
75 boolean rtemode_callback(LiVESAccelGroup *, LiVESWidgetObject *, uint32_t, LiVESXModifierType,
76                          livespointer user_data);  ///< for accel groups
77 boolean rtemode_callback_hook(LiVESToggleButton *, livespointer user_data);  ///< for widgets
78 
79 boolean swap_fg_bg_callback(LiVESAccelGroup *, LiVESWidgetObject *, uint32_t, LiVESXModifierType, livespointer user_data);
80 
81 void get_blend_layer(ticks_t tc);
82 
83 weed_plant_t *on_rte_apply(weed_plant_t *main_layer, int opwidth, int opheight, ticks_t tc);
84 
85 void deinterlace_frame(weed_layer_t *layer, ticks_t tc);
86 
87 // rte keys state
88 void rte_keymodes_backup(int nkeys);
89 void rte_keymodes_restore(int nkeys);
90 
91 boolean rte_key_on_off(int key, boolean on);
92 boolean rte_key_toggle(int key);
93 void rte_keys_reset(void);
94 
95 boolean rte_key_is_enabled(int key);
96 
97 int rte_getmodespk(void);
98 
99 #endif
100