summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMagne Nordtveit <[email protected]>2013-03-07 07:33:53 +0100
committermagnen <>2013-03-07 07:33:53 +0100
commit14961042bb8ca1f9f787d9d1f1cb64560b6dba22 (patch)
tree004ae526faed8df72236322869f44d637e45770a /src
parent92e931caf64cf24e2b885d2552e64aebcf70a45a (diff)
Adding method for determining the playing state of an audio source.
Diffstat (limited to 'src')
-rw-r--r--src/java/com/jogamp/openal/sound3d/Source.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/java/com/jogamp/openal/sound3d/Source.java b/src/java/com/jogamp/openal/sound3d/Source.java
index 2e2f512..873ad12 100644
--- a/src/java/com/jogamp/openal/sound3d/Source.java
+++ b/src/java/com/jogamp/openal/sound3d/Source.java
@@ -89,6 +89,17 @@ public final class Source {
}
/**
+ * Determines whether or not this source is playing.
+ *
+ * @return {@code true} if this source is playing.
+ */
+ public boolean isPlaying() {
+ int[] result = new int[1];
+ al.alGetSourcei(sourceID, AL.AL_SOURCE_STATE, result, 0);
+ return result[0] == AL.AL_PLAYING;
+ }
+
+ /**
* Sets the pitch of the audio on this source. The pitch may be modified
* without altering the playback speed of the audio.
*