private void DeviceSelector_SelectedIndexChanged(object sender, EventArgs e) { if (device?.IsOpen == true) { device.Close(); } device = null; device = Midi.Devices.DeviceManager.OutputDevices.Where((d) => d.Name.Equals(deviceSelector.SelectedItem)).First(); device.Open(); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { mon?.Dispose(); device?.Close(); }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { device?.Close(); device = Midi.Devices.DeviceManager.OutputDevices.Where((d) => d.Name.Equals(midiDevices.SelectedItem)).First(); device?.Open(); }