Changeset 2539:616cc31e245a in roaraudio for plugins/roard


Ignore:
Timestamp:
09/02/09 03:17:04 (13 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added emul_esd_on_server_info()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/roard/protocol-esound.c

    r2538 r2539  
    6161 {ESD_PROTO_SAMPLE_GETID, ESD_NAME_MAX               , _NAME("SAMPLE_GETID"), _NEED_SAMPLE_SUPPORT}, 
    6262 {ESD_PROTO_STREAM_FILT,  ESD_NAME_MAX + 2 * _INTSIZE, _NAME("STREAM_FILT"),  emul_esd_on_stream}, 
    63  {ESD_PROTO_SERVER_INFO,                     _INTSIZE, _NAME("SERVER_INFO"),  NULL}, 
     63 {ESD_PROTO_SERVER_INFO,                     _INTSIZE, _NAME("SERVER_INFO"),  emul_esd_on_server_info}, 
    6464 {ESD_PROTO_ALL_INFO,                        _INTSIZE, _NAME("ALL_INFO"),     NULL}, 
    6565 {ESD_PROTO_SUBSCRIBE,    0                          , _NAME("SUBSCRIBE"),    _UNIMPLEMNTED_IN_ESD}, 
     
    377377} 
    378378 
     379int emul_esd_on_server_info(int client, struct emul_esd_command * cmd, void * data, struct roar_vio_calls * vio) { 
     380 int version = 0; 
     381 int rate    = g_sa->rate; 
     382 int format  = 0; 
     383 
     384 switch (g_sa->bits) { 
     385  case  8: format |= ESD_BITS8;  break; 
     386  case 16: format |= ESD_BITS16; break; 
     387 } 
     388 
     389 switch (g_sa->channels) { 
     390  case  1: format |= ESD_MONO;   break; 
     391  case  2: format |= ESD_STEREO; break; 
     392 } 
     393 
     394 if ( emul_esd_int_write(client, version, vio) == -1 ) 
     395  return -1; 
     396 
     397 if ( emul_esd_int_write(client, rate, vio) == -1 ) 
     398  return -1; 
     399 
     400 if ( emul_esd_int_write(client, format, vio) == -1 ) 
     401  return -1; 
     402 
     403 return 0; 
     404} 
     405 
    379406#endif 
    380407#endif 
Note: See TracChangeset for help on using the changeset viewer.