public void alSourcei(int source, int param, int value) { joalAl.alSourcei(source, param, value); }
/** * turns looping on or off. * * @param isLooping true-looping is on, false-looping is off */ public void setLooping(final boolean isLooping) { final int loop = isLooping ? 1 : 0; al.alSourcei(sourceID, ALConstants.AL_LOOPING, loop); }
/** * Determines if the position of the source is relative to the listener. * The default is false. * @param isRelative true if the position of the source is relative * to the listener, false if the position of the source is relative to the * world. */ public void setSourceRelative(final boolean isRelative) { final int rel = isRelative ? 1 : 0; al.alSourcei(sourceID, ALConstants.AL_SOURCE_RELATIVE, rel); }
/** * Sets the buffer associated with this source. * * @param buffer the buffer associated with this source */ public void setBuffer(final Buffer buffer) { al.alSourcei(sourceID, ALConstants.AL_BUFFER, buffer.bufferID); this.buffer = buffer; }
public void alSourcei(int source, int param, int value) { joalAl.alSourcei(source, param, value); }
private final void dequeueForceAll() { if(DEBUG_TRACE) { System.err.println("< _FLUSH_ <- "+shortString()+" @ "+getThreadName()); } final int[] val=new int[1]; al.alSourcei(alSource[0], ALConstants.AL_BUFFER, 0); // explicit force zero buffer! if(DEBUG_TRACE) { al.alGetSourcei(alSource[0], ALConstants.AL_BUFFERS_PROCESSED, val, 0); } final int alErr = al.alGetError(); while ( !alFramesPlaying.isEmpty() ) { final ALAudioFrame releasedBuffer = alFramesPlaying.get(); if( null == releasedBuffer ) { throw new InternalError("Internal Error: "+this); } alBufferBytesQueued -= releasedBuffer.getByteSize(); if( !alFramesAvail.put(releasedBuffer) ) { throw new InternalError("Internal Error: "+this); } } alBufferBytesQueued = 0; if(DEBUG_TRACE) { System.err.println("<< _FLUSH_ [al "+val[0]+", err "+toHexString(alErr)+"] <- "+shortString()+" @ "+getThreadName()); Thread.dumpStack(); } }
private final void dequeueForceAll() { if(DEBUG_TRACE) { System.err.println("< _FLUSH_ <- "+shortString()+" @ "+getThreadName()); } final int[] val=new int[1]; al.alSourcei(alSource[0], ALConstants.AL_BUFFER, 0); // explicit force zero buffer! if(DEBUG_TRACE) { al.alGetSourcei(alSource[0], ALConstants.AL_BUFFERS_PROCESSED, val, 0); } final int alErr = al.alGetError(); while ( !alFramesPlaying.isEmpty() ) { final ALAudioFrame releasedBuffer = alFramesPlaying.get(); if( null == releasedBuffer ) { throw new InternalError("Internal Error: "+this); } alBufferBytesQueued -= releasedBuffer.getByteSize(); if( !alFramesAvail.put(releasedBuffer) ) { throw new InternalError("Internal Error: "+this); } } alBufferBytesQueued = 0; if(DEBUG_TRACE) { System.err.println("<< _FLUSH_ [al "+val[0]+", err "+toHexString(alErr)+"] <- "+shortString()+" @ "+getThreadName()); ExceptionUtils.dumpStack(System.err); } }