Rev | Line | |
---|
[651] | 1 | //libroardsp.h: |
---|
| 2 | |
---|
| 3 | #ifndef _LIBROARDSP_H_ |
---|
| 4 | #define _LIBROARDSP_H_ |
---|
| 5 | |
---|
[652] | 6 | #include <roaraudio.h> |
---|
| 7 | |
---|
[659] | 8 | // defines |
---|
| 9 | #define ROARDSP_MAX_FILTERS_PER_CHAIN 8 |
---|
| 10 | |
---|
[662] | 11 | #define ROARDSP_FILTER_NONE 0 |
---|
| 12 | #define ROARDSP_FILTER_AMP 1 |
---|
| 13 | #define ROARDSP_FILTER_LOWP 2 |
---|
| 14 | #define ROARDSP_FILTER_HIGHP 3 |
---|
| 15 | |
---|
[659] | 16 | // types: |
---|
| 17 | |
---|
| 18 | struct roardsp_filter { |
---|
| 19 | int channels; |
---|
| 20 | int bits; |
---|
| 21 | void * inst; |
---|
| 22 | int (*calc )(struct roardsp_filter * filter, void * data, size_t samples); |
---|
| 23 | int (*uninit)(struct roardsp_filter * filter); |
---|
| 24 | }; |
---|
| 25 | |
---|
| 26 | struct roardsp_filterchain { |
---|
| 27 | int filters; |
---|
| 28 | struct roardsp_filter * filter[ROARDSP_MAX_FILTERS_PER_CHAIN]; |
---|
| 29 | }; |
---|
| 30 | |
---|
| 31 | struct roardsp_lowp { |
---|
| 32 | uint32_t freq; // in mHz (0Hz..4MHz) |
---|
| 33 | uint16_t a, b; |
---|
| 34 | int32_t old[ROAR_MAX_CHANNELS]; |
---|
| 35 | }; |
---|
| 36 | |
---|
| 37 | // funcs: |
---|
[664] | 38 | int roardsp_filter_str2id(char * str); |
---|
| 39 | char * roardsp_filter_id2str(int id); |
---|
| 40 | int roardsp_filter_init (struct roardsp_filter * filter, struct roar_stream * stream, int id); |
---|
| 41 | int roardsp_filter_uninit(struct roardsp_filter * filter); |
---|
| 42 | int roardsp_filter_calc (struct roardsp_filter * filter, void * data, size_t len); |
---|
[659] | 43 | |
---|
| 44 | int roardsp_fchain_init (struct roardsp_filterchain * chain); |
---|
| 45 | int roardsp_fchain_uninit(struct roardsp_filterchain * chain); |
---|
| 46 | int roardsp_fchain_add (struct roardsp_filterchain * chain, struct roardsp_filter * filter); |
---|
| 47 | int roardsp_fchain_calc (struct roardsp_filterchain * chain, void * data, size_t len); |
---|
| 48 | |
---|
[651] | 49 | #endif |
---|
| 50 | |
---|
| 51 | //ll |
---|
Note: See
TracBrowser
for help on using the repository browser.