コード例 #1
0
        public static void UnregisterConsumer(IMidiConsumer consumer)
        {
            if (!MidiConsumers.Contains(consumer))
            {
                return;
            }

            foreach (var midiIn in MidiInsWithDevices.Keys)
            {
                midiIn.MessageReceived -= consumer.MessageReceivedHandler;
                midiIn.ErrorReceived   -= consumer.ErrorReceivedHandler;
            }

            MidiConsumers.Remove(consumer);
            if (MidiConsumers.Count == 0)
            {
                CloseMidiDevices();
            }
        }
コード例 #2
0
 public static void RegisterConsumer(IMidiConsumer consumer)
 {
     CloseMidiDevices();
     MidiConsumers.Add(consumer);
     ScanAndRegisterToMidiDevices();
 }