How to get the names of the MIDI devices to the comboBox?

62 Views Asked by At

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?

0

There are 0 best solutions below