本文整理匯總了Java中org.lwjgl.openal.AL10.alSourceUnqueueBuffers方法的典型用法代碼示例。如果您正苦於以下問題:Java AL10.alSourceUnqueueBuffers方法的具體用法?Java AL10.alSourceUnqueueBuffers怎麽用?Java AL10.alSourceUnqueueBuffers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.lwjgl.openal.AL10
的用法示例。
在下文中一共展示了AL10.alSourceUnqueueBuffers方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: cleanUpSource
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
/**
* Clean up the buffers applied to the sound source
*/
private void cleanUpSource() {
SoundStore store = SoundStore.get();
AL10.alSourceStop(store.getSource(0));
IntBuffer buffer = BufferUtils.createIntBuffer(1);
int queued = AL10.alGetSourcei(store.getSource(0), AL10.AL_BUFFERS_QUEUED);
while (queued > 0)
{
AL10.alSourceUnqueueBuffers(store.getSource(0), buffer);
queued--;
}
AL10.alSourcei(store.getSource(0), AL10.AL_BUFFER, 0);
}
示例2: update
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
public synchronized void update() {
if (sourceID == -1) return;
boolean end = false;
int buffers = AL10.alGetSourcei(sourceID, AL10.AL_BUFFERS_PROCESSED);
while (buffers-- > 0) {
int bufferID = AL10.alSourceUnqueueBuffers(sourceID);
if (bufferID == AL10.AL_INVALID_VALUE) break;
renderedSeconds += secondsPerBuffer;
if (end) continue;
if (fill(bufferID)) {
AL10.alSourceQueueBuffers(sourceID, bufferID);
} else {
end = true;
}
}
if (end && AL10.alGetSourcei(sourceID, AL10.AL_BUFFERS_QUEUED) == 0) {
stop();
}
if (isPlaying && AL10.alGetSourcei(sourceID, AL10.AL_SOURCE_STATE) != AL10.AL_PLAYING)
AL10.alSourcePlay(sourceID);
}
示例3: removeBuffers
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
/**
* Clean up the buffers applied to the sound source
*/
private void removeBuffers() {
IntBuffer buffer = BufferUtils.createIntBuffer(1);
int queued = AL10.alGetSourcei(source, AL10.AL_BUFFERS_QUEUED);
while (queued > 0)
{
AL10.alSourceUnqueueBuffers(source, buffer);
queued--;
}
}
示例4: update
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
/**
* Poll the bufferNames - check if we need to fill the bufferNames with another
* section.
*
* Most of the time this should be reasonably quick
*/
public void update() {
if (done) {
return;
}
int processed = AL10.alGetSourcei(source, AL10.AL_BUFFERS_PROCESSED);
while (processed > 0) {
unqueued.clear();
AL10.alSourceUnqueueBuffers(source, unqueued);
if (stream(unqueued.get(0))) {
AL10.alSourceQueueBuffers(source, unqueued);
} else {
remainingBufferCount--;
if (remainingBufferCount == 0) {
done = true;
}
}
processed--;
}
int state = AL10.alGetSourcei(source, AL10.AL_SOURCE_STATE);
if (state != AL10.AL_PLAYING) {
AL10.alSourcePlay(source);
}
}
示例5: cleanUpSource
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
/**
* Clean up the buffers applied to the sound source
*/
private void cleanUpSource() {
AL10.alSourceStop(store.getSource(0));
IntBuffer buffer = BufferUtils.createIntBuffer(1);
int queued = AL10.alGetSourcei(store.getSource(0), AL10.AL_BUFFERS_QUEUED);
while (queued > 0)
{
AL10.alSourceUnqueueBuffers(store.getSource(0), buffer);
queued--;
}
AL10.alSourcei(store.getSource(0), AL10.AL_BUFFER, 0);
}
示例6: CheckBuffers
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
private void CheckBuffers()
{
if (game.gameOptions.soundEnable == false)
return;
int TheChannel = sources.get(0);
int Count = -1;
if (TheChannel >= 0)
{
Count = AL10.alGetSourcei(TheChannel, AL10.AL_BUFFERS_PROCESSED);
while (true)
{
if (Count > 0)
{
Count--;
intBuffer.clear();
intBuffer.put(0);
intBuffer.flip();
AL10.alSourceUnqueueBuffers(sources.get(0), intBuffer);
}
else
{
break;
}
}
}
}
示例7: update
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
public boolean update(int source, boolean loop){
if(dead)
return false;
int processed = AL10.alGetSourcei(source, AL10.AL_BUFFERS_PROCESSED);
for(int i=0;i<processed;i++){
int buffer = AL10.alSourceUnqueueBuffers(source);
if(!stream(buffer)){
boolean close = true;
if(loop){
rewind();
close = !stream(buffer);
}
if(close)
return false;
}
AL10.alSourceQueueBuffers(source, buffer);
}
if(processed == buffers.limit()){
AL10.alSourcePlay(source);
}
return true;
}
示例8: cleanUpSource
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
/**
* Clean up the buffers applied to the sound source
*/
private void cleanUpSource()
{
AL10.alSourceStop(store.getSource(0));
IntBuffer buffer = BufferUtils.createIntBuffer(1);
int queued = AL10.alGetSourcei(store.getSource(0), AL10.AL_BUFFERS_QUEUED);
while (queued > 0)
{
AL10.alSourceUnqueueBuffers(store.getSource(0), buffer);
queued--;
}
AL10.alSourcei(store.getSource(0), AL10.AL_BUFFER, 0);
}
示例9: update
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
/**
* Poll the bufferNames - check if we need to fill the bufferNames with another
* section.
*
* Most of the time this should be reasonably quick
*/
public void update() {
if (done) {
return;
}
float sampleRate = audio.getRate();
float sampleSize;
if (audio.getChannels() > 1) {
sampleSize = 4; // AL10.AL_FORMAT_STEREO16
} else {
sampleSize = 2; // AL10.AL_FORMAT_MONO16
}
int processed = AL10.alGetSourcei(source, AL10.AL_BUFFERS_PROCESSED);
while (processed > 0) {
unqueued.clear();
AL10.alSourceUnqueueBuffers(source, unqueued);
int bufferIndex = unqueued.get(0);
float bufferLength = (AL10.alGetBufferi(bufferIndex, AL10.AL_SIZE) / sampleSize) / sampleRate;
positionOffset += bufferLength;
if (stream(bufferIndex)) {
AL10.alSourceQueueBuffers(source, unqueued);
} else {
remainingBufferCount--;
if (remainingBufferCount == 0) {
done = true;
}
}
processed--;
}
int state = AL10.alGetSourcei(source, AL10.AL_SOURCE_STATE);
if (state != AL10.AL_PLAYING) {
AL10.alSourcePlay(source);
}
}
示例10: stop
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
public void stop(int source){
for(int i=0;i<buffers.limit();i++)
AL10.alSourceUnqueueBuffers(source);
rewind();
}