1 | //driver.h: |
---|
2 | |
---|
3 | #ifndef _DRIVER_H_ |
---|
4 | #define _DRIVER_H_ |
---|
5 | |
---|
6 | #include <roaraudio.h> |
---|
7 | |
---|
8 | #define DRIVER_USERDATA_T void * |
---|
9 | |
---|
10 | #ifdef ROAR_HAVE_ESD |
---|
11 | #define ROAR_DRIVER_DEFAULT "esd" |
---|
12 | #else |
---|
13 | #define ROAR_DRIVER_DEFAULT "null" |
---|
14 | #endif |
---|
15 | |
---|
16 | #ifdef ROAR_HAVE_ESD |
---|
17 | #include <esd.h> |
---|
18 | #include "driver_esd.h" |
---|
19 | #endif |
---|
20 | |
---|
21 | #include "driver_roar.h" |
---|
22 | #include "driver_raw.h" |
---|
23 | |
---|
24 | #ifdef ROAR_HAVE_LIBAO |
---|
25 | #include <ao/ao.h> |
---|
26 | #include "driver_ao.h" |
---|
27 | #endif |
---|
28 | |
---|
29 | |
---|
30 | struct roar_driver { |
---|
31 | char * name; |
---|
32 | char * desc; |
---|
33 | char * devices; |
---|
34 | int (*open )(DRIVER_USERDATA_T * inst, char * device, struct roar_audio_info * info); |
---|
35 | int (*close)(DRIVER_USERDATA_T inst); |
---|
36 | int (*pause)(DRIVER_USERDATA_T inst, int newstate); |
---|
37 | int (*write)(DRIVER_USERDATA_T inst, char * buf, int len); |
---|
38 | int (*read )(DRIVER_USERDATA_T inst, char * buf, int len); |
---|
39 | int (*flush)(DRIVER_USERDATA_T inst); |
---|
40 | }; |
---|
41 | |
---|
42 | void print_driverlist (void); |
---|
43 | |
---|
44 | int driver_open (DRIVER_USERDATA_T * inst, |
---|
45 | int * driver_id, char * driver /* NOTE: this is not part of struct roar_driver's def! */, |
---|
46 | char * device, struct roar_audio_info * info); |
---|
47 | int driver_close(DRIVER_USERDATA_T inst, int driver); |
---|
48 | int driver_pause(DRIVER_USERDATA_T inst, int driver, int newstate); |
---|
49 | int driver_write(DRIVER_USERDATA_T inst, int driver, char * buf, int len); |
---|
50 | int driver_read (DRIVER_USERDATA_T inst, int driver, char * buf, int len); |
---|
51 | int driver_flush(DRIVER_USERDATA_T inst, int driver); |
---|
52 | |
---|
53 | #endif |
---|
54 | |
---|
55 | //ll |
---|