public ConfigureDialog() { InitializeComponent(); var ports = SerialPort.GetPortNames(); foreach (var port in ports) { comboBox1.Items.Add(port); } var midiDevices = NAudioMidiOutput.GetMIDIOutDevices(); foreach (var device in midiDevices) { comboBox2.Items.Add(device.Item1); } }
private void OpenMidiOutput(int DeviceID) { if (Output != null) { Output.Dispose(); } if (DeviceID < 0) { ShowError("Illegal Device ID for Midi Output. ID: " + DeviceID); return; } try { var MidiOutput = new NAudioMidiOutput(DeviceID); Output = MidiOutput; } catch (Exception e) { ShowError(e.Message); } }
private void OpenMidiOutput(int DeviceID) { if (Output != null) Output.Dispose(); if (DeviceID < 0) { ShowError("Illegal Device ID for Midi Output. ID: " + DeviceID); return; } try { var MidiOutput = new NAudioMidiOutput(DeviceID); Output = MidiOutput; } catch (Exception e) { ShowError(e.Message); } }