Nanomidi
Simple stream-based MIDI message encoder and decoder
midi_ostream Struct Reference

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...
 

Detailed Description

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.

Field Documentation

◆ write_cb

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.

Parameters
streamPointer to associated midi_ostream
[in]dataData to be written
sizeNumber of bytes to be written
Returns
The number of bytes actually written

◆ capacity

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.

◆ param

void* param

Optional parameter to be passed to write_cb()


The documentation for this struct was generated from the following file: