BASS.NET API for the Un4seen BASS Audio Library

MIDI_HEADER Constructor (IntPtr)

BASS.NET API for the Un4seen BASS Audio Library
Initializes a new instance of the MIDI_HEADER from a given Midi header pointer.

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

public MIDI_HEADER(
	IntPtr headerPtr
)

Parameters

headerPtr
Type: SystemIntPtr
The pointer to the MIDIHDR structure (e.g. as received in a MIDIINPROC or MIDIOUTPROC).
Remarks

In order to use the MIDI_HEADER with a Midi function (e.g. MIDI_InAddBuffer(IntPtr, IntPtr) or MIDI_OutLongMsg(IntPtr, IntPtr)) you must first call the Prepare(Boolean, IntPtr) method which provides a HeaderPtr to be used.

After you send a system-exclusive data block, you must wait until the device driver is finished with the data block before freeing it. If you are sending multiple data blocks, you must monitor the completion of each data block so you know when to send additional blocks.

Once the MIDI_HEADER is used, your application will be notified with a callback procedure (see MIDIINPROC or MIDIOUTPROC) when a system-exclusive buffer has been filled with data and is being returned to the application. The MIM_LONGDATA message is sent to a MIDI input callback function - the MOM_DONE message is sent to a MIDI output callback function in such case. The param1 parameter of the callback will give you the pointer to the MIDI_HEADER structure identifying the input buffer. Use this method to create a MIDI_HEADER from such pointer!

Make sure, that you always call Unprepare(Boolean, IntPtr) in order to release all unmanaged recourses (this is at best done within the callback procedure)!

See Also

Reference