BASS.NET API for the Un4seen BASS Audio LibraryMidiSysExMessage Constructor (Boolean, IntPtr, IntPtr, MidiSysExMessage)BASS.NET API for the Un4seen BASS Audio Library
Creates a new instance of the MidiSysExMessage from a pointer to a MIDI_HEADER and also evaluates a previous system-exclusive message.

Namespace: radio42.Multimedia.Midi
Assembly: Bass.Net (in Bass.Net.dll) Version:

public MidiSysExMessage(
	bool input,
	IntPtr handle,
	IntPtr headerPtr,
	MidiSysExMessage previous


Type: SystemBoolean
Dealing with a Midi input device? (=input, =output).
Type: SystemIntPtr
The handle to the MIDI device.
Type: SystemIntPtr
A pointer to a MIDI_HEADER structure to use with this system-exclusive message.
Type: radio42.Multimedia.MidiMidiSysExMessage
The previous system-exclusive message received (in order to check, if data buffers need to be concatenated).

You might use this constuctor in your MIDIINPROC or MIDIOUTPROC when receiving a MIM_LONGDATA, MIM_LONGERROR resp. MOM_DONE message with the 'prarm1' value.

This overload ensures, that sub-sequent system-exclusive messages are automatically concatenated (if needed) until the IsDone property is set to . It might be the case, that an input device needs to use more than one system-exclusive message in order to complete one message. This because for input devices your application provide empty buffers of a given size to the device. If this buffer is not large enough to keep the full message multiple system-exclusive messages are used. The IsDone property indicates, if the current data buffer is complete and the device driver indicates that it is finished with the buffer. If the IsDone property is set to this would indicate, that more data is about to come and the current Message data buffer needs to be concatenated with sub-sequent system-exclusive messages until IsDone returns . This overload ensures, that the current data buffer of the headerPtr will automatically be appended to the data buffer of the previous data buffer if the previous buffer was not finished, so that this instance will contain the data buffer of the previous and this message. If the previous buffer was already done or is nothing will be done and only the current data buffer will be used. All this only applies to input devices (IsInput should be ), since when dealing with output devices you control the amount of data to send.

Calling this constructor with a valid pointer to a MIDI_HEADER structure will automatically unprepare the header (using Unprepare(Boolean, IntPtr))!

The Message data buffer will only be set, if the IsDone flag was set - meaning the Midi device finished with the buffer.

See Also