/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void midiEventReceivedB(object sender, MidiEventReceivedEventArgs e) { var ea = new CancelMidiEventReceivedEventArgs(MidiPort.PortB, e); MidiEventHooked?.Invoke(sender, ea); if (ea.Cancel) { return; } MidiEventReceivedB?.Invoke(sender, e.Event); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public static void SendMidiEvent(MidiPort port, MidiEvent e) { switch (port) { case MidiPort.PortA: MidiEventReceivedA?.Invoke(typeof(MidiManager), e); break; case MidiPort.PortB: MidiEventReceivedB?.Invoke(typeof(MidiManager), e); break; default: MidiEventReceivedA?.Invoke(typeof(MidiManager), e); MidiEventReceivedB?.Invoke(typeof(MidiManager), e); break; } }