Top Description Fields Constructors Methods
org.lwjgl.openal

public final Class ALC10

extends Object
Class Inheritance
Imports
java.nio.ByteBuffer, .IntBuffer, java.util.HashMap, org.lwjgl.BufferChecks, .LWJGLException, .MemoryUtil

ALC introduces the notion of a Device. A Device can be, depending on the implementation, a hardware device, or a daemon/OS service/actual server. This mechanism also permits different drivers (and hardware) to coexist within the same system, as well as allowing several applications to share system resources for audio, including a single hardware output device. The details are left to the implementation, which has to map the available backends to unique device specifiers (represented as strings).

Author
Brian Matzon
Version
$Revision: 2286 $ $Id: ALC.java 2286 2006-03-23 19:32:21 +0000 (to, 23 mar 2006) matzon $

Field Summary

Modifier and TypeField and Description
public static final int
ALC_ALL_ATTRIBUTES

Expects a destination of ALC_CURRENT_ATTRIBUTES_SIZE, and provides the attribute list for the current context of the specified device.

public static final int
ALC_ATTRIBUTES_SIZE

The size required for the zero-terminated attributes list, for the current context.

public static final int
ALC_DEFAULT_DEVICE_SPECIFIER

The specifier string for the default device

public static final int
ALC_DEVICE_SPECIFIER

The specifier string for the device

public static final int
ALC_EXTENSIONS

The extensions string for diagnostics and printing

public static final int
ALC_FALSE

Boolean False

public static final int
ALC_FREQUENCY

Frequency for mixing output buffer, in units of Hz.

public static final int
ALC_INVALID

Bad value

public static final int
ALC_INVALID_CONTEXT

The context argument does not name a valid context

public static final int
ALC_INVALID_DEVICE

The device argument does not name a valid device

public static final int
ALC_INVALID_ENUM

A function was called at inappropriate time, or in an inappropriate way, causing an illegal state.

public static final int
ALC_INVALID_VALUE

Illegal value passed as an argument to an AL call.

public static final int
ALC_MAJOR_VERSION

Major version query.

public static final int
ALC_MINOR_VERSION

Minor version query.

public static final int
ALC_NO_ERROR

Errors: No Error

public static final int
ALC_OUT_OF_MEMORY

A function could not be completed, because there is not enough memory available.

public static final int
ALC_REFRESH

Refresh intervalls, in units of Hz.

public static final int
ALC_SYNC

Flag, indicating a synchronous context.

public static final int
ALC_TRUE

Boolean True

pack-priv static final HashMap<Long, ALCcontext>
contexts

List of active contexts

pack-priv static final HashMap<Long, ALCdevice>
devices

List of active devices

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static boolean
alcCloseDevice(ALCdevice
address of native device to close
device
)

The alcCloseDevice function allows the application (i.e. the client program) to disconnect from a device (i.e. the server).

public static ALCcontext

Returns:

New context, or null if creation failed
alcCreateContext
(ALCdevice
address of device to associate context to
device
,
IntBuffer
Buffer to read attributes from
attrList
)

A context is created using alcCreateContext.

public static void
alcDestroyContext(ALCcontext
address of context to Destroy
context
)

The correct way to destroy a context is to first release it using alcMakeCurrent and null.

public static ALCdevice
alcGetContextsDevice(ALCcontext
address of context to get device for
context
)

The application can query for, and obtain an handle to, the device of a given context.

public static ALCcontext

Returns:

Current ALCcontext
alcGetCurrentContext
()

The application can query for, and obtain an handle to, the current context for the application.

public static int

Returns:

value of enumeration
alcGetEnumValue
(ALCdevice device, String
name of enum to find
enumName
)

Enumeration/token values are device independend, but tokens defined for extensions might not be present for a given device.

public static int

Returns:

Errorcode from ALC statemachine
alcGetError
(ALCdevice device)

ALC uses the same conventions and mechanisms as AL for error handling.

public static void
alcGetInteger(ALCdevice device, int
Property to get
pname
,
IntBuffer
ByteBuffer to write integers to
integerdata
)

The application can query ALC for information using an integer query function.

public static String

Returns:

String property from device
alcGetString
(ALCdevice device, int
Property to get
pname
)

The application can obtain certain strings from ALC.

public static boolean

Returns:

true if extension is available, false if not
alcIsExtensionPresent
(ALCdevice device, String
name of extension to find
extName
)

Verify that a given extension is available for the current context and the device it is associated with.

public static int

Returns:

true if successfull, false if not
alcMakeContextCurrent
(ALCcontext
address of context to make current
context
)

To make a Context current with respect to AL Operation (state changes by issueing commands), alcMakeContextCurrent is used.

public static ALCdevice

Returns:

opened device, or null
alcOpenDevice
(String
name of device to open
devicename
)

The alcOpenDevice function allows the application (i.e. the client program) to connect to a device (i.e. the server).

public static void
alcProcessContext(ALCcontext context)

The current context is the only context accessible to state changes by AL commands (aside from state changes affecting shared objects).

public static void
alcSuspendContext(ALCcontext
address of context to suspend
context
)

The application can suspend any context from processing (including the current one).

pack-priv static long
pack-priv static long
pack-priv static native void
pack-priv static native boolean
nalcCloseDevice(long device)

pack-priv static native long
nalcCreateContext(long device, long attrList)

pack-priv static native void
nalcDestroyContext(long context)

pack-priv static native long
nalcGetContextsDevice(long context)

pack-priv static native long
private static native int
nalcGetEnumValue(long device, long enumName)

pack-priv static native int
nalcGetError(long device)

pack-priv static native void
nalcGetIntegerv(long device, int pname, int size, long integerdata)

pack-priv static native ByteBuffer
nalcGetString(long device, int pname)

private static native boolean
nalcIsExtensionPresent(long device, long extName)

pack-priv static native int
nalcMakeContextCurrent(long context)

pack-priv static native long
nalcOpenDevice(long devicename)

pack-priv static native void
nalcProcessContext(long context)

pack-priv static native void
nalcSuspendContext(long context)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALC_ALL_ATTRIBUTESback to summary
public static final int ALC_ALL_ATTRIBUTES

Expects a destination of ALC_CURRENT_ATTRIBUTES_SIZE, and provides the attribute list for the current context of the specified device.

ALC_ATTRIBUTES_SIZEback to summary
public static final int ALC_ATTRIBUTES_SIZE

The size required for the zero-terminated attributes list, for the current context.

ALC_DEFAULT_DEVICE_SPECIFIERback to summary
public static final int ALC_DEFAULT_DEVICE_SPECIFIER

The specifier string for the default device

ALC_DEVICE_SPECIFIERback to summary
public static final int ALC_DEVICE_SPECIFIER

The specifier string for the device

ALC_EXTENSIONSback to summary
public static final int ALC_EXTENSIONS

The extensions string for diagnostics and printing

ALC_FALSEback to summary
public static final int ALC_FALSE

Boolean False

ALC_FREQUENCYback to summary
public static final int ALC_FREQUENCY

Frequency for mixing output buffer, in units of Hz.

ALC_INVALIDback to summary
public static final int ALC_INVALID

Bad value

ALC_INVALID_CONTEXTback to summary
public static final int ALC_INVALID_CONTEXT

The context argument does not name a valid context

ALC_INVALID_DEVICEback to summary
public static final int ALC_INVALID_DEVICE

The device argument does not name a valid device

ALC_INVALID_ENUMback to summary
public static final int ALC_INVALID_ENUM

A function was called at inappropriate time, or in an inappropriate way, causing an illegal state. This can be an incompatible ALenum, object ID, and/or function.

ALC_INVALID_VALUEback to summary
public static final int ALC_INVALID_VALUE

Illegal value passed as an argument to an AL call. Applies to parameter values, but not to enumerations.

ALC_MAJOR_VERSIONback to summary
public static final int ALC_MAJOR_VERSION

Major version query.

ALC_MINOR_VERSIONback to summary
public static final int ALC_MINOR_VERSION

Minor version query.

ALC_NO_ERRORback to summary
public static final int ALC_NO_ERROR

Errors: No Error

ALC_OUT_OF_MEMORYback to summary
public static final int ALC_OUT_OF_MEMORY

A function could not be completed, because there is not enough memory available.

ALC_REFRESHback to summary
public static final int ALC_REFRESH

Refresh intervalls, in units of Hz.

ALC_SYNCback to summary
public static final int ALC_SYNC

Flag, indicating a synchronous context.

ALC_TRUEback to summary
public static final int ALC_TRUE

Boolean True

contextsback to summary
pack-priv static final HashMap<Long, ALCcontext> contexts

List of active contexts

devicesback to summary
pack-priv static final HashMap<Long, ALCdevice> devices

List of active devices

Constructor Detail

ALC10back to summary
public ALC10()

Method Detail

alcCloseDeviceback to summary
public static boolean alcCloseDevice(ALCdevice device)

The alcCloseDevice function allows the application (i.e. the client program) to disconnect from a device (i.e. the server). If deviceHandle is null or invalid, an ALC_INVALID_DEVICE error will be generated. Once closed, a deviceHandle is invalid.

Parameters
device:ALCdevice

address of native device to close

alcCreateContextback to summary
public static ALCcontext alcCreateContext(ALCdevice device, IntBuffer attrList)

A context is created using alcCreateContext. The device parameter has to be a valid device. The attribute list can be null, or a zero terminated list of integer pairs composed of valid ALC attribute tokens and requested values. Context creation will fail if the application requests attributes that, by themselves, can not be provided. Context creation will fail if the combination of specified attributes can not be provided. Context creation will fail if a specified attribute, or the combination of attributes, does not match the default values for unspecified attributes.

Parameters
device:ALCdevice

address of device to associate context to

attrList:IntBuffer

Buffer to read attributes from

Returns:ALCcontext

New context, or null if creation failed

alcDestroyContextback to summary
public static void alcDestroyContext(ALCcontext context)

The correct way to destroy a context is to first release it using alcMakeCurrent and null. Applications should not attempt to destroy a current context.

Parameters
context:ALCcontext

address of context to Destroy

alcGetContextsDeviceback to summary
public static ALCdevice alcGetContextsDevice(ALCcontext context)

The application can query for, and obtain an handle to, the device of a given context.

Parameters
context:ALCcontext

address of context to get device for

alcGetCurrentContextback to summary
public static ALCcontext alcGetCurrentContext()

The application can query for, and obtain an handle to, the current context for the application. If there is no current context, null is returned.

Returns:ALCcontext

Current ALCcontext

alcGetEnumValueback to summary
public static int alcGetEnumValue(ALCdevice device, String enumName)

Enumeration/token values are device independend, but tokens defined for extensions might not be present for a given device. But only the tokens defined by the AL core are guaranteed. Availability of extension tokens dependends on the ALC extension. Specifying a null name parameter will cause an ALC_INVALID_VALUE error.

Parameters
enumName:String

name of enum to find

Returns:int

value of enumeration

alcGetErrorback to summary
public static int alcGetError(ALCdevice device)

ALC uses the same conventions and mechanisms as AL for error handling. In particular, ALC does not use conventions derived from X11 (GLX) or Windows (WGL). The alcGetError function can be used to query ALC errors. Error conditions are specific to the device. ALC_NO_ERROR - The device handle or specifier does name an accessible driver/server. ALC_INVALID_DEVICE - The Context argument does not name a valid context. ALC_INVALID_CONTEXT - The Context argument does not name a valid context. ALC_INVALID_ENUM - A token used is not valid, or not applicable. ALC_INVALID_VALUE - An value (e.g. attribute) is not valid, or not applicable.

Returns:int

Errorcode from ALC statemachine

alcGetIntegerback to summary
public static void alcGetInteger(ALCdevice device, int pname, IntBuffer integerdata)

The application can query ALC for information using an integer query function. For some tokens, null is a legal deviceHandle. In other cases, specifying a null device will generate an ALC_INVALID_DEVICE error. The application has to specify the size of the destination buffer provided. A null destination or a zero size parameter will cause ALC to ignore the query. ALC_MAJOR_VERSION - Major version query. ALC_MINOR_VERSION - Minor version query. ALC_ATTRIBUTES_SIZE - The size required for the zero-terminated attributes list, for the current context. null is an invalid device. null (no current context for the specified device) is legal. ALC_ALL_ATTRIBUTES - Expects a destination of ALC_CURRENT_ATTRIBUTES_SIZE, and provides the attribute list for the current context of the specified device. null is an invalid device. null (no current context for the specified device) will return the default attributes defined by the specified device.

Parameters
pname:int

Property to get

integerdata:IntBuffer

ByteBuffer to write integers to

alcGetStringback to summary
public static String alcGetString(ALCdevice device, int pname)

The application can obtain certain strings from ALC. ALC_DEFAULT_DEVICE_SPECIFIER - The specifer string for the default device ALC_DEVICE_SPECIFIER - The specifer string for the device ALC_EXTENSIONS - The extensions string for diagnostics and printing. In addition, printable error message strings are provided for all valid error tokens, including ALC_NO_ERROR,ALC_INVALID_DEVICE, ALC_INVALID_CONTEXT, ALC_INVALID_ENUM, ALC_INVALID_VALUE.

Parameters
pname:int

Property to get

Returns:String

String property from device

alcIsExtensionPresentback to summary
public static boolean alcIsExtensionPresent(ALCdevice device, String extName)

Verify that a given extension is available for the current context and the device it is associated with. A null name argument returns ALC_FALSE, as do invalid and unsupported string tokens.

Parameters
extName:String

name of extension to find

Returns:boolean

true if extension is available, false if not

alcMakeContextCurrentback to summary
public static int alcMakeContextCurrent(ALCcontext context)

To make a Context current with respect to AL Operation (state changes by issueing commands), alcMakeContextCurrent is used. The context parameter can be null or a valid context pointer. The operation will apply to the device that the context was created for. For each OS process (usually this means for each application), only one context can be current at any given time. All AL commands apply to the current context. Commands that affect objects shared among contexts (e.g. buffers) have side effects on other contexts.

Parameters
context:ALCcontext

address of context to make current

Returns:int

true if successfull, false if not

alcOpenDeviceback to summary
public static ALCdevice alcOpenDevice(String devicename)

The alcOpenDevice function allows the application (i.e. the client program) to connect to a device (i.e. the server). If the function returns null, then no sound driver/device has been found. The argument is a null terminated string that requests a certain device or device configuration. If null is specified, the implementation will provide an implementation specific default.

Parameters
devicename:String

name of device to open

Returns:ALCdevice

opened device, or null

alcProcessContextback to summary
public static void alcProcessContext(ALCcontext context)

The current context is the only context accessible to state changes by AL commands (aside from state changes affecting shared objects). However, multiple contexts can be processed at the same time. To indicate that a context should be processed (i.e. that internal execution state like offset increments are supposed to be performed), the application has to use alcProcessContext. Repeated calls to alcProcessContext are legal, and do not affect a context that is already marked as processing. The default state of a context created by alcCreateContext is that it is not marked as processing.

alcSuspendContextback to summary
public static void alcSuspendContext(ALCcontext context)

The application can suspend any context from processing (including the current one). To indicate that a context should be suspended from processing (i.e. that internal execution state like offset increments is not supposed to be changed), the application has to use alcSuspendContext. Repeated calls to alcSuspendContext are legal, and do not affect a context that is already marked as suspended. The default state of a context created by alcCreateContext is that it is marked as suspended.

Parameters
context:ALCcontext

address of context to suspend

getContextback to summary
pack-priv static long getContext(ALCcontext context)
getDeviceback to summary
pack-priv static long getDevice(ALCdevice device)
initNativeStubsback to summary
pack-priv static native void initNativeStubs() throws LWJGLException
nalcCloseDeviceback to summary
pack-priv static native boolean nalcCloseDevice(long device)
nalcCreateContextback to summary
pack-priv static native long nalcCreateContext(long device, long attrList)
nalcDestroyContextback to summary
pack-priv static native void nalcDestroyContext(long context)
nalcGetContextsDeviceback to summary
pack-priv static native long nalcGetContextsDevice(long context)
nalcGetCurrentContextback to summary
pack-priv static native long nalcGetCurrentContext()
nalcGetEnumValueback to summary
private static native int nalcGetEnumValue(long device, long enumName)
nalcGetErrorback to summary
pack-priv static native int nalcGetError(long device)
nalcGetIntegervback to summary
pack-priv static native void nalcGetIntegerv(long device, int pname, int size, long integerdata)
nalcGetStringback to summary
pack-priv static native ByteBuffer nalcGetString(long device, int pname)
nalcIsExtensionPresentback to summary
private static native boolean nalcIsExtensionPresent(long device, long extName)
nalcMakeContextCurrentback to summary
pack-priv static native int nalcMakeContextCurrent(long context)
nalcOpenDeviceback to summary
pack-priv static native long nalcOpenDevice(long devicename)
nalcProcessContextback to summary
pack-priv static native void nalcProcessContext(long context)
nalcSuspendContextback to summary
pack-priv static native void nalcSuspendContext(long context)