summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/openal
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-03-21 03:58:59 -0700
committerSven Gothel <[email protected]>2013-03-21 03:58:59 -0700
commit633b84e5d673e5c6307776f0161a2342644951a3 (patch)
tree19ced22b1f7d1ab4fe614166228f63d1477f5d45 /src/java/com/jogamp/openal
parent49f6d00ece1e93082bd95149ebc3aac3283250fe (diff)
parent14961042bb8ca1f9f787d9d1f1cb64560b6dba22 (diff)
Merge pull request #9 from magnen/master
Adding method for retrieving the playing state of a Source.
Diffstat (limited to 'src/java/com/jogamp/openal')
-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.
*