Changeset 1560:c7f40b469c33 in roaraudio for libroarsndio
- Timestamp:
- 04/13/09 00:48:05 (15 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- libroarsndio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libroarsndio/Makefile
r1557 r1560 2 2 3 3 TARGETS=libroarsndio.so 4 OBJS=libroarsndio.o 4 OBJS=libroarsndio.o para.o stream.o events.o volume.o 5 5 6 6 #DEFINES = -DDEBUG -
libroarsndio/libroarsndio.c
r1555 r1560 33 33 #include "libroarsndio.h" 34 34 35 struct sio_hdl * sio_open(char * name, unsigned mode, int nbio_flag) { 36 struct sio_hdl * hdl = NULL; 37 38 if ( mode != SIO_PLAY ) /* currently we only support playback */ 39 return NULL; 40 41 if ( (hdl = malloc(sizeof(struct sio_hdl))) == NULL ) 42 return NULL; 43 44 memset(hdl, 0, sizeof(struct sio_hdl)); 45 46 sio_initpar(&(hdl->para)); 47 48 hdl->fh = -1; 49 50 if ( name != NULL ) 51 hdl->device = strdup(name); 52 53 return hdl; 54 } 55 56 void sio_close (struct sio_hdl * hdl) { 57 if ( hdl == NULL ) 58 return; 59 60 if ( hdl->fh == -1 ) 61 close(hdl->fh); 62 63 free(hdl); 64 } 65 66 int sio_eof (struct sio_hdl * hdl) { 67 return 0; 68 } 69 70 void sio_onmove (struct sio_hdl * hdl, void (*cb)(void * arg, int delta), void * arg) { 71 if ( hdl == NULL ) 72 return; 73 74 hdl->on_move = cb; 75 hdl->on_move_arg = arg; 76 } 77 78 void sio_onvol (struct sio_hdl * hdl, void (*cb)(void * arg, unsigned vol), void * arg) { 79 if ( hdl == NULL ) 80 return; 81 82 hdl->on_vol = cb; 83 hdl->on_vol_arg = arg; 84 } 85 35 86 //ll
Note: See TracChangeset
for help on using the changeset viewer.