Changeset 5226:3cb3cab29e5e in roaraudio for libroaresd


Ignore:
Timestamp:
11/12/11 13:20:14 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

Removed roarcat2sock as well as roar_simple_stream(), roar_simple_new_stream(), roar_simple_play(), roar_simple_monitor(), roar_simple_record(), roar_simple_filter(), roar_simple_close() and roar_simple_get_standby().

Location:
libroaresd
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libroaresd/esdbasic.c

    r4708 r5226  
    7171/* closes fd, previously obtained by esd_open */ 
    7272int esd_close( int esd ) { 
    73  return roar_simple_close(esd); 
     73 struct roar_vio_calls vio; 
     74 
     75 if ( roar_vio_open_fh_socket(&vio, esd) == -1 ) { 
     76  roar_err_update(); 
     77  return -1; 
     78 } 
     79 
     80 if ( roar_vio_close(&vio) == -1 ) { 
     81  roar_err_update(); 
     82  return -1; 
     83 } 
     84 
     85 return 0; 
    7486} 
    7587 
  • libroaresd/esdctl.c

    r4975 r5226  
    367367/* see if the server is in stnaby, autostandby, etc */ 
    368368esd_standby_mode_t esd_get_standby_mode( int esd ) { 
    369  return roar_simple_get_standby(esd); 
     369 struct roar_connection con; 
     370 
     371 if ( roar_connect_fh(&con, esd) == -1 ) 
     372  return -1; 
     373 
     374 return roar_get_standby(&con); 
    370375} 
    371376 
  • libroaresd/esdstream.c

    r4978 r5226  
    5050/* open a socket for playing, monitoring, or recording as a stream */ 
    5151/* the *_fallback functions try to open /dev/dsp if there's no EsounD */ 
    52 int esd_play_stream( esd_format_t format, int rate, 
    53                      const char *host, const char *name ) { 
     52 
     53static int libroaresd_stream(esd_format_t format, int rate, const char *host, const char *name, int dir) { 
    5454 int channels; 
    5555 int bits; 
    5656 int codec = ROAR_CODEC_DEFAULT; 
     57 struct roar_stream     s; 
    5758 
    5859 if ( (format & ESD_BITS16) ) { 
     
    6970 } 
    7071 
    71  return roar_simple_stream(rate, channels, bits, codec, (char*)host, ROAR_DIR_PLAY, (char*) name); 
     72 return roar_simple_stream_obj(&s, rate, channels, bits, codec, (char*)host, dir, (char*)name); 
     73} 
     74 
     75int esd_play_stream( esd_format_t format, int rate, 
     76                     const char *host, const char *name ) { 
     77 return libroaresd_stream(format, rate, host, name, ROAR_DIR_PLAY); 
    7278} 
    7379 
     
    8793int esd_monitor_stream( esd_format_t format, int rate, 
    8894                        const char *host, const char *name ) { 
    89  int channels; 
    90  int bits; 
    91  int codec = ROAR_CODEC_DEFAULT; 
    92  
    93  ROAR_DBG("esd_monitor_stream(format=%x, rate=%i, host='%s', name='%s') = ?", format, rate, host, name); 
    94  
    95  if ( (format & ESD_BITS16) ) { 
    96   bits  = 16; 
    97  } else { 
    98   bits  = 8; 
    99   codec = CODEC_DEF_8BIT; 
    100  } 
    101  
    102  if ( (format & ESD_MONO) ) { 
    103   channels = 1; 
    104  } else { 
    105   channels = 2; 
    106  } 
    107  
    108  return roar_simple_stream(rate, channels, bits, codec, (char*)host, ROAR_DIR_MONITOR, (char*)name); 
     95 return libroaresd_stream(format, rate, host, name, ROAR_DIR_MONITOR); 
    10996} 
    11097/* int esd_monitor_stream_fallback( esd_format_t format, int rate ); */ 
    11198int esd_record_stream( esd_format_t format, int rate, 
    11299                       const char *host, const char *name ) { 
    113  int channels; 
    114  int bits; 
    115  int codec = ROAR_CODEC_DEFAULT; 
    116  
    117  ROAR_DBG("esd_record_stream(format=%x, rate=%i, host='%s', name='%s') = ?", format, rate, host, name); 
    118  
    119  if ( (format & ESD_BITS16) ) { 
    120   bits  = 16; 
    121  } else { 
    122   bits  = 8; 
    123   codec = CODEC_DEF_8BIT; 
    124  } 
    125  
    126  if ( (format & ESD_MONO) ) { 
    127   channels = 1; 
    128  } else { 
    129   channels = 2; 
    130  } 
    131  
    132  return roar_simple_stream(rate, channels, bits, codec, (char*)host, ROAR_DIR_RECORD, (char*)name); 
     100 return libroaresd_stream(format, rate, host, name, ROAR_DIR_RECORD); 
    133101} 
    134102int esd_record_stream_fallback( esd_format_t format, int rate, 
     
    144112int esd_filter_stream( esd_format_t format, int rate, 
    145113                       const char *host, const char *name ) { 
    146  int channels; 
    147  int bits; 
    148  int codec = ROAR_CODEC_DEFAULT; 
    149  
    150  if ( (format & ESD_BITS16) ) { 
    151   bits  = 16; 
    152  } else { 
    153   bits  = 8; 
    154   codec = CODEC_DEF_8BIT; 
    155  } 
    156  
    157  if ( (format & ESD_MONO) ) { 
    158   channels = 1; 
    159  } else { 
    160   channels = 2; 
    161  } 
    162  
    163  return roar_simple_stream(rate, channels, bits, codec, (char*)host, ROAR_DIR_FILTER, (char*)name); 
     114 return libroaresd_stream(format, rate, host, name, ROAR_DIR_FILTER); 
    164115} 
    165116 
Note: See TracChangeset for help on using the changeset viewer.