Example #1
0
        private static void CloseMidiDevices()
        {
            foreach (var midiInputDevice in MidiInsWithDevices.Keys)
            {
                foreach (var midiConsumer in MidiConsumers)
                {
                    midiInputDevice.MessageReceived -= midiConsumer.MessageReceivedHandler;
                    midiInputDevice.ErrorReceived   -= midiConsumer.ErrorReceivedHandler;
                }

                try
                {
                    midiInputDevice.Stop();
                    midiInputDevice.Close();
                    midiInputDevice.Dispose();
                }
                catch (Exception e)
                {
                    Log.Debug("exception: " + e);
                }
            }

            MidiInsWithDevices.Clear();
            MidiInsByDeviceIdHash.Clear();
        }
Example #2
0
 public static MidiInCapabilities GetDescriptionForMidiIn(MidiIn midiIn)
 {
     MidiInsWithDevices.TryGetValue(midiIn, out var description);
     return(description);
 }