| 1 | #ifndef RAOP_H |
| 2 | #define RAOP_H |
| 3 | |
| 4 | #if defined (WIN32) && defined(DLL_EXPORT) |
| 5 | # define RAOP_API __declspec(dllexport) |
| 6 | #else |
| 7 | # define RAOP_API |
| 8 | #endif |
| 9 | |
| 10 | #ifdef __cplusplus |
| 11 | extern "C" { |
| 12 | #endif |
| 13 | |
| 14 | typedef struct raop_s raop_t; |
| 15 | |
| 16 | struct raop_callbacks_s { |
| 17 | void* cls; |
| 18 | void* (*audio_init)(void *cls, int bits, int channels, int samplerate); |
| 19 | void (*audio_set_volume)(void *cls, void *session, float volume); |
| 20 | void (*audio_process)(void *cls, void *session, const void *buffer, int buflen); |
| 21 | void (*audio_flush)(void *cls, void *session); |
| 22 | void (*audio_destroy)(void *cls, void *session); |
| 23 | }; |
| 24 | typedef struct raop_callbacks_s raop_callbacks_t; |
| 25 | |
| 26 | RAOP_API raop_t *raop_init(raop_callbacks_t *callbacks, const char *pemkey); |
| 27 | RAOP_API raop_t *raop_init_from_keyfile(raop_callbacks_t *callbacks, const char *keyfile); |
| 28 | |
| 29 | RAOP_API int raop_is_running(raop_t *raop); |
| 30 | |
| 31 | RAOP_API int raop_start(raop_t *raop, unsigned short *port, const char *hwaddr, int hwaddrlen, const char *password); |
| 32 | RAOP_API void raop_stop(raop_t *raop); |
| 33 | |
| 34 | RAOP_API void raop_destroy(raop_t *raop); |
| 35 | |
| 36 | #ifdef __cplusplus |
| 37 | } |
| 38 | #endif |
| 39 | #endif |