Changeset 2357:9b4e7fe1368c in roaraudio


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

changed check for stream mode the way that we can add support for other DIRs, too.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroarsndio/libroarsndio.c

    r2019 r2357  
    3737 struct sio_hdl * hdl = NULL; 
    3838 
    39  if ( mode != SIO_PLAY ) /* currently we only support playback */ 
    40   return NULL; 
    41  
    4239 if ( (hdl = malloc(sizeof(struct sio_hdl))) == NULL ) 
    4340  return NULL; 
    4441 
    4542 memset(hdl, 0, sizeof(struct sio_hdl)); 
     43 
     44 switch (mode) { 
     45  case SIO_PLAY: 
     46    hdl->dir = ROAR_DIR_PLAY; 
     47   break; 
     48  case MIO_OUT: 
     49  case MIO_IN: 
     50  case SIO_REC: 
     51  case SIO_PLAY|SIO_REC: 
     52  case MIO_OUT|MIO_IN: 
     53  default: 
     54    free(hdl); 
     55    return NULL; 
     56 } 
    4657 
    4758 if ( roar_simple_connect(&(hdl->con), name, "libroarsndio") == -1 ) { 
Note: See TracChangeset for help on using the changeset viewer.