SoundStatus(-1) - check all sounds

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
OgreVorbis
User
User
Posts: 77
Joined: Thu Jan 16, 2020 10:47 pm

SoundStatus(-1) - check all sounds

Post by OgreVorbis »

I'm in a situation where I need to check if ALL sounds have stopped playing before playing another. It looks like I'll have to code a loop, checking IsSound(i) and continuing to increment checking the status of each is stopped. This is kind of annoying considering that we have the ability to stop playing all sounds with StopSound(-1) or #PB_All, but we can't check all of them.
My blog/software site: http://dosaidsoft.com/
BarryG
Addict
Addict
Posts: 4134
Joined: Thu Apr 18, 2019 8:17 am

Re: SoundStatus(-1) - check all sounds

Post by BarryG »

+1. This would be great, and matches the current command and constant pattern:

Code: Select all

If SoundStatus(#PB_Sound_All)=0
  Debug "No sounds are playing"
EndIf
Post Reply