Skip to content

Lwjgl2AlBinding

final class Lwjgl2AlBinding
Implements: IAlBinding
Package: dev.joid.base.lwjgl2.openal · Module: base-lwjgl2 · Source: Lwjgl2AlBinding.java
Backends: LWJGL 2

The OpenAL binding of LWJGL 2, given to AlAudioBridge by the LWJGL 2 backend and by a host that runs on LWJGL 2.

ReturnsSignatureSummary
Lwjgl2AlBindinginst() factoryReturns the only instance.

ReturnsSignatureSummary
ObjectgetCurrentContext()Returns the current context of OpenAL, or null while LWJGL 2 has no OpenAL context.
booleanisPlaying(int source)Calls alGetSourcei with AL_SOURCE_STATE.
intgetQueuedBuffers(int source)Calls alGetSourcei with AL_BUFFERS_QUEUED.
intgetProcessedBuffers(int source)Calls alGetSourcei with AL_BUFFERS_PROCESSED.
ReturnsSignatureSummary
voidcreateContext()Creates the OpenAL context of LWJGL 2 with AL.create().
intgenSource()Calls alGenSources, then places the source at the listener with AL_SOURCE_RELATIVE and a position of zero.
voiddeleteSource(int source)Calls alDeleteSources.
intgenBuffer()Calls alGenBuffers.
voiddeleteBuffer(int buffer)Calls alDeleteBuffers.
voidbufferData(int buffer, int channels, short[] samples, int sampleRate)Calls alBufferData through a direct buffer that it reuses, with AL_FORMAT_MONO16 or AL_FORMAT_STEREO16.
voidplay(int source)Calls alSourcePlay.
voidstop(int source)Calls alSourceStop.
voidpause(int source)Calls alSourcePause.
voidgain(int source, float gain)Calls alSourcef with AL_GAIN.
voidqueueBuffer(int source, int buffer)Calls alSourceQueueBuffers.
intunqueueBuffer(int source)Calls alSourceUnqueueBuffers.
voiddestroyContext()Destroys the OpenAL context of LWJGL 2 when it exists.

Lwjgl2AlBinding inst() factory

Returns the only instance.

Object getCurrentContext()

Returns the current context of OpenAL, or null while LWJGL 2 has no OpenAL context.

boolean isPlaying(int source)

Calls alGetSourcei with AL_SOURCE_STATE.

int getQueuedBuffers(int source)

Calls alGetSourcei with AL_BUFFERS_QUEUED.

int getProcessedBuffers(int source)

Calls alGetSourcei with AL_BUFFERS_PROCESSED.

void createContext()

Throws:

  • IllegalStateException: LWJGL 2 cannot create the OpenAL context (…), check that an audio output device is connected and enabled

Creates the OpenAL context of LWJGL 2 with AL.create(). Throws an IllegalStateException with the reason of LWJGL when no output device can be opened.

int genSource()

Calls alGenSources, then places the source at the listener with AL_SOURCE_RELATIVE and a position of zero.

void deleteSource(int source)

Calls alDeleteSources.

int genBuffer()

Calls alGenBuffers.

void deleteBuffer(int buffer)

Calls alDeleteBuffers.

void bufferData(int buffer, int channels, short[] samples, int sampleRate)

Calls alBufferData through a direct buffer that it reuses, with AL_FORMAT_MONO16 or AL_FORMAT_STEREO16.

void play(int source)

Calls alSourcePlay.

void stop(int source)

Calls alSourceStop.

void pause(int source)

Calls alSourcePause.

void gain(int source, float gain)

Calls alSourcef with AL_GAIN.

void queueBuffer(int source, int buffer)

Calls alSourceQueueBuffers.

int unqueueBuffer(int source)

Calls alSourceUnqueueBuffers.

void destroyContext()

Destroys the OpenAL context of LWJGL 2 when it exists.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page