Changeset 2359:72bb3b910149 in roaraudio


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

set parameters correct for MIDI streams

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroarsndio/libroarsndio.c

    r2357 r2359  
    3636struct sio_hdl * sio_open(char * name, unsigned mode, int nbio_flag) { 
    3737 struct sio_hdl * hdl = NULL; 
     38 int is_midi = 0; 
    3839 
    3940 if ( (hdl = malloc(sizeof(struct sio_hdl))) == NULL ) 
     
    4748   break; 
    4849  case MIO_OUT: 
     50    is_midi = 1; 
     51    hdl->dir = ROAR_DIR_MIDI_IN; 
     52   break; 
    4953  case MIO_IN: 
     54    is_midi = 1; 
     55    hdl->dir = ROAR_DIR_MIDI_OUT; 
     56   break; 
    5057  case SIO_REC: 
    5158  case SIO_PLAY|SIO_REC: 
     
    6774 if ( name != NULL ) 
    6875  hdl->device = strdup(name); 
     76 
     77 if ( is_midi ) { 
     78  hdl->info.codec    = ROAR_CODEC_MIDI; 
     79  hdl->info.bits     = 8; 
     80  hdl->info.channels = 16; 
     81  hdl->info.rate     = 96; 
     82  if ( !sio_start(hdl) ) { 
     83   sio_close(hdl); 
     84   return NULL; 
     85  } 
     86 } 
    6987 
    7088 return hdl; 
Note: See TracChangeset for help on using the changeset viewer.