Add isPaused() and isStopped() methods to Sound interface
This commit is contained in:
@@ -9,6 +9,10 @@ public interface Sound {
|
||||
|
||||
boolean isPlaying();
|
||||
|
||||
boolean isPaused();
|
||||
|
||||
boolean isStopped();
|
||||
|
||||
void setGain(float gain);
|
||||
|
||||
void setRepeat(boolean repeat);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user