private void MidiInComboBox_SelectedIndexChanged(object sender, System.EventArgs e) { if (null != _inputDevice) { _inputDevice.Close(); } _inputDevice = MidiInComboBox.SelectedItem as MidiInputDevice; if (null != _inputDevice) { _inputDevice.Input += _inputDevice_Input; } _inputDevice.Open(); _inputDevice.Start(); }
public void StopMidi() { if (_inDevice != null && _inDevice.IsStarted) { _inDevice.Stop(); _inDevice.Close(); _inDevice.MessageReceived -= new MidiMessageEventHandler(InDevice_MessageRecieved); } }
private void StopDevice() { if (_inDevice != null && _inDevice.IsStarted) { _inDevice.Stop(); _inDevice.Close(); _inDevice.MessageReceived -= new MidiMessageEventHandler(InDevice_MessageReceived); this.buttonStop.Enabled = false; this.buttonStart.Enabled = true; } }
private void InputsComboBox_SelectedIndexChanged(object sender, EventArgs e) { if (null != _device) { _device.Close(); } _device = InputsComboBox.SelectedItem as MidiInputDevice; _device.Input += device_Input; _device.Open(); _device.Start(); }
public void StopAndCloseDevice() { SendControlChange(176, 0, 0); if ((!(_outDevice == null) && _outDevice.IsOpened)) { _outDevice.Close(); if ((!(_inDevice == null) && _inDevice.IsOpened)) { _inDevice.Close(); } isReady = false; } }