From ecad4aaf060a7aa595bec3796e2fec3b24be4e0b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 13 Mar 2021 23:53:07 +0100 Subject: [PATCH] - added ZMusic_GetDeviceType function to return the currently active MIDI synth. --- include/zmusic.h | 1 + source/zmusic/zmusic.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/zmusic.h b/include/zmusic.h index 59d4a85..7de05c5 100644 --- a/include/zmusic.h +++ b/include/zmusic.h @@ -314,6 +314,7 @@ extern "C" DLL_IMPORT void ZMusic_Close(ZMusic_MusicStream song); DLL_IMPORT zmusic_bool ZMusic_SetSubsong(ZMusic_MusicStream song, int subsong); DLL_IMPORT zmusic_bool ZMusic_IsLooping(ZMusic_MusicStream song); + DLL_IMPORT int ZMusic_GetDeviceType(ZMusic_MusicStream song); DLL_IMPORT zmusic_bool ZMusic_IsMIDI(ZMusic_MusicStream song); DLL_IMPORT void ZMusic_VolumeChanged(ZMusic_MusicStream song); DLL_IMPORT zmusic_bool ZMusic_WriteSMF(ZMusic_MidiSource source, const char* fn, int looplimit); diff --git a/source/zmusic/zmusic.cpp b/source/zmusic/zmusic.cpp index 1b8916e..a9f3ca8 100644 --- a/source/zmusic/zmusic.cpp +++ b/source/zmusic/zmusic.cpp @@ -440,6 +440,12 @@ DLL_EXPORT zmusic_bool ZMusic_IsLooping(MusInfo *song) return song->m_Looping; } +DLL_EXPORT int ZMusic_GetDeviceType(MusInfo* song) +{ + if (!song) return false; + return song->GetDeviceType(); +} + DLL_EXPORT zmusic_bool ZMusic_IsMIDI(MusInfo *song) { if (!song) return false;