|
Nanomidi
Simple stream-based MIDI message encoder and decoder
|
Output stream for midi_encode() More...
#include <encoder.h>
Data Fields | |
| size_t(* | write_cb )(struct midi_ostream *stream, const void *data, size_t size) |
| Pointer to a user-implemented write callback. More... | |
| size_t | capacity |
| Stream capacity. More... | |
| void * | param |
| Optional parameter to be passed to write_cb() More... | |
Output stream for midi_encode()
Write callback write_cb() and stream capacity must be provided by the user. It is also possible to call midi_ostream_from_buffer() to create a stream which writes to a buffer.
| size_t(* write_cb) (struct midi_ostream *stream, const void *data, size_t size) |
Pointer to a user-implemented write callback.
The callback should write the exact number of bytes requested.
| stream | Pointer to associated midi_ostream | |
| [in] | data | Data to be written |
| size | Number of bytes to be written |
| size_t capacity |
Stream capacity.
Function midi_encode() will not write more than capacity bytes to the stream unless midi_ostream.capacity is set to MIDI_STREAM_CAPACITY_UNLIMITED.
| void* param |
Optional parameter to be passed to write_cb()