1 #ifndef _UADE2_EFFECTS_H_ 2 #define _UADE2_EFFECTS_H_ 3 4 #include <stdint.h> 5 6 typedef enum { 7 UADE_EFFECT_ALLOW, 8 UADE_EFFECT_GAIN, 9 UADE_EFFECT_HEADPHONES, 10 UADE_EFFECT_HEADPHONES2, 11 UADE_EFFECT_PAN, 12 UADE_EFFECT_NORMALISE, 13 } uade_effect_t; 14 15 struct uade_effect { 16 uade_effect_t enabled; 17 int gain; 18 int pan; 19 int rate; 20 }; 21 22 void uade_effect_disable(struct uade_effect *ue, uade_effect_t effect); 23 void uade_effect_disable_all(struct uade_effect *ue); 24 void uade_effect_enable(struct uade_effect *ue, uade_effect_t effect); 25 int uade_effect_is_enabled(struct uade_effect *ue, uade_effect_t effect); 26 void uade_effect_set_defaults(struct uade_effect *ue); 27 void uade_effect_set_sample_rate(struct uade_effect *ue, int rate); 28 void uade_effect_toggle(struct uade_effect *ue, uade_effect_t effect); 29 30 /* effect-specific knobs */ 31 void uade_effect_gain_set_amount(struct uade_effect *ue, float amount); 32 void uade_effect_normalise_unserialise(const char *buf); 33 void uade_effect_normalise_serialise(char *buf, size_t len); 34 void uade_effect_pan_set_amount(struct uade_effect *ue, float amount); 35 36 /* reset state at start of song */ 37 void uade_effect_reset_internals(void); 38 39 /* process n frames of sample buffer */ 40 void uade_effect_run(struct uade_effect *ue, int16_t * sample, int frames); 41 42 #endif 43