Package org.lwjgl.openal
Class ALC10
- java.lang.Object
-
- org.lwjgl.openal.ALC10
-
public final class ALC10 extends Object
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).
- Version:
- $Revision: 2286 $ $Id: ALC.java 2286 2006-03-23 19:32:21 +0000 (to, 23 mar 2006) matzon $
- Author:
- Brian Matzon
-
-
Field Summary
Fields Modifier and Type Field Description static intALC_ALL_ATTRIBUTESExpects a destination of ALC_CURRENT_ATTRIBUTES_SIZE, and provides the attribute list for the current context of the specified device.static intALC_ATTRIBUTES_SIZEThe size required for the zero-terminated attributes list, for the current context.static intALC_DEFAULT_DEVICE_SPECIFIERThe specifier string for the default devicestatic intALC_DEVICE_SPECIFIERThe specifier string for the devicestatic intALC_EXTENSIONSThe extensions string for diagnostics and printingstatic intALC_FALSEBoolean Falsestatic intALC_FREQUENCYFrequency for mixing output buffer, in units of Hz.static intALC_INVALIDBad valuestatic intALC_INVALID_CONTEXTThe context argument does not name a valid contextstatic intALC_INVALID_DEVICEThe device argument does not name a valid devicestatic intALC_INVALID_ENUMA function was called at inappropriate time, or in an inappropriate way, causing an illegal state.static intALC_INVALID_VALUEIllegal value passed as an argument to an AL call.static intALC_MAJOR_VERSIONMajor version query.static intALC_MINOR_VERSIONMinor version query.static intALC_NO_ERRORErrors: No Errorstatic intALC_OUT_OF_MEMORYA function could not be completed, because there is not enough memory available.static intALC_REFRESHRefresh intervalls, in units of Hz.static intALC_SYNCFlag, indicating a synchronous context.static intALC_TRUEBoolean True
-
Constructor Summary
Constructors Constructor Description ALC10()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanalcCloseDevice(ALCdevice device)ThealcCloseDevicefunction allows the application (i.e.static ALCcontextalcCreateContext(ALCdevice device, IntBuffer attrList)A context is created usingalcCreateContext.static voidalcDestroyContext(ALCcontext context)The correct way to destroy a context is to first release it usingalcMakeCurrentandnull.static ALCdevicealcGetContextsDevice(ALCcontext context)The application can query for, and obtain an handle to, the device of a given context.static ALCcontextalcGetCurrentContext()The application can query for, and obtain an handle to, the current context for the application.static intalcGetEnumValue(ALCdevice device, String enumName)Enumeration/token values are device independend, but tokens defined for extensions might not be present for a given device.static intalcGetError(ALCdevice device)ALC uses the same conventions and mechanisms as AL for error handling.static voidalcGetInteger(ALCdevice device, int pname, IntBuffer integerdata)The application can query ALC for information using an integer query function.static StringalcGetString(ALCdevice device, int pname)The application can obtain certain strings from ALC.static booleanalcIsExtensionPresent(ALCdevice device, String extName)Verify that a given extension is available for the current context and the device it is associated with.static intalcMakeContextCurrent(ALCcontext context)To make a Context current with respect to AL Operation (state changes by issueing commands),alcMakeContextCurrentis used.static ALCdevicealcOpenDevice(String devicename)ThealcOpenDevicefunction allows the application (i.e.static voidalcProcessContext(ALCcontext context)The current context is the only context accessible to state changes by AL commands (aside from state changes affecting shared objects).static voidalcSuspendContext(ALCcontext context)The application can suspend any context from processing (including the current one).
-
-
-
Field Detail
-
ALC_INVALID
public static final int ALC_INVALID
Bad value- See Also:
- Constant Field Values
-
ALC_FALSE
public static final int ALC_FALSE
Boolean False- See Also:
- Constant Field Values
-
ALC_TRUE
public static final int ALC_TRUE
Boolean True- See Also:
- Constant Field Values
-
ALC_NO_ERROR
public static final int ALC_NO_ERROR
Errors: No Error- See Also:
- Constant Field Values
-
ALC_MAJOR_VERSION
public static final int ALC_MAJOR_VERSION
Major version query.- See Also:
- Constant Field Values
-
ALC_MINOR_VERSION
public static final int ALC_MINOR_VERSION
Minor version query.- See Also:
- Constant Field Values
-
ALC_ATTRIBUTES_SIZE
public static final int ALC_ATTRIBUTES_SIZE
The size required for the zero-terminated attributes list, for the current context.- See Also:
- Constant Field Values
-
ALC_ALL_ATTRIBUTES
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.- See Also:
- Constant Field Values
-
ALC_DEFAULT_DEVICE_SPECIFIER
public static final int ALC_DEFAULT_DEVICE_SPECIFIER
The specifier string for the default device- See Also:
- Constant Field Values
-
ALC_DEVICE_SPECIFIER
public static final int ALC_DEVICE_SPECIFIER
The specifier string for the device- See Also:
- Constant Field Values
-
ALC_EXTENSIONS
public static final int ALC_EXTENSIONS
The extensions string for diagnostics and printing- See Also:
- Constant Field Values
-
ALC_FREQUENCY
public static final int ALC_FREQUENCY
Frequency for mixing output buffer, in units of Hz.- See Also:
- Constant Field Values
-
ALC_REFRESH
public static final int ALC_REFRESH
Refresh intervalls, in units of Hz.- See Also:
- Constant Field Values
-
ALC_SYNC
public static final int ALC_SYNC
Flag, indicating a synchronous context.- See Also:
- Constant Field Values
-
ALC_INVALID_DEVICE
public static final int ALC_INVALID_DEVICE
The device argument does not name a valid device- See Also:
- Constant Field Values
-
ALC_INVALID_CONTEXT
public static final int ALC_INVALID_CONTEXT
The context argument does not name a valid context- See Also:
- Constant Field Values
-
ALC_INVALID_ENUM
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.- See Also:
- Constant Field Values
-
ALC_INVALID_VALUE
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.- See Also:
- Constant Field Values
-
ALC_OUT_OF_MEMORY
public static final int ALC_OUT_OF_MEMORY
A function could not be completed, because there is not enough memory available.- See Also:
- Constant Field Values
-
-
Method Detail
-
alcGetString
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 deviceALC_DEVICE_SPECIFIER- The specifer string for the deviceALC_EXTENSIONS- The extensions string for diagnostics and printing. In addition, printable error message strings are provided for all valid error tokens, includingALC_NO_ERROR,ALC_INVALID_DEVICE,ALC_INVALID_CONTEXT,ALC_INVALID_ENUM,ALC_INVALID_VALUE.- Parameters:
pname- Property to get- Returns:
- String property from device
-
alcGetInteger
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,nullis a legal deviceHandle. In other cases, specifying anulldevice will generate anALC_INVALID_DEVICEerror. The application has to specify the size of the destination buffer provided. Anulldestination 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.nullis an invalid device.null(no current context for the specified device) is legal.ALC_ALL_ATTRIBUTES- Expects a destination ofALC_CURRENT_ATTRIBUTES_SIZE, and provides the attribute list for the current context of the specified device.nullis an invalid device.null(no current context for the specified device) will return the default attributes defined by the specified device.- Parameters:
pname- Property to getintegerdata- ByteBuffer to write integers to
-
alcOpenDevice
public static ALCdevice alcOpenDevice(String devicename)
ThealcOpenDevicefunction allows the application (i.e. the client program) to connect to a device (i.e. the server). If the function returnsnull, then no sound driver/device has been found. The argument is a null terminated string that requests a certain device or device configuration. Ifnullis specified, the implementation will provide an implementation specific default.- Parameters:
devicename- name of device to open- Returns:
- opened device, or null
-
alcCloseDevice
public static boolean alcCloseDevice(ALCdevice device)
ThealcCloseDevicefunction allows the application (i.e. the client program) to disconnect from a device (i.e. the server). If deviceHandle isnullor invalid, anALC_INVALID_DEVICEerror will be generated. Once closed, a deviceHandle is invalid.- Parameters:
device- address of native device to close
-
alcCreateContext
public static ALCcontext alcCreateContext(ALCdevice device, IntBuffer attrList)
A context is created usingalcCreateContext. The device parameter has to be a valid device. The attribute list can benull, 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- address of device to associate context toattrList- Buffer to read attributes from- Returns:
- New context, or null if creation failed
-
alcMakeContextCurrent
public static int alcMakeContextCurrent(ALCcontext context)
To make a Context current with respect to AL Operation (state changes by issueing commands),alcMakeContextCurrentis used. The context parameter can benullor 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- address of context to make current- Returns:
- true if successfull, false if not
-
alcProcessContext
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 usealcProcessContext. Repeated calls toalcProcessContextare 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.
-
alcGetCurrentContext
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,nullis returned.- Returns:
- Current ALCcontext
-
alcGetContextsDevice
public static ALCdevice alcGetContextsDevice(ALCcontext context)
The application can query for, and obtain an handle to, the device of a given context.- Parameters:
context- address of context to get device for
-
alcSuspendContext
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 usealcSuspendContext. Repeated calls toalcSuspendContextare legal, and do not affect a context that is already marked as suspended. The default state of a context created byalcCreateContextis that it is marked as suspended.- Parameters:
context- address of context to suspend
-
alcDestroyContext
public static void alcDestroyContext(ALCcontext context)
The correct way to destroy a context is to first release it usingalcMakeCurrentandnull. Applications should not attempt to destroy a current context.- Parameters:
context- address of context to Destroy
-
alcGetError
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). ThealcGetErrorfunction 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:
- Errorcode from ALC statemachine
-
alcIsExtensionPresent
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. Anullname argument returnsALC_FALSE, as do invalid and unsupported string tokens.- Parameters:
extName- name of extension to find- Returns:
- true if extension is available, false if not
-
alcGetEnumValue
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 anullname parameter will cause anALC_INVALID_VALUEerror.- Parameters:
enumName- name of enum to find- Returns:
- value of enumeration
-
-