With the following code in Lazarus, I can check out how many MIDI devices there are available on my PC and put the ID numbers to the combo box:
var MyMIDIDevice : integer;
begin
cmbMIDIdevs.Clear;
for MyMIDIDevice := 0 To midiOutGetNumDevs() - 1 do
begin
cmbMIDIdevs.Items.Add(inttostr(MyMIDIDevice));
end;
cmbMIDIdevs.ItemIndex := 0;
OpenMidiOut(cmbMIDIdevs.ItemIndex);
end;
The plain number does not tell much about the particular MIDI device, and I would like to put the names of the MIDI devices to cmbBox items.
How to do that?