First post, by realnc
- Rank
- Oldbie
I tried using the C interface, but it's not very useful right now. The various callbacks of mt32emu_midi_receiver_i have no user data argument (void*), so they have no way of knowing where to send the data they get (like which mt32emu_context to use.)
All of these functions should have an extra "void *userData" argument. mt32emu_set_midi_receiver() should also take such an argument, which it then always forwards to the various callbacks. Setting a receiver would then look like this:
mt32emu_set_midi_receiver(myContext.d, myMidiReceiver, myUserData);
The callbacks would then always receive the 'myUserData' pointer.
Alternatively (or perhaps even better), mt32emu_midi_receiver_i_v0 should have a "void* userData" member, which the callbacks can then access easily through their 'instance' argument.