- extended list MIDI devices sample

This commit is contained in:
alexey.lysiuk 2020-01-07 13:15:24 +02:00
parent e02e7fb1ca
commit af79a0bec0

View file

@ -4,11 +4,23 @@
int main()
{
int count = 0;
const MidiOutDevice *devices = ZMusic_GetMidiDevices(&count);
const ZMusicMidiOutDevice *devices = ZMusic_GetMidiDevices(&count);
for (int i = 0; i < count; ++i)
{
printf("[%i] %s\n", i, devices[i].Name);
const ZMusicMidiOutDevice &d = devices[i];
const char *tech = "<Unknown>";
switch (d.Technology)
{
case MIDIDEV_MIDIPORT: tech = "MIDIPORT"; break;
case MIDIDEV_SYNTH: tech = "SYNTH"; break;
case MIDIDEV_SQSYNTH: tech = "SQSYNTH"; break;
case MIDIDEV_FMSYNTH: tech = "FMSYNTH"; break;
case MIDIDEV_MAPPER: tech = "MAPPER"; break;
case MIDIDEV_WAVETABLE: tech = "WAVETABLE"; break;
case MIDIDEV_SWSYNTH: tech = "SWSYNTH"; break;
}
printf("[%i] %i. %s: %s\n", i, d.ID, d.Name, tech);
}
return 0;