Audio isPaused()

Finally back to work on jME stuff. Got the new build integrated and am happily using the new Audio package.



I store my sounds, some of which are loops, in an array and needed to be able to pause and restart. Well, we can do that, but I had no way of knowing which sounds were playing when I paused, so I would know which ones to restart. I noticed that the OpenAL players had a private isPaused variable already, so I just exposed it by adding an isPaused() function to AudioTrack, AudioPlayer, OpenALMemoryPlayer and OpenALStreamPlayer. I don't know what the process is for getting this into the release code, but if any one wants the updated code, just let me know.



It's easy to add, so I figured I'd put this in as a feature request in cause the author wants to implement it differently.



Cheers,

Joe

Probably the isPaused should be removed in favor of the existing source.state information that is used everywhere else.

I'm not sure I understand. I was following the example of AudioTrack.isPlaying(). If that is an accepted way of testing to see if a sound is playing, why wouldn't an isPaused function be just as valid for testing that state? There is no way to access isPaused because it's private, (the same with isPlaying).



I'm obviously missing a beat hereā€¦ :slight_smile:

I'm not talking about methods here, rather I'm talking about the fact that we keep track of an audio source's "state" (playing, paused, stopped, etc.) in another field in the OpenALSource, so the isPaused field of OpenALMemoryAudioPlayer, etc. is probably redundant.

Oh, I get it. thanks for the explanation.