Hi, I’m trying to write a fade system that can transition from the current ChannelControl fade point value to another.
Reading this older thread it looks like there is no easy way to do a direct read of the current fade value, and I couldn’t find any getter in FMOD Core 2.02.19.
As a workaround, I’m checking for any fade points with ChannelControl::getFadePoints, and calculating the value based on the current clock position - it works if currently in the middle of a fade, but once the fade is over getFadePoints returns 0 fade points, so I can’t get the last value.
Would manually tracking this be the way to go, or is there another way to get the value?
Unfortunately, manually tracking the value would be the way to go - as noted in the linked thread, fade points are applied to an internal gain value that isn’t exposed via the API. That said, I’ve added the ability to retrieve the current value of the fade to our internal feature/improvement tracker.
Thank you for confirming this and adding this to your internal tracker. It would be convenient to get this directly, but for now I have this solution:
Check ChannelControl::getFadePoints and calculate the value from the current clock time, while also caching the last endpoint target value set by the user. If there are no fadepoints available, then use the cached value. So far it’s working without any problems.