Changeset 5740:b3aff85876f1 in roaraudio for plugins/roard/protocol-esound.c
- Timestamp:
- 11/09/12 02:51:16 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/roard/protocol-esound.c
r5739 r5740 24 24 */ 25 25 26 #include "roard.h"26 #include <roard/include/roard.h> 27 27 28 28 #ifndef ROAR_WITHOUT_DCOMP_EMUL_ESD … … 46 46 47 47 static 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);49 48 static int emul_esd_int_write (int client, int data, struct roar_vio_calls * vio); 50 49 static int emul_esd_test_auth (int client, void * data, struct roar_vio_calls * vio); … … 166 165 167 166 static 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 168 170 if ( emul_esd_exec_command(client, ESD_PROTO_CONNECT, vio) == -1 ) 169 171 return -1; … … 174 176 static 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) { 175 177 _cmd_t cmd; 178 179 (void)obuffer, (void)userdata, (void)protopara, (void)protoparalen, (void)pluginpara; 176 180 177 181 if ( client == -1 ) … … 190 194 _cmd_t d; 191 195 196 (void)client; 197 192 198 if ( data == NULL || buf == NULL ) 193 199 return -1; 194 200 195 201 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;209 202 210 203 *data = d; … … 216 209 _cmd_t d = data; 217 210 211 (void)client; 212 218 213 return roar_vio_write(vio, &d, _INTSIZE) == _INTSIZE ? 0 : -1; 219 214 } … … 221 216 static int emul_esd_test_auth (int client, void * data, struct roar_vio_calls * vio) { 222 217 // accept all clients for the moment. 218 219 (void)data; 220 223 221 return emul_esd_int_write(client, 1, vio); 224 222 } … … 247 245 // handler: 248 246 static int emul_esd_on_connect (int client, struct emul_esd_command * cmd, void * data, struct roar_vio_calls * vio) { 247 248 (void)cmd; 249 249 250 250 ROAR_DBG("emul_esd_on_connect(client=%i, cmd=%p, data=%p, vio=%p) = ?", client, cmd, data, vio); … … 356 356 int lag = ROAR_OUTPUT_CFREQ; 357 357 358 (void)cmd, (void)data; 359 358 360 lag *= 2.0 * 44100.0 / (float)g_sa->rate; 359 361 … … 382 384 static int emul_esd_on_standbymode(int client, struct emul_esd_command * cmd, void * data, struct roar_vio_calls * vio) { 383 385 int mode = ESM_ERROR; 386 387 (void)cmd, (void)data; 384 388 385 389 if ( g_standby ) { … … 402 406 int ok = 0; 403 407 408 (void)cmd; 409 404 410 emul_esd_int_read_buf(client, &stream, data + 0*_INTSIZE); 405 411 emul_esd_int_read_buf(client, &left, data + 1*_INTSIZE); … … 423 429 int rate = g_sa->rate; 424 430 int format = 0; 431 432 (void)cmd, (void)data; 425 433 426 434 switch (g_sa->bits) { … … 556 564 } 557 565 558 st ruct roar_dl_proto __proto_common_esd = {566 static struct roar_dl_proto __proto_common_esd = { 559 567 .proto = ROAR_PROTO_ESOUND, 560 568 .description = "EsounD emulation", … … 564 572 }; 565 573 574 static 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 580 ROAR_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 566 592 #endif 567 593 #endif
Note: See TracChangeset
for help on using the changeset viewer.