Namespace: radio42.Multimedia.Midi
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.2
Parameters
- handle
- Type: SystemIntPtr
Handle to the MIDI output device. - headerPtr
- Type: SystemIntPtr
Pointer to a MIDI_HEADER structure identifying the buffer to be cleaned up.
Return Value
Type: MIDIErrorReturns 0 if successful or an error code otherwise. For possible error values see MIDIError.
This function is complementary to the MIDI_OutPrepareHeader(IntPtr, IntPtr) function. You must call MIDI_OutUnprepareHeader(IntPtr, IntPtr) before freeing the buffer. After passing a buffer to the device driver with the MIDI_OutLongMsg(IntPtr, IntPtr) function, you must wait until the device driver is finished with the buffer before calling MIDI_OutUnprepareHeader(IntPtr, IntPtr).
Unpreparing a buffer that has not been prepared has no effect, and the function returns 0.
For convenience the Prepare(Boolean, IntPtr) might also be used, which calls MIDI_InPrepareHeader(IntPtr, IntPtr) internally and provides the prepared header pointer in it's HeaderPtr member. In order to convert an IntPtr (e.g. as given in the MIDIINPROC with the MIM_LONGDATA or MIM_LONGERROR as param1) back to a MIDI_HEADER structure use the appropriate constructor overload of the MIDI_HEADER class taking a headerPtr.