void resumeSourcesWithBuffer (int bufferID) { if (noDevice) return; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceID = idleSources.get(i); if (alGetSourcei(sourceID, AL_BUFFER) == bufferID) { if (alGetSourcei(sourceID, AL_SOURCE_STATE) == AL_PAUSED) alSourcePlay(sourceID); } } }
void resumeSourcesWithBuffer (int bufferID) { if (noDevice) return; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceID = idleSources.get(i); if (alGetSourcei(sourceID, AL_BUFFER) == bufferID) { if (alGetSourcei(sourceID, AL_SOURCE_STATE) == AL_PAUSED) alSourcePlay(sourceID); } } }
void resumeSourcesWithBuffer (int bufferID) { if (noDevice) return; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceID = idleSources.get(i); if (alGetSourcei(sourceID, AL_BUFFER) == bufferID) { if (alGetSourcei(sourceID, AL_SOURCE_STATE) == AL_PAUSED) alSourcePlay(sourceID); } } }
public void resumeSound (long soundId) { if (!soundIdToSource.containsKey(soundId)) return; int sourceId = soundIdToSource.get(soundId); if (alGetSourcei(sourceId, AL_SOURCE_STATE) == AL_PAUSED) alSourcePlay(sourceId); }
public void resumeSound (long soundId) { if (!soundIdToSource.containsKey(soundId)) return; int sourceId = soundIdToSource.get(soundId); if (alGetSourcei(sourceId, AL_SOURCE_STATE) == AL_PAUSED) alSourcePlay(sourceId); }
void resumeSourcesWithBuffer (int bufferID) { if (noDevice) return; for (int i = 0, n = idleSources.size; i < n; i++) { int sourceID = idleSources.get(i); if (alGetSourcei(sourceID, AL_BUFFER) == bufferID) { if (alGetSourcei(sourceID, AL_SOURCE_STATE) == AL_PAUSED) alSourcePlay(sourceID); } } }
public void resumeSound (long soundId) { if (!soundIdToSource.containsKey(soundId)) return; int sourceId = soundIdToSource.get(soundId); if (alGetSourcei(sourceId, AL_SOURCE_STATE) == AL_PAUSED) alSourcePlay(sourceId); }
public void resumeSound (long soundId) { if (!soundIdToSource.containsKey(soundId)) return; int sourceId = soundIdToSource.get(soundId); if (alGetSourcei(sourceId, AL_SOURCE_STATE) == AL_PAUSED) alSourcePlay(sourceId); }
@Override public long loop (float volume) { if (audio.noDevice) return 0; int sourceID = audio.obtainSource(false); if (sourceID == -1) return -1; long soundId = audio.getSoundId(sourceID); alSourcei(sourceID, AL_BUFFER, bufferID); alSourcei(sourceID, AL_LOOPING, AL_TRUE); alSourcef(sourceID, AL_GAIN, volume); alSourcePlay(sourceID); return soundId; }
@Override public long loop (float volume) { if (audio.noDevice) return 0; int sourceID = audio.obtainSource(false); if (sourceID == -1) return -1; long soundId = audio.getSoundId(sourceID); alSourcei(sourceID, AL_BUFFER, bufferID); alSourcei(sourceID, AL_LOOPING, AL_TRUE); alSourcef(sourceID, AL_GAIN, volume); alSourcePlay(sourceID); return soundId; }
@Override public long loop (float volume) { if (audio.noDevice) return 0; int sourceID = audio.obtainSource(false); if (sourceID == -1) return -1; long soundId = audio.getSoundId(sourceID); alSourcei(sourceID, AL_BUFFER, bufferID); alSourcei(sourceID, AL_LOOPING, AL_TRUE); alSourcef(sourceID, AL_GAIN, volume); alSourcePlay(sourceID); return soundId; }
@Override public long loop (float volume) { if (audio.noDevice) return 0; int sourceID = audio.obtainSource(false); if (sourceID == -1) return -1; long soundId = audio.getSoundId(sourceID); alSourcei(sourceID, AL_BUFFER, bufferID); alSourcei(sourceID, AL_LOOPING, AL_TRUE); alSourcef(sourceID, AL_GAIN, volume); alSourcePlay(sourceID); return soundId; }
public long play (float volume) { if (audio.noDevice) return 0; int sourceID = audio.obtainSource(false); if (sourceID == -1) { // Attempt to recover by stopping the least recently played sound audio.retain(this, true); sourceID = audio.obtainSource(false); } else audio.retain(this, false); // In case it still didn't work if (sourceID == -1) return -1; long soundId = audio.getSoundId(sourceID); alSourcei(sourceID, AL_BUFFER, bufferID); alSourcei(sourceID, AL_LOOPING, AL_FALSE); alSourcef(sourceID, AL_GAIN, volume); alSourcePlay(sourceID); return soundId; }
public long play (float volume) { if (audio.noDevice) return 0; int sourceID = audio.obtainSource(false); if (sourceID == -1) { // Attempt to recover by stopping the least recently played sound audio.retain(this, true); sourceID = audio.obtainSource(false); } else audio.retain(this, false); // In case it still didn't work if (sourceID == -1) return -1; long soundId = audio.getSoundId(sourceID); alSourcei(sourceID, AL_BUFFER, bufferID); alSourcei(sourceID, AL_LOOPING, AL_FALSE); alSourcef(sourceID, AL_GAIN, volume); alSourcePlay(sourceID); return soundId; }
public long play (float volume) { if (audio.noDevice) return 0; int sourceID = audio.obtainSource(false); if (sourceID == -1) { // Attempt to recover by stopping the least recently played sound audio.retain(this, true); sourceID = audio.obtainSource(false); } else audio.retain(this, false); // In case it still didn't work if (sourceID == -1) return -1; long soundId = audio.getSoundId(sourceID); alSourcei(sourceID, AL_BUFFER, bufferID); alSourcei(sourceID, AL_LOOPING, AL_FALSE); alSourcef(sourceID, AL_GAIN, volume); alSourcePlay(sourceID); return soundId; }
public long play (float volume) { if (audio.noDevice) return 0; int sourceID = audio.obtainSource(false); if (sourceID == -1) { // Attempt to recover by stopping the least recently played sound audio.retain(this, true); sourceID = audio.obtainSource(false); } else audio.retain(this, false); // In case it still didn't work if (sourceID == -1) return -1; long soundId = audio.getSoundId(sourceID); alSourcei(sourceID, AL_BUFFER, bufferID); alSourcei(sourceID, AL_LOOPING, AL_FALSE); alSourcef(sourceID, AL_GAIN, volume); alSourcePlay(sourceID); return soundId; }
public void update () { if (audio.noDevice) return; if (sourceID == -1) return; boolean end = false; int buffers = alGetSourcei(sourceID, AL_BUFFERS_PROCESSED); while (buffers-- > 0) { int bufferID = alSourceUnqueueBuffers(sourceID); if (bufferID == AL_INVALID_VALUE) break; if (renderedSecondsQueue.size > 0) renderedSeconds = renderedSecondsQueue.pop(); if (end) continue; if (fill(bufferID)) alSourceQueueBuffers(sourceID, bufferID); else end = true; } if (end && alGetSourcei(sourceID, AL_BUFFERS_QUEUED) == 0) { stop(); if (onCompletionListener != null) onCompletionListener.onCompletion(this); } // A buffer underflow will cause the source to stop. if (isPlaying && alGetSourcei(sourceID, AL_SOURCE_STATE) != AL_PLAYING) alSourcePlay(sourceID); }
public void update () { if (audio.noDevice) return; if (sourceID == -1) return; boolean end = false; int buffers = alGetSourcei(sourceID, AL_BUFFERS_PROCESSED); while (buffers-- > 0) { int bufferID = alSourceUnqueueBuffers(sourceID); if (bufferID == AL_INVALID_VALUE) break; if (renderedSecondsQueue.size > 0) renderedSeconds = renderedSecondsQueue.pop(); if (end) continue; if (fill(bufferID)) alSourceQueueBuffers(sourceID, bufferID); else end = true; } if (end && alGetSourcei(sourceID, AL_BUFFERS_QUEUED) == 0) { stop(); if (onCompletionListener != null) onCompletionListener.onCompletion(this); } // A buffer underflow will cause the source to stop. if (isPlaying && alGetSourcei(sourceID, AL_SOURCE_STATE) != AL_PLAYING) alSourcePlay(sourceID); }
public void update () { if (audio.noDevice) return; if (sourceID == -1) return; boolean end = false; int buffers = alGetSourcei(sourceID, AL_BUFFERS_PROCESSED); while (buffers-- > 0) { int bufferID = alSourceUnqueueBuffers(sourceID); if (bufferID == AL_INVALID_VALUE) break; if (renderedSecondsQueue.size > 0) renderedSeconds = renderedSecondsQueue.pop(); if (end) continue; if (fill(bufferID)) alSourceQueueBuffers(sourceID, bufferID); else end = true; } if (end && alGetSourcei(sourceID, AL_BUFFERS_QUEUED) == 0) { stop(); if (onCompletionListener != null) onCompletionListener.onCompletion(this); } // A buffer underflow will cause the source to stop. if (isPlaying && alGetSourcei(sourceID, AL_SOURCE_STATE) != AL_PLAYING) alSourcePlay(sourceID); }
public void update () { if (audio.noDevice) return; if (sourceID == -1) return; boolean end = false; int buffers = alGetSourcei(sourceID, AL_BUFFERS_PROCESSED); while (buffers-- > 0) { int bufferID = alSourceUnqueueBuffers(sourceID); if (bufferID == AL_INVALID_VALUE) break; if (renderedSecondsQueue.size > 0) renderedSeconds = renderedSecondsQueue.pop(); if (end) continue; if (fill(bufferID)) alSourceQueueBuffers(sourceID, bufferID); else end = true; } if (end && alGetSourcei(sourceID, AL_BUFFERS_QUEUED) == 0) { stop(); if (onCompletionListener != null) onCompletionListener.onCompletion(this); } // A buffer underflow will cause the source to stop. if (isPlaying && alGetSourcei(sourceID, AL_SOURCE_STATE) != AL_PLAYING) alSourcePlay(sourceID); }