Remarks
Callback delegate invoked when a specific type of MIDI marker, previously enabled for notification, has been found inside the MIDI stream during playback: this callback can be set through a call to the CallbackForMidiMarkerEventsSet method.
Notifications of a specific MIDI marker can be enabled/disabled through the MIDI.MarkersEnableNotifications method.
For further details about callback delegates see the How to synchronize the container application with the API tutorial.
For further details about the use of MIDI protocol see the MIDIMan class section and the How to deal with MIDI protocol tutorial.
Syntax
[Visual Basic] Public Delegate Sub CallbackForMidiMarkerEvents ( ByVal nMarkerType as enumMidiMarkerNotifications, ByVal nPlayerIndex as Int16, ByVal nTrack as Int32, ByVal fPositionInMs as Double, ByVal fPositionInTicks as Double, ByVal fPositionInPercentage as Double, ByVal pBufferUnicode as IntPtr, ByVal nBufferLength as Int32 ) |
[C#] public delegate void CallbackForMidiMarkerEvents ( enumMidiMarkerNotifications nMarkerType, Int16 nPlayerIndex, Int32 nTrack, double fPositionInMs, double fPositionInTicks, double fPositionInPercentage, IntPtr pBufferUnicode, Int32 nBufferLength ) |
[C++] public delegate void CallbackForMidiMarkerEvents ( enumMidiMarkerNotifications nMarkerType, Int16 nPlayerIndex, Int32 nTrack, double fPositionInMs, double fPositionInTicks, double fPositionInPercentage, IntPtr pBufferUnicode, Int32 nBufferLength ) |
Parameter |
Description |
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
nMarkerType |
Type of MIDI marker. Supported values are the following:
|
||||||||||||||||||||||||||||||
nPlayerIndex |
Zero-based index of the player reporting the event |
||||||||||||||||||||||||||||||
nTrack |
Number representing the zero-based index of the MIDI track. The total number of available MIDI tracks can be obtained through the MIDI:TrackCountGet method. |
||||||||||||||||||||||||||||||
fPositionInMs |
Position of the marker, expressed in milliseconds, inside the MIDI stream |
||||||||||||||||||||||||||||||
fPositionInTicks |
Position of the marker, expressed in MIDI ticks, inside the MIDI stream |
||||||||||||||||||||||||||||||
fPositionInPercentage |
Position of the marker, expressed in percentage, inside the MIDI stream |
||||||||||||||||||||||||||||||
pBufferUnicode |
Pointer to a buffer containing a string of Unicode characters with the text of the marker. Below a couple of snippets that show how to convert the buffer contents into a .NET string through marshaling:
|
||||||||||||||||||||||||||||||
nBufferLength |
The length in characters of the buffer above |