...get the names of all MIDI out devices?
|
Autor:
Ulli Conrad |
[ Print tip
] | | |
procedure GetMIDIOutDevices(Devices: TStrings);
var
i, DNum: Integer;
Caps: TMIDIOUTCAPSA;
begin
DNum := MIDIOutGetNumDevs; // Number of Devices
for i := 0 to DNum - 1 do // Query Devicenames
begin
MIDIOutGetDevCaps(i, @Caps, SizeOf(TMIDIOutCapsA));
Devices.Add(string(Caps.szPname));
end;
end;
// Usage:
var
MIDIDevices: TStringList;
begin
MIDIDevices := TStringList.Create;
try
GetMIDIOutDevices(MIDIDevices);
// Do anything with the device name list
finally
MIDIDevices.Free;
end;
end;
|