handleLongData method

dynamic handleLongData(
  1. Uint8List data,
  2. Pointer<MIDIHDR> midiHdrPointer
)

Handles one MM_MIM_LONGDATA chunk.

data must already be a copy: the pointer it came from is re-queued by _resetHeader below, after which the driver may overwrite it.

The header is re-queued whatever the chunk contained. It used to be re-queued only once a message completed, so a SysEx the device never terminated permanently consumed one of the input buffers.

Implementation

handleLongData(Uint8List data, Pointer<MIDIHDR> midiHdrPointer) {
  for (final message in _sysExAssembler.add(data)) {
    _rxStreamCtrl.add(MidiPacket(message, 0, this));
  }
  _resetHeader(midiHdrPointer);
}