Changeset 949:066077e177bf in roaraudio


Ignore:
Timestamp:
12/08/08 00:56:47 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

updated roar driver to support new VIO interface

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/driver_roar.c

    r668 r949  
    3333#endif 
    3434 
    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"; 
     35int driver_roar_open_vio(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh) { 
    3936 
    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 } 
    4240 
    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 } 
    4444 
    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); 
    5546 
    5647 return 0; 
     
    5849 
    5950int 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)); 
    6152} 
    6253 
    6354int driver_roar_pause(DRIVER_USERDATA_T   inst, int newstate) { 
    6455 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); 
    7356} 
    7457 
  • roard/include/driver_roar.h

    r668 r949  
    2626#define _DRIVER_ROAR_H_ 
    2727 
    28 int driver_roar_open(DRIVER_USERDATA_T * inst, char * device, struct roar_audio_info * info); 
     28int driver_roar_open_vio(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh); 
    2929int driver_roar_close(DRIVER_USERDATA_T   inst); 
    3030int 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); 
    3331int driver_roar_flush(DRIVER_USERDATA_T   inst); 
    3432 
Note: See TracChangeset for help on using the changeset viewer.