From 61b8e6792a4a1be2171935d6b2fe8d1a8e9dc834 Mon Sep 17 00:00:00 2001 From: Mark Johnson Date: Fri, 27 Oct 2006 18:33:24 +0000 Subject: [PATCH] Added the ability to check if a sound is currently playing. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@66 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/java/com/threerings/openal/Sound.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/java/com/threerings/openal/Sound.java b/src/java/com/threerings/openal/Sound.java index fbe67ca7..73c182d9 100644 --- a/src/java/com/threerings/openal/Sound.java +++ b/src/java/com/threerings/openal/Sound.java @@ -173,6 +173,15 @@ public class Sound } } + /** + * Called to check if this sound is currently playing. + */ + public boolean isPlaying () + { + return (_sourceId != -1 && AL10.AL_PLAYING == + AL10.alGetSourcei(_sourceId, AL10.AL_SOURCE_STATE)); + } + protected Sound (SoundGroup group, ClipBuffer buffer) { _group = group;