[0] | 1 | //libroarstream.h: |
---|
| 2 | |
---|
| 3 | #ifndef _LIBROARSTREAM_H_ |
---|
| 4 | #define _LIBROARSTREAM_H_ |
---|
| 5 | |
---|
| 6 | #include "roaraudio.h" |
---|
| 7 | |
---|
| 8 | #define roar_dir2str(x) ((x) == ROAR_DIR_PLAY ? "play" : (x) == ROAR_DIR_MONITOR ? "monitor" : \ |
---|
| 9 | (x) == ROAR_DIR_FILTER ? "filter" : (x) == ROAR_DIR_RECORD ? "record" : \ |
---|
| 10 | (x) == ROAR_DIR_OUTPUT ? "output" : "unknown") |
---|
[537] | 11 | /* |
---|
[229] | 12 | #define roar_codec2str(x) ((x) == ROAR_CODEC_PCM_S_LE ? "pcm_s_le" : (x) == ROAR_CODEC_PCM_S_BE ? "pcm_s_be" : \ |
---|
| 13 | (x) == ROAR_CODEC_PCM_S_PDP ? "pcm_s_pdp" : (x) == ROAR_CODEC_MIDI_FILE ? "midi_file" : \ |
---|
| 14 | "unknown" ) |
---|
[537] | 15 | */ |
---|
[0] | 16 | |
---|
[465] | 17 | struct roar_stream_info { |
---|
| 18 | int block_size; |
---|
[492] | 19 | int pre_underruns; |
---|
| 20 | int post_underruns; |
---|
[539] | 21 | int codec; |
---|
[465] | 22 | }; |
---|
| 23 | |
---|
[0] | 24 | int roar_stream_connect (struct roar_connection * con, struct roar_stream * s, int dir); |
---|
| 25 | |
---|
| 26 | int roar_stream_new (struct roar_stream * s, unsigned int rate, unsigned int channels, unsigned int bits, unsigned int codec); |
---|
| 27 | |
---|
| 28 | int roar_stream_exec (struct roar_connection * con, struct roar_stream * s); |
---|
[81] | 29 | int roar_stream_connect_to (struct roar_connection * con, struct roar_stream * s, int type, char * host, int port); |
---|
[82] | 30 | int roar_stream_connect_to_ask (struct roar_connection * con, struct roar_stream * s, int type, char * host, int port); |
---|
[0] | 31 | |
---|
| 32 | int roar_stream_add_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len); |
---|
| 33 | |
---|
[506] | 34 | int roar_stream_send_data (struct roar_connection * con, struct roar_stream * s, char * data, size_t len); |
---|
| 35 | |
---|
[465] | 36 | int roar_stream_get_info (struct roar_connection * con, struct roar_stream * s, struct roar_stream_info * info); |
---|
| 37 | |
---|
[0] | 38 | int roar_stream_s2m (struct roar_stream * s, struct roar_message * m); |
---|
| 39 | int roar_stream_m2s (struct roar_stream * s, struct roar_message * m); |
---|
| 40 | |
---|
[537] | 41 | int roar_str2codec (char * codec); |
---|
| 42 | char * roar_codec2str (int codec); |
---|
| 43 | |
---|
[0] | 44 | #endif |
---|
| 45 | |
---|
| 46 | //ll |
---|