mstop4 / FMODGMS

🎶 GML bindings to the FMOD Studio low-level API for GM:S and GMS2. Can be used in Windows, macOS, and Linux games.
https://quadolorgames.itch.io/fmodgms
BSD 2-Clause "Simplified" License
62 stars 18 forks source link

Feature Request: FMODGMS_Snd_IsPlaying #23

Closed BPzeBanshee closed 4 years ago

BPzeBanshee commented 4 years ago

Hello,

Looking over the documentation FMODGMS has no function engine-side to check if a channel or sound is currently playing. GMFMODSimple and every other audio engine for GM I've seen has this as a feature and it'd be good to have it here too.

My personal use case involves managing a variable that used to use FMODInstanceIsPlaying. Every attempt I've made to try and make this work through other means, including by checking track position and seeing if it's stuck at 0 for some time, seems to fail and/or require copious amounts of extra code for something that used to be just one line with an FMOD API check.

BPzeBanshee commented 4 years ago

Thought this would be a simple affair to implement myself rather than waste anyone else's time. Turns out I was right: the project is very easy to read and understand even for someone not terribly versed in C++ like myself, and FMOD already had the classes ready, it was just a matter of adding the wrapper functions in a similar way to the other ones.

Pull request #24 addresses this issue as far as the sources and DLL support goes, although I'll defer to the project maintainer as to how to alter the project examples GML-side.