BASS.NET API for the Un4seen BASS Audio LibraryBassMidiBASS_MIDI_StreamGetEvents Method (Int32, Int32, BASSMIDIEvent, BASS_MIDI_EVENT)BASS.NET API for the Un4seen BASS Audio Library
Retrieves the events in a MIDI file stream.

Namespace: Un4seen.Bass.AddOn.Midi
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.12.0
Syntax

[DllImportAttribute("bassmidi.dll", CharSet = CharSet.Unicode)]
public static int BASS_MIDI_StreamGetEvents(
	int handle,
	int track,
	BASSMIDIEvent filter,
	BASS_MIDI_EVENT[] events
)

Parameters

handle
Type: SystemInt32
The MIDI stream to get the events from.
track
Type: SystemInt32
The track to get the events from... 0 = 1st track.
filter
Type: Un4seen.Bass.AddOn.MidiBASSMIDIEvent
The type of event to retrieve (use MIDI_EVENT_NONE to retrieve all events). See BASSMIDIEvent for a list of possible event types.
events
Type: Un4seen.Bass.AddOn.MidiBASS_MIDI_EVENT
The pointer to an array of BASS_MIDI_EVENT to retrieve the events ( = get the number of events without getting the events themselves).

Return Value

Type: Int32
If successful, the number of events is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

This function should first be called with events = to get the number of events, before allocating an array of the required size and retrieving the events.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not valid.
BASS_ERROR_NOTAVAILThe stream is for real-time events only, so does not have an event sequence.
BASS_ERROR_ILLPARAMtrack is not valid.

Examples

Retrieve all events in the 1st track:
VB
Dim eventCount = BassMidi.BASS_MIDI_StreamGetEvents(_stream, 0, BASSMIDIEvent.MIDI_EVENT_NONE)
Dim events(eventCount) As BASS_MIDI_EVENT
Dim count As Integer = BassMidi.BASS_MIDI_StreamGetEvents(_stream, 0, BASSMIDIEvent.MIDI_EVENT_NONE, events)
int eventCount = BassMidi.BASS_MIDI_StreamGetEvents(_stream, 0, BASSMIDIEvent.MIDI_EVENT_NONE);
BASS_MIDI_EVENT[] events = new BASS_MIDI_EVENT[eventCount];
int count = BassMidi.BASS_MIDI_StreamGetEvents(_stream, 0, BASSMIDIEvent.MIDI_EVENT_NONE, events);
See Also

Reference