diff --git a/include/zmusic.h b/include/zmusic.h index 1495ca3..0dd186c 100644 --- a/include/zmusic.h +++ b/include/zmusic.h @@ -333,6 +333,7 @@ extern "C" // The rest of the decoder interface is only useful for streaming music. DLL_IMPORT const ZMusicMidiOutDevice *ZMusic_GetMidiDevices(int *pAmount); + DLL_IMPORT int ZMusic_GetADLBanks(const char* const** pNames); // Direct access to the CD drive. // Stops playing the CD diff --git a/source/mididevices/music_adlmidi_mididevice.cpp b/source/mididevices/music_adlmidi_mididevice.cpp index c98f336..f421f66 100644 --- a/source/mididevices/music_adlmidi_mididevice.cpp +++ b/source/mididevices/music_adlmidi_mididevice.cpp @@ -270,10 +270,23 @@ MIDIDevice *CreateADLMIDIDevice(const char *Args) return new ADLMIDIDevice(&config); } +DLL_EXPORT int ZMusic_GetADLBanks(const char* const** pNames) +{ + if (pNames) *pNames = adl_getBankNames(); + return adl_getBanksCount(); +} + #else MIDIDevice* CreateADLMIDIDevice(const char* Args) { throw std::runtime_error("ADL device not supported in this configuration"); } + +DLL_EXPORT int ZMusic_GetADLBanks(const char* const** pNames) +{ + // The export needs to be there even if non-functional. + return 0; +} + #endif