Changeset 2345:5739d31d0f74 in roaraudio


Ignore:
Timestamp:
08/14/09 05:05:46 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added support to open a cdriver

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/driver.c

    r2233 r2345  
    6666  NULL, NULL, NULL, NULL, NULL, NULL, driver_sysclock_open_vio}, 
    6767#endif 
     68 {"cdriver", "RoarAudio Client driver", "driver:device", DRV_FLAG_NONE, ROAR_SUBSYS_WAVEFORM, 
     69  NULL, NULL, NULL, NULL, NULL, NULL, driver_cdriver_open}, 
    6870 {NULL, NULL, NULL, DRV_FLAG_NONE, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL} // end of list 
    6971                                }; 
     
    267269} 
    268270 
     271 
     272int driver_cdriver_open(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh) { 
     273 char * driver; 
     274 char * delm; 
     275 int ret; 
     276 
     277 ROAR_DBG("driver_cdriver_open(inst=%p, device='%s', info=%p, fh=%i) = ?", inst, device, info, fh); 
     278 
     279 if (device == NULL) { 
     280  driver = NULL; 
     281  return -1; 
     282 } else { 
     283  driver = strdup(device); 
     284 
     285  if ( (delm = strstr(driver, "#")) == NULL ) { 
     286   device = NULL; 
     287  } else { 
     288   *delm  = 0; 
     289   device = strstr(device, "#") + 1; 
     290  } 
     291 } 
     292 
     293 ROAR_DBG("driver_cdriver_open(*): CALL roar_cdriver_open(inst=%p, driver='%s', device='%s', info=%p, dir=ROAR_DIR_PLAY)", inst, driver, device, info); 
     294 ret = roar_cdriver_open(inst, driver, device, info, ROAR_DIR_PLAY); 
     295 ROAR_DBG("driver_cdriver_open(*): RET %i", ret); 
     296 
     297 if ( driver != NULL ) 
     298  free(driver); 
     299 
     300 return ret; 
     301} 
     302 
    269303//ll 
  • roard/include/driver.h

    r2343 r2345  
    127127int driver_set_volume(int stream, struct roar_mixer_settings * mixer); 
    128128 
     129// opening a cdriver 
     130int driver_cdriver_open(struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh); 
     131 
    129132#endif 
    130133 
Note: See TracChangeset for help on using the changeset viewer.