Squashed 'libraries/ZMusic/' content from commit ac3e232b00

git-subtree-dir: libraries/ZMusic
git-subtree-split: ac3e232b001129c740b7b65196ae0e1b13b82513
This commit is contained in:
Rachael Alexanderson 2025-07-30 00:24:15 -04:00
commit 9f3cb3d92e
852 changed files with 381622 additions and 0 deletions

1
samples/list_midi_devices/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/build*

View file

@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 2.8.7...3.19)
project(list_midi_devices)
find_package(ZMusic REQUIRED)
add_executable(list_midi_devices list_midi_devices.cpp)
target_link_libraries(list_midi_devices PRIVATE ZMusic::zmusic)

View file

@ -0,0 +1,27 @@
#include <stdio.h>
#include <zmusic.h>
int main()
{
int count = 0;
const ZMusicMidiOutDevice *devices = ZMusic_GetMidiDevices(&count);
for (int i = 0; i < count; ++i)
{
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;
}