4 #if defined (WIN32) && defined(DLL_EXPORT)
5 # define RAOP_API __declspec(dllexport)
15 /* Define syslog style log levels */
16 #define RAOP_LOG_EMERG 0 /* system is unusable */
17 #define RAOP_LOG_ALERT 1 /* action must be taken immediately */
18 #define RAOP_LOG_CRIT 2 /* critical conditions */
19 #define RAOP_LOG_ERR 3 /* error conditions */
20 #define RAOP_LOG_WARNING 4 /* warning conditions */
21 #define RAOP_LOG_NOTICE 5 /* normal but significant condition */
22 #define RAOP_LOG_INFO 6 /* informational */
23 #define RAOP_LOG_DEBUG 7 /* debug-level messages */
26 typedef struct raop_s raop_t
;
28 typedef void (*raop_log_callback_t
)(int level
, const char *msg
);
30 struct raop_callbacks_s
{
33 /* Compulsory callback functions */
34 void* (*audio_init
)(void *cls
, int bits
, int channels
, int samplerate
);
35 void (*audio_process
)(void *cls
, void *session
, const void *buffer
, int buflen
);
36 void (*audio_destroy
)(void *cls
, void *session
);
38 /* Optional but recommended callback functions */
39 void (*audio_flush
)(void *cls
, void *session
);
40 void (*audio_set_volume
)(void *cls
, void *session
, float volume
);
41 void (*audio_set_metadata
)(void *cls
, void *session
, const void *buffer
, int buflen
);
42 void (*audio_set_coverart
)(void *cls
, void *session
, const void *buffer
, int buflen
);
44 typedef struct raop_callbacks_s raop_callbacks_t
;
46 RAOP_API raop_t
*raop_init(raop_callbacks_t
*callbacks
, const char *pemkey
);
47 RAOP_API raop_t
*raop_init_from_keyfile(raop_callbacks_t
*callbacks
, const char *keyfile
);
49 RAOP_API
void raop_set_log_level(raop_t
*raop
, int level
);
50 RAOP_API
void raop_set_log_callback(raop_t
*raop
, raop_log_callback_t callback
);
52 RAOP_API
int raop_start(raop_t
*raop
, unsigned short *port
, const char *hwaddr
, int hwaddrlen
, const char *password
);
53 RAOP_API
int raop_is_running(raop_t
*raop
);
54 RAOP_API
void raop_stop(raop_t
*raop
);
56 RAOP_API
void raop_destroy(raop_t
*raop
);