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.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
Lwjgl2AlBinding | inst() factory | Returns the only instance. |
Methods
Section titled “Methods”Queries
Section titled “Queries”| Returns | Signature | Summary |
|---|---|---|
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. |
Actions
Section titled “Actions”| Returns | Signature | Summary |
|---|---|---|
void | createContext() | Creates the OpenAL context of LWJGL 2 with AL.create(). |
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. |
Creation details
Section titled “Creation details”Lwjgl2AlBinding inst() factory
Returns the only instance.
Method details
Section titled “Method details”getCurrentContext
Section titled “getCurrentContext”Object getCurrentContext()
Returns the current context of OpenAL, or null while LWJGL 2 has no OpenAL context.
isPlaying
Section titled “isPlaying”boolean isPlaying(int source)
Calls alGetSourcei with AL_SOURCE_STATE.
getQueuedBuffers
Section titled “getQueuedBuffers”int getQueuedBuffers(int source)
Calls alGetSourcei with AL_BUFFERS_QUEUED.
getProcessedBuffers
Section titled “getProcessedBuffers”int getProcessedBuffers(int source)
Calls alGetSourcei with AL_BUFFERS_PROCESSED.
createContext
Section titled “createContext”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.
genSource
Section titled “genSource”int genSource()
Calls alGenSources, then places the source at the listener with AL_SOURCE_RELATIVE and a position of zero.
deleteSource
Section titled “deleteSource”void deleteSource(int source)
Calls alDeleteSources.
genBuffer
Section titled “genBuffer”int genBuffer()
Calls alGenBuffers.
deleteBuffer
Section titled “deleteBuffer”void deleteBuffer(int buffer)
Calls alDeleteBuffers.
bufferData
Section titled “bufferData”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.
queueBuffer
Section titled “queueBuffer”void queueBuffer(int source, int buffer)
Calls alSourceQueueBuffers.
unqueueBuffer
Section titled “unqueueBuffer”int unqueueBuffer(int source)
Calls alSourceUnqueueBuffers.
destroyContext
Section titled “destroyContext”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
