Add isPaused() and isStopped() methods to Sound interface

This commit is contained in:
2021-04-08 22:17:51 +02:00
parent c8f182aef1
commit 028faae564
2 changed files with 14 additions and 0 deletions

View File

@@ -59,6 +59,16 @@ public class AudioSource implements Sound, Disposable {
return alGetSourcei(id, AL_SOURCE_STATE) == AL_PLAYING;
}
@Override
public boolean isPaused() {
return alGetSourcei(id, AL_SOURCE_STATE) == AL_PAUSED;
}
@Override
public boolean isStopped() {
return alGetSourcei(id, AL_SOURCE_STATE) == AL_STOPPED;
}
@Override
public void setRepeat(boolean repeat) {
alSourcei(id, AL_LOOPING, repeat ? AL_TRUE : AL_FALSE);