本文整理匯總了Java中org.lwjgl.openal.AL10.AL_PAUSED屬性的典型用法代碼示例。如果您正苦於以下問題:Java AL10.AL_PAUSED屬性的具體用法?Java AL10.AL_PAUSED怎麽用?Java AL10.AL_PAUSED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.lwjgl.openal.AL10
的用法示例。
在下文中一共展示了AL10.AL_PAUSED屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: findFreeSource
/**
* Find a free sound source
*
* @return The index of the free sound source
*/
private int findFreeSource() {
for (int i=1;i<sourceCount-1;i++) {
int state = AL10.alGetSourcei(sources.get(i), AL10.AL_SOURCE_STATE);
if ((state != AL10.AL_PLAYING) && (state != AL10.AL_PAUSED)) {
return i;
}
}
return -1;
}
示例2: isMusicPlaying
/**
* Check if the music is currently playing
*
* @return True if the music is playing
*/
public boolean isMusicPlaying()
{
if (!soundWorks) {
return false;
}
int state = AL10.alGetSourcei(sources.get(0), AL10.AL_SOURCE_STATE);
return ((state == AL10.AL_PLAYING) || (state == AL10.AL_PAUSED));
}
示例3: resumeSourcesWithBuffer
public void resumeSourcesWithBuffer(int bufferID) {
if (AL.isCreated()) {
for (int i = 0, n = idleSources.size; i < n; i++) {
int sourceID = idleSources.get(i);
if (AL10.alGetSourcei(sourceID, AL10.AL_BUFFER) == bufferID) {
if (AL10.alGetSourcei(sourceID, AL10.AL_SOURCE_STATE) == AL10.AL_PAUSED) {
AL10.alSourcePlay(sourceID);
}
}
}
}
}
示例4: resumeSound
public void resumeSound(long soundId) {
if (AL.isCreated()) {
if (soundIdToSource.containsKey(soundId)) {
int sourceId = soundIdToSource.get(soundId);
if (AL10.alGetSourcei(sourceId, AL10.AL_SOURCE_STATE) == AL10.AL_PAUSED) {
AL10.alSourcePlay(sourceId);
}
}
}
}
示例5: update
public void update(){
int state = AL10.alGetSourcei(id, AL10.AL_SOURCE_STATE);
if(state != AL10.AL_PLAYING && state != AL10.AL_PAUSED)
stop();
}