Assembly: Bass.Net (in Bass.Net.dll) Version: 220.127.116.11
[SerializableAttribute] public sealed class MIDI_HEADER
<SerializableAttribute> Public NotInheritable Class MIDI_HEADER
Thetype exposes the following members.
Initializes a new instance of the MIDI_HEADER with the given data buffer.
Initializes a new instance of the MIDI_HEADER with an empty data buffer of the given size.
Initializes a new instance of the MIDI_HEADER from a given Midi header pointer.
Initializes a new instance of the MIDI_HEADER with the string as the data buffer.
The MIDI data buffer.
Gets the flags giving information about the buffer (see MIDIHeader for more information).
Gets the pointer to the prepared MIDIHDR structure (or Zero if the header was not prepared).
Indicates if the device driver is finished with the buffer and is returning it to the application.
Indicates if the buffer has been prepared by using the Prepare(Boolean, IntPtr) method.
Indicates if the buffer is a stream buffer.
Custom user data.
Prepares the MIDI_HEADER structure and sets the HeaderPtr member.
Returns the Data buffer as a string.(Overrides ObjectToString.)
Unprepares the MIDI_HEADER structure and frees all used resources.
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 the constructor taking a headerPtr to create a MIDI_HEADER from such pointer!
Make sure, that you always call Unprepare(Boolean, IntPtr) once you prepared the header with the Prepare(Boolean, IntPtr) method in order to release all unmanaged recourses (this is at best done within the callback procedure)!
Internally the Prepare(Boolean, IntPtr) and Unprepare(Boolean, IntPtr) methods will use the MIDI_InPrepareHeader(IntPtr, IntPtr), MIDI_OutPrepareHeader(IntPtr, IntPtr) resp. MIDI_InUnprepareHeader(IntPtr, IntPtr), MIDI_OutUnprepareHeader(IntPtr, IntPtr).