radio42.Multimedia.MidiMIDI_HEADER
Namespace: radio42.Multimedia.Midi
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
The MIDI_HEADER type exposes the following members.
Name | Description | |
---|---|---|
MIDI_HEADER(Byte) |
Initializes a new instance of the MIDI_HEADER with the given data buffer.
| |
MIDI_HEADER(Int32) |
Initializes a new instance of the MIDI_HEADER with an empty data buffer of the given size.
| |
MIDI_HEADER(IntPtr) |
Initializes a new instance of the MIDI_HEADER from a given Midi header pointer.
| |
MIDI_HEADER(String) |
Initializes a new instance of the MIDI_HEADER with the string as the data buffer.
|
Name | Description | |
---|---|---|
Data |
The MIDI data buffer.
| |
Flags |
Gets the flags giving information about the buffer (see MIDIHeader for more information).
| |
HeaderPtr |
Gets the pointer to the prepared MIDIHDR structure (or Zero if the header was not prepared).
| |
IsDone |
Indicates if the device driver is finished with the buffer and is returning it to the application.
| |
IsPrepared |
Indicates if the buffer has been prepared by using the Prepare(Boolean, IntPtr) method.
| |
IsStreamBuffer |
Indicates if the buffer is a stream buffer.
| |
User |
Custom user data.
|
Name | Description | |
---|---|---|
Prepare |
Prepares the MIDI_HEADER structure and sets the HeaderPtr member.
| |
ToString |
Returns the Data buffer as a string.
(Overrides ObjectToString.) | |
Unprepare |
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).