Changeset 809 for branches/api-cleanup/tests/streaming/teststreaming3.cpp
- Timestamp:
- 01/05/08 09:40:06 (16 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/api-cleanup/tests/streaming/teststreaming3.cpp
r807 r809 321 321 for (i=0; i < nb_in_channels; i++) { 322 322 audiobuffers_in[i] = (float *)calloc(arguments.period+1, sizeof(float)); 323 323 324 324 switch (ffado_streaming_get_capture_stream_type(dev,i)) { 325 325 case ffado_stream_type_audio: … … 331 331 // this is done with read/write routines because the nb of bytes can differ. 332 332 case ffado_stream_type_midi: 333 // note that using a float * buffer for midievents is a HACK 334 ffado_streaming_set_capture_stream_buffer(dev, i, (char *)(audiobuffers_in[i])); 335 ffado_streaming_set_capture_buffer_type(dev, i, ffado_buffer_type_midi); 336 ffado_streaming_capture_stream_onoff(dev, i, 1); 333 337 default: 334 338 break; 335 339 } 336 340 } 337 341 338 342 audiobuffers_out = (float **)calloc(nb_out_channels, sizeof(float)); 339 343 for (i=0; i < nb_out_channels; i++) { 340 344 audiobuffers_out[i] = (float *)calloc(arguments.period+1, sizeof(float)); 341 345 342 346 switch (ffado_streaming_get_playback_stream_type(dev,i)) { 343 347 case ffado_stream_type_audio: … … 349 353 // this is done with read/write routines because the nb of bytes can differ. 350 354 case ffado_stream_type_midi: 355 ffado_streaming_set_playback_buffer_type(dev, i, ffado_buffer_type_midi); 356 ffado_streaming_playback_stream_onoff(dev, i, 0); 351 357 default: 352 358 break; … … 413 419 } 414 420 } else { 421 uint32_t *midibuffer; 422 int idx; 415 423 for (i=0; i < min_ch_count; i++) { 416 424 switch (ffado_streaming_get_capture_stream_type(dev,i)) { … … 423 431 // this is done with read/write routines because the nb of bytes can differ. 424 432 case ffado_stream_type_midi: 433 midibuffer=(uint32_t *)audiobuffers_in[i]; 434 for(idx=0; idx < arguments.period; idx++) { 435 uint32_t midievent = *(midibuffer + idx); 436 if(midievent & 0xFF000000) { 437 debugOutput(DEBUG_LEVEL_NORMAL, " Received midi event %08X on idx %d of period %d\n", 438 midievent, idx, nb_periods); 439 } 440 } 425 441 default: 426 442 break;