예제 #1
0
 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;
 }
예제 #2
0
 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;
 }