Ignore:
Timestamp:
11/09/12 02:51:16 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

commit 1: Moved protocol support into new plugins protocol-esound, protocol-rplay and protocol-gopher (Closes: #311)

File:
1 edited

Legend:

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

    r5739 r5740  
    2424 */ 
    2525 
    26 #include "roard.h" 
     26#include <roard/include/roard.h> 
    2727 
    2828#ifndef ROAR_WITHOUT_DCOMP_EMUL_ESD 
     
    4646 
    4747static int emul_esd_int_read_buf  (int client, int * data, void * buf); 
    48 static int emul_esd_int_read      (int client, int * data, struct roar_vio_calls * vio); 
    4948static int emul_esd_int_write     (int client, int   data, struct roar_vio_calls * vio); 
    5049static int emul_esd_test_auth     (int client, void * data, struct roar_vio_calls * vio); 
     
    166165 
    167166static int emul_esd_set_proto(int client, struct roar_vio_calls * vio, struct roar_buffer ** obuffer, void ** userdata, const struct roar_keyval * protopara, ssize_t protoparalen, struct roar_dl_librarypara * pluginpara) { 
     167 
     168 (void)obuffer, (void)userdata, (void)protopara, (void)protoparalen, (void)pluginpara; 
     169 
    168170 if ( emul_esd_exec_command(client, ESD_PROTO_CONNECT, vio) == -1 ) 
    169171  return -1; 
     
    174176static int emul_esd_check_client(int client, struct roar_vio_calls * vio, struct roar_buffer ** obuffer, void ** userdata, const struct roar_keyval * protopara, ssize_t protoparalen, struct roar_dl_librarypara * pluginpara) { 
    175177 _cmd_t cmd; 
     178 
     179 (void)obuffer, (void)userdata, (void)protopara, (void)protoparalen, (void)pluginpara; 
    176180 
    177181 if ( client == -1 ) 
     
    190194 _cmd_t d; 
    191195 
     196 (void)client; 
     197 
    192198 if ( data == NULL || buf == NULL ) 
    193199  return -1; 
    194200 
    195201 d = *(_cmd_t*)buf; 
    196  
    197  *data = d; 
    198  
    199  return 0; 
    200 } 
    201 static int emul_esd_int_read      (int client, int * data, struct roar_vio_calls * vio) { 
    202  _cmd_t d; 
    203  
    204  if ( data == NULL ) 
    205   return -1; 
    206  
    207  if ( roar_vio_read(vio, &d, _INTSIZE) != _INTSIZE ) 
    208   return -1; 
    209202 
    210203 *data = d; 
     
    216209 _cmd_t d = data; 
    217210 
     211 (void)client; 
     212 
    218213 return roar_vio_write(vio, &d, _INTSIZE) == _INTSIZE ? 0 : -1; 
    219214} 
     
    221216static int emul_esd_test_auth     (int client, void * data, struct roar_vio_calls * vio) { 
    222217 // accept all clients for the moment. 
     218 
     219 (void)data; 
     220 
    223221 return emul_esd_int_write(client, 1, vio); 
    224222} 
     
    247245// handler: 
    248246static int emul_esd_on_connect    (int client, struct emul_esd_command * cmd, void * data, struct roar_vio_calls * vio) { 
     247 
     248 (void)cmd; 
    249249 
    250250 ROAR_DBG("emul_esd_on_connect(client=%i, cmd=%p, data=%p, vio=%p) = ?", client, cmd, data, vio); 
     
    356356 int lag = ROAR_OUTPUT_CFREQ; 
    357357 
     358 (void)cmd, (void)data; 
     359 
    358360 lag *= 2.0 * 44100.0 / (float)g_sa->rate; 
    359361  
     
    382384static int emul_esd_on_standbymode(int client, struct emul_esd_command * cmd, void * data, struct roar_vio_calls * vio) { 
    383385 int mode = ESM_ERROR; 
     386 
     387 (void)cmd, (void)data; 
    384388 
    385389 if ( g_standby ) { 
     
    402406 int ok = 0; 
    403407 
     408 (void)cmd; 
     409 
    404410 emul_esd_int_read_buf(client, &stream, data + 0*_INTSIZE); 
    405411 emul_esd_int_read_buf(client, &left,   data + 1*_INTSIZE); 
     
    423429 int rate    = g_sa->rate; 
    424430 int format  = 0; 
     431 
     432 (void)cmd, (void)data; 
    425433 
    426434 switch (g_sa->bits) { 
     
    556564} 
    557565 
    558 struct roar_dl_proto __proto_common_esd = { 
     566static struct roar_dl_proto __proto_common_esd = { 
    559567 .proto = ROAR_PROTO_ESOUND, 
    560568 .description = "EsounD emulation", 
     
    564572}; 
    565573 
     574static int __reg_proto(struct roar_dl_librarypara * para, struct roar_dl_libraryinst * lib) { 
     575 (void)para, (void)lib; 
     576 ROAR_DL_PLUGIN_REG_FN(ROAR_DL_PROTO_SUBTYPE, __proto_common_esd, ROAR_DL_PROTO_VERSION); 
     577 return 0; 
     578} 
     579 
     580ROAR_DL_PLUGIN_START(protocol_esd) { 
     581 ROARD_DL_CHECK_VERSIONS(); 
     582 
     583 ROAR_DL_PLUGIN_META_PRODUCT_NIV("protocol-esd", ROAR_VID_ROARAUDIO, ROAR_VNAME_ROARAUDIO); 
     584 ROAR_DL_PLUGIN_META_VERSION(ROAR_VERSION_STRING); 
     585 ROAR_DL_PLUGIN_META_LICENSE_TAG(GPLv3_0); 
     586 ROAR_DL_PLUGIN_META_CONTACT_FLNE("Philipp", "Schafft", "ph3-der-loewe", "lion@lion.leolix.org"); 
     587 ROAR_DL_PLUGIN_META_DESC("Implementation of the Enlightened Sound Daemon's protocol"); 
     588 
     589 ROAR_DL_PLUGIN_REG(ROAR_DL_FN_PROTO, __reg_proto); 
     590} ROAR_DL_PLUGIN_END 
     591 
    566592#endif 
    567593#endif 
Note: See TracChangeset for help on using the changeset viewer.