summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/openal
diff options
context:
space:
mode:
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.
*