private void Refreshdev_Click(object sender, EventArgs e) { int OutCount = WinMM.midiOutGetNumDevs(); int IntCount = WinMM.midiInGetNumDevs(); OutCombo.Items.Clear(); for (uint i = 0; i < OutCount; i++) { MIDIOUTCAPS MidiDev; if (WinMM.midiOutGetDevCaps(i, out MidiDev, (uint)Marshal.SizeOf(typeof(MIDIOUTCAPS))) == 0) { OutCombo.Items.Add(MidiDev.szPname); OutCombo.Enabled = true; } } InCombo.Items.Clear(); for (uint i = 0; i < IntCount; i++) { MIDIINCAPS MidiDev; if (WinMM.midiInGetDevCaps(i, out MidiDev, (uint)Marshal.SizeOf(typeof(MIDIINCAPS))) == 0) { InCombo.Items.Add(MidiDev.szPname); InCombo.Enabled = true; } } }
public OmniMapperCpl() { InitializeComponent(); DeviceCount = WinMM.midiOutGetNumDevs(); }