BASS.NET API for the Un4seen BASS Audio Library

MidiMIDI_OutUnprepareHeader Method

BASS.NET API for the Un4seen BASS Audio Library
Cleans up the preparation performed by the midiOutPrepareHeader function.

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

public static MIDIError MIDI_OutUnprepareHeader(
	IntPtr handle,
	IntPtr headerPtr
)

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: MIDIError
Returns 0 if successful or an error code otherwise. For possible error values see MIDIError.
Remarks

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.

See Also

Reference