Changeset 949:066077e177bf in roaraudio for roard
- Timestamp:
- 12/08/08 00:56:47 (15 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/driver_roar.c
r668 r949 33 33 #endif 34 34 35 int driver_roar_open(DRIVER_USERDATA_T * inst, char * device, struct roar_audio_info * info) { 36 /* 37 esd_format_t format = ESD_STREAM | ESD_PLAY; 38 char name[80] = "roard"; 35 int driver_roar_open_vio(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh) { 39 36 40 format |= info->bits == 16 ? ESD_BITS16 : ESD_BITS8; 41 format |= info->channels == 2 ? ESD_STEREO : ESD_MONO; 37 if ( fh != -1 ) { // this is a connection to a roard, no roar_simple_*() interface avalible for this case 38 return -1; 39 } 42 40 43 *(int*)inst = esd_play_stream_fallback(format, info->rate, device, name); 41 if ( (fh = roar_simple_play(info->rate, info->channels, info->bits, info->codec, device, "roard")) == -1 ) { 42 return -1; 43 } 44 44 45 if ( *(int*)inst == -1 ) 46 return -1; 47 48 return 0; 49 */ 50 51 *(INSTINT*)inst = roar_simple_play(info->rate, info->channels, info->bits, info->codec, device, "roard"); 52 53 if ( *(INSTINT*)inst == -1 ) 54 return -1; 45 roar_vio_set_fh(inst, fh); 55 46 56 47 return 0; … … 58 49 59 50 int driver_roar_close(DRIVER_USERDATA_T inst) { 60 return roar_simple_close( (INSTINT)inst);51 return roar_simple_close(roar_vio_get_fh((struct roar_vio_calls *)inst)); 61 52 } 62 53 63 54 int driver_roar_pause(DRIVER_USERDATA_T inst, int newstate) { 64 55 return -1; 65 }66 67 int driver_roar_write(DRIVER_USERDATA_T inst, char * buf, int len) {68 return write((INSTINT)inst, buf, len);69 }70 71 int driver_roar_read(DRIVER_USERDATA_T inst, char * buf, int len) {72 return read((INSTINT)inst, buf, len);73 56 } 74 57 -
roard/include/driver_roar.h
r668 r949 26 26 #define _DRIVER_ROAR_H_ 27 27 28 int driver_roar_open (DRIVER_USERDATA_T * inst, char * device, struct roar_audio_info * info);28 int driver_roar_open_vio(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh); 29 29 int driver_roar_close(DRIVER_USERDATA_T inst); 30 30 int driver_roar_pause(DRIVER_USERDATA_T inst, int newstate); 31 int driver_roar_write(DRIVER_USERDATA_T inst, char * buf, int len);32 int driver_roar_read(DRIVER_USERDATA_T inst, char * buf, int len);33 31 int driver_roar_flush(DRIVER_USERDATA_T inst); 34 32
Note: See TracChangeset
for help on using the changeset viewer.