Changeset 4521:4277b6a0c8a1 in roaraudio
- Timestamp:
- 10/16/10 17:09:23 (13 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
r4516 r4521 11 11 * Changed SONAME version to 1. 12 12 * Changed buffer interface, no public struct anymore. 13 * Fixed lots of compiler warnings 13 14 14 15 v. 0.4beta0 - Fri Oct 01 2010 13:36 CEST -
roard/beep.c
r3764 r4521 28 28 // TODO: FIXME: move them out of here into libroar: 29 29 static ssize_t beep_read (struct roar_vio_calls * vio, void *buf, size_t count) { 30 struct roar_buffer * rbuf; 31 30 32 ROAR_DBG("beep_read(vio=%p, buf=%p, count=%llu) = ?", vio, buf, (long long unsigned int)count); 31 33 … … 33 35 return 0; 34 36 35 if ( roar_buffer_shift_out(&(vio->inst), buf, &count) == -1 ) 37 rbuf = vio->inst; 38 39 if ( roar_buffer_shift_out(&rbuf, buf, &count) == -1 ) 36 40 return -1; 41 42 vio->inst = rbuf; 37 43 38 44 return count; … … 67 73 size_t mod = info->rate / beep->freq; 68 74 char * data; 75 void * bufdata; 69 76 char val; 70 77 size_t pos; … … 73 80 ROAR_DBG("beep_fill_buffer(beep=%p, info=%p) = ?", beep, info); 74 81 75 if ( roar_buffer_new_data(&buf, samples, & data) == -1 ) {82 if ( roar_buffer_new_data(&buf, samples, &bufdata) == -1 ) { 76 83 ROAR_DBG("beep_fill_buffer(beep=%p, info=%p) = NULL", beep, info); 77 84 return NULL; 78 85 } 86 87 data = (char*)bufdata; 79 88 80 89 for (pos = 0; pos < frames; pos++) { -
roard/include/streams.h
r4379 r4521 142 142 int streams_set_null_io(int id); 143 143 int streams_get (int id, struct roar_stream_server ** stream); 144 int streams_get_clientobj (int id, struct roar_stream ** stream); 144 145 145 146 int streams_set_socktype (int id, int socktype); -
roard/midi.c
r3764 r4521 136 136 struct roar_stream_server * ss; 137 137 struct roar_buffer * b; 138 char* buf;138 void * buf; 139 139 ssize_t len; 140 140 … … 157 157 } 158 158 159 if ( roar_buffer_new_data(&b, MIDI_READ_SIZE, (void**)&buf) == -1 ) {159 if ( roar_buffer_new_data(&b, MIDI_READ_SIZE, &buf) == -1 ) { 160 160 ROAR_ERR("midi_check_stream(*): Can not alloc buffer space!"); 161 161 ROAR_DBG("midi_check_stream(*) = -1"); … … 213 213 214 214 int midi_conv_midi2mes (int id) { 215 void * bufdata; 215 216 unsigned char * data; 216 217 struct roar_stream * s; … … 229 230 230 231 while (ss->buffer != NULL && alive) { 231 if ( roar_buffer_get_data(ss->buffer, (void**)&data) == -1 ) {232 if ( roar_buffer_get_data(ss->buffer, &bufdata) == -1 ) { 232 233 alive = 0; 233 234 continue; 234 235 } 236 237 data = bufdata; 235 238 236 239 if ( roar_buffer_get_len(ss->buffer, &have) == -1 ) { … … 375 378 struct roar_buffer * buf = g_midi_mess.buf; 376 379 struct midi_message * mes = NULL; 380 void * bufdata; 377 381 unsigned char data[3]; 378 382 unsigned char * d; … … 390 394 391 395 while (buf != NULL) { 392 if ( roar_buffer_get_data(buf, (void**)&mes) == -1 ) {396 if ( roar_buffer_get_data(buf, &bufdata) == -1 ) { 393 397 return -1; 394 398 } 399 400 mes = bufdata; 395 401 396 402 if (mes->type == MIDI_TYPE_CLOCK_TICK || mes->type == MIDI_TYPE_CLOCK_START || mes->type == MIDI_TYPE_CLOCK_STOP ) { … … 455 461 struct roar_buffer * buf = g_midi_mess.buf; 456 462 struct midi_message * mes = NULL; 463 void * bufdata; 457 464 458 465 while (buf != NULL) { 459 if ( roar_buffer_get_data(buf, (void**)&mes) == -1 ) {466 if ( roar_buffer_get_data(buf, &bufdata) == -1 ) { 460 467 return -1; 461 468 } 469 470 mes = bufdata; 462 471 463 472 if ( ssynth_eval_message(mes) == -1 ) … … 492 501 int midi_add_buf (int id, struct roar_buffer * buf) { 493 502 struct midi_message * mes; 503 void * bufdata; 494 504 495 505 if ( id == -1 || buf == NULL ) 496 506 return -1; 497 507 498 if ( roar_buffer_get_data(buf, (void**)&mes) == -1 ) 499 return -1; 508 if ( roar_buffer_get_data(buf, &bufdata) == -1 ) 509 return -1; 510 511 mes = bufdata; 500 512 501 513 ROAR_DBG("midi_add_buf(id=%i, buf=%p) = ?", id, buf); … … 803 815 struct roar_buffer * buf = g_midi_mess.buf; 804 816 struct midi_message * mes = NULL; 817 void * bufdata; 805 818 806 819 ROAR_DBG("midi_cb_readbuf(void) = ?"); … … 809 822 ROAR_DBG("midi_cb_readbuf(void): buf=%p", buf); 810 823 811 if ( roar_buffer_get_data(buf, (void**)&mes) == -1 ) {824 if ( roar_buffer_get_data(buf, &bufdata) == -1 ) { 812 825 return -1; 813 826 } 827 828 mes = bufdata; 814 829 815 830 switch (mes->type) { -
roard/req.c
r4505 r4521 149 149 150 150 ROAR_DBG("req_on_new_stream(client=%i, ...): getting stream...", client); 151 if ( streams_get (stream, (struct roar_stream_server **)&s) == -1 ) {151 if ( streams_get_clientobj(stream, &s) == -1 ) { 152 152 streams_delete(stream); 153 153 return -1; … … 235 235 } 236 236 237 if ( streams_get (ROAR_STREAM(s)->pos_rel_id, (struct roar_stream_server **)&source_stream) == -1 ) {237 if ( streams_get_clientobj(ROAR_STREAM(s)->pos_rel_id, &source_stream) == -1 ) { 238 238 streams_delete(stream); 239 239 return -1; … … 256 256 source_info = g_sa; 257 257 } else { 258 if ( streams_get (ROAR_STREAM(s)->pos_rel_id, (struct roar_stream_server **)&source_stream) == -1 ) {258 if ( streams_get_clientobj(ROAR_STREAM(s)->pos_rel_id, &source_stream) == -1 ) { 259 259 streams_delete(stream); 260 260 return -1; … … 606 606 *data = NULL; 607 607 608 if ( roar_server_info_to_mes(mes, &info, data) == -1 )608 if ( roar_server_info_to_mes(mes, &info, (void**)data) == -1 ) 609 609 return -1; 610 610 … … 1421 1421 int req_on_add_data (int client, struct roar_message * mes, char ** data, uint32_t flags[2]) { 1422 1422 struct roar_buffer * b; 1423 char* buf;1424 1425 if ( roar_buffer_new_data(&b, mes->datalen, (void **)&buf) == -1 ) {1423 void * buf; 1424 1425 if ( roar_buffer_new_data(&b, mes->datalen, &buf) == -1 ) { 1426 1426 ROAR_ERR("req_on_add_data(*): Can not alloc buffer space!"); 1427 1427 ROAR_DBG("req_on_add_data(*) = -1"); -
roard/sources.c
r4419 r4521 271 271 } 272 272 273 streams_get (stream, (struct roar_stream_server **)&s);273 streams_get_clientobj(stream, &s); 274 274 275 275 memcpy(&(s->info), g_sa, sizeof(struct roar_audio_info)); … … 313 313 } 314 314 315 streams_get (stream, (struct roar_stream_server **)&s);315 streams_get_clientobj(stream, &s); 316 316 317 317 memcpy(&(s->info), g_sa, sizeof(struct roar_audio_info)); … … 408 408 } 409 409 410 streams_get (stream, (struct roar_stream_server **)&s);410 streams_get_clientobj(stream, &s); 411 411 412 412 memcpy(&(s->info), g_sa, sizeof(struct roar_audio_info)); -
roard/streams.c
r4516 r4521 709 709 } 710 710 711 int streams_get_clientobj (int id, struct roar_stream ** stream) { 712 _CHECK_SID(id); 713 714 *stream = ROAR_STREAM(g_streams[id]); 715 716 return 0; 717 } 718 711 719 int streams_set_socktype (int id, int socktype) { 712 720 _CHECK_SID(id);
Note: See TracChangeset
for help on using the changeset viewer.