Changeset 1929
- Timestamp:
- 12/04/10 20:28:41 (1 year ago)
- Files:
-
- branches/libffado-2.0/libffado/ffado.h (modified) (1 diff)
- branches/libffado-2.0/tests/streaming/teststreaming3.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/libffado-2.0/libffado/ffado.h
r1371 r1929 67 67 * } 68 68 * 69 * ffado_streaming_transfer_ buffers(dev);69 * ffado_streaming_transfer_capture_buffers(dev); 70 70 * 71 71 * for(all channels) { 72 * // For both audio and MIDI channels, captured data is available 73 * // in the buffer previously set with a call to 74 * // ffado_streaming_set_capture_stream_buffer(dev, channel, buffer) 72 75 * switch (channel_type) { 73 76 * case audio: 74 * bytesread=ffado_streaming_read(audioinbuffer[channel]); 75 * byteswritten=ffado_streaming_write(audiooutbuffer[channel]); 77 * // Process incoming audio as needed 76 78 * case midi: 77 * bytesread=ffado_streaming_read(midiinbuffer[channel]); 78 * byteswritten=ffado_streaming_write(midioutbuffer[channel]); 79 * // Process incoming MIDI data as needed 79 80 * } 80 81 * } 82 * 83 * for(all channels) { 84 * // For both audio and MIDI channels, data is written to buffers 85 * // previously associated with the playback channel streams using 86 * // ffado_streaming_set_playback_stream_buffer(dev, channel, buffer) 87 * switch (channel_type) { 88 * case audio: 89 * // Set audio playback buffer contents 90 * case midi: 91 * // Set MIDI playback buffer contents 92 * } 93 * } 94 * ffado_streaming_transfer_playback_buffers(dev); 95 * 81 96 * } 82 97 * ffado_streaming_stop(); branches/libffado-2.0/tests/streaming/teststreaming3.cpp
r1722 r1929 485 485 frame_counter += arguments.period; 486 486 487 // if((nb_periods % 32)==0) {488 // // debugOutput(DEBUG_LEVEL_NORMAL, "\r%05d periods",nb_periods);489 // }490 491 // for(i=0;i<nb_in_channels;i++) {492 //493 //494 // switch (ffado_streaming_get_capture_stream_type(dev,i)) {495 // case ffado_stream_type_audio:496 // // no need to get the buffers manually, we have set the API internal buffers to the audiobuffer[i]'s497 // // //samplesread=freebob_streaming_read(dev, i, audiobuffer[i], arguments.period);498 // samplesread=arguments.period;499 // break;500 // case ffado_stream_type_midi:501 // //samplesread=ffado_streaming_read(dev, i, audiobuffers_out[i], arguments.period);502 // break;503 // default: break;504 // }505 //506 // // fprintf(fid_in[i], "---- Period read (%d samples) ----\n",samplesread);507 // // hexDumpToFile(fid_in[i],(unsigned char*)audiobuffers_in[i],samplesread*sizeof(float)+1);508 // }509 510 // for(i=0;i<nb_out_channels;i++) {511 // float *buff;512 // int sampleswritten=0;513 // if (i<nb_in_channels) {514 // buff=audiobuffers_out[i];515 // } else {516 // buff=nullbuffer;517 // }518 //519 // switch (ffado_streaming_get_playback_stream_type(dev,i)) {520 // case ffado_stream_type_audio:521 // // sampleswritten=freebob_streaming_write(dev, i, buff, arguments.period);522 // sampleswritten=arguments.period;523 // break;524 // case ffado_stream_type_midi:525 // // sampleswritten=freebob_streaming_write(dev, i, buff, arguments.period);526 // break;527 // default: break;528 // }529 // // fprintf(fid_out[i], "---- Period write (%d samples) ----\n",sampleswritten);530 // // hexDumpToFile(fid_out[i],(unsigned char*)buff,sampleswritten*sizeof(ffado_sample_t));531 // }532 487 } 533 488
