public unsafe void SetPlaybackCallback(MidiEventHandler handler) { LibFluidsynth.fluid_player_set_playback_callback(Handle, Utility.PassDelegatePointer <LibFluidsynth.handle_midi_event_func_t>( (d, e) => { using (var ev = new MidiEvent(e)) { return(handler(ev)); } }, out var b), null); _handler = b; }
public unsafe MidiRouter(Settings settings, MidiEventHandler handler) : base(LibFluidsynth.new_fluid_midi_router(settings.Handle, Utility.PassDelegatePointer <LibFluidsynth.handle_midi_event_func_t>( (d, e) => { using (var ev = new MidiEvent(e)) { return(handler(ev)); } }, out var wrapHandler), null)) { _settings = settings; _handler = wrapHandler; }