I am developing a tiny MIDI player in VB.NET using latest version of BASS.NET.
I want to refresh a form with program changes occurring when playing the MIDI file so the program acts like this:
'Get all program changes in MIDI file
Dim NevProg = BASS_MIDI_StreamGetEvents(Stream, -1, MIDI_EVENT_PROGRAM, Nothing)
'allocate Event array and get the events
Dim ProgEv() = Array.Empty(Of BASS_MIDI_EVENT)
Dim NevProg = BASS_MIDI_StreamGetEvents(Stream, -1, MIDI_EVENT_PROGRAM, ProgEv)
'Set a sync proc for one event, just to try
Dim PCSyProc = New SYNCPROC(AddressOf ProgramSync)
If BASS_ChannelSetSync(Stream, BASS_SYNC_POS, ProgEv(3).pos, PCSyProc, Me.Handle) = 0 Then BassMes("Syncing program change")
...
Private Delegate Sub UpdateUIDelegate(ByVal channel As Integer, data As Integer)
Private Sub ProgramSync(handle As Integer, channel As Integer, data As Integer, user As IntPtr)
...
Me.Invoke(New UpdateUIDelegate(AddressOf UpdProgram), New Object() {channel, data})
End Sub
Private Sub UpdProgram(ByVal channel As Integer, data As Integer)
how can I get channel and program change?
End Sub
Thanks.