|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrit.audio.AbstractAudioFactory
jmri.jmrit.audio.JoalAudioFactory
public class JoalAudioFactory
This is the JOAL audio system specific AudioFactory.
The JOAL sound system supports, where available, full surround-sound with 3D positioning capabilities.
When only stereo capable hardware is available, it will automatically create an approximation of the desired sound-scape.
This factory initialises JOAL, provides new Joal-specific Audio objects and
deals with clean-up operations.
JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
| Field Summary | |
|---|---|
(package private) static int |
AL_FORMAT_51CHN16
Definition of 16-bit 5.1 multi-channel audio format. |
(package private) static int |
AL_FORMAT_51CHN8
Definition of 8-bit 5.1 multi-channel audio format. |
(package private) static int |
AL_FORMAT_61CHN16
Definition of 16-bit 6.1 multi-channel audio format. |
(package private) static int |
AL_FORMAT_61CHN8
Definition of 8-bit 6.1 multi-channel audio format. |
(package private) static int |
AL_FORMAT_71CHN16
Definition of 16-bit 7.1 multi-channel audio format. |
(package private) static int |
AL_FORMAT_71CHN8
Definition of 8-bit 7.1 multi-channel audio format. |
(package private) static int |
AL_FORMAT_QUAD16
Definition of 16-bit quad multi-channel audio format. |
(package private) static int |
AL_FORMAT_QUAD8
Definition of 8-bit quad multi-channel audio format. |
| Constructor Summary | |
|---|---|
JoalAudioFactory()
|
|
| Method Summary | |
|---|---|
static boolean |
checkALCError(ALCdevice alcDevice)
Method to check if any error has occurred in the OpenAL sub-system. |
static boolean |
checkALCError(ALCdevice alcDevice,
String msg)
Method to check if any error has occurred in the OpenAL context sub-system. |
static boolean |
checkALError()
Method to check if any error has occurred in the OpenAL sub-system. |
static boolean |
checkALError(String msg)
Method to check if any error has occurred in the OpenAL sub-system. |
void |
cleanup()
Perform any implementation specific clean-up operations. |
AudioBuffer |
createNewBuffer(String systemName,
String userName)
Provide a specific new AudioBuffer object. |
AudioListener |
createNewListener(String systemName,
String userName)
Provide a specific new AudioListener object. |
AudioSource |
createNewSource(String systemName,
String userName)
Provide a specific new AudioSource object. |
AudioListener |
getActiveAudioListener()
Return the currently active Listener object |
static AL |
getAL()
Return a reference to the active AL object for use by other Joal objects |
boolean |
init()
Initialise this JoalAudioFactory and check for multi-channel support. |
void |
setDistanceAttenuated(boolean attenuated)
Sets if this AudioFactory should attenuate sources based on their distance from the listener Default = true |
String |
toString()
|
| Methods inherited from class jmri.jmrit.audio.AbstractAudioFactory |
|---|
audioCommandQueue, getCommandThread, isDistanceAttenuated |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static int AL_FORMAT_QUAD8
These formats are only supported by certain OpenAL implementations and support is determined at runtime.
Initially set format to unknown.
static int AL_FORMAT_QUAD16
These formats are only supported by certain OpenAL implementations and support is determined at runtime.
Initially set format to unknown.
static int AL_FORMAT_51CHN8
These formats are only supported by certain OpenAL implementations and support is determined at runtime.
Initially set format to unknown.
static int AL_FORMAT_51CHN16
These formats are only supported by certain OpenAL implementations and support is determined at runtime.
Initially set format to unknown.
static int AL_FORMAT_61CHN8
These formats are only supported by certain OpenAL implementations and support is determined at runtime.
Initially set format to unknown.
static int AL_FORMAT_61CHN16
These formats are only supported by certain OpenAL implementations and support is determined at runtime.
Initially set format to unknown.
static int AL_FORMAT_71CHN8
These formats are only supported by certain OpenAL implementations and support is determined at runtime.
Initially set format to unknown.
static int AL_FORMAT_71CHN16
These formats are only supported by certain OpenAL implementations and support is determined at runtime.
Initially set format to unknown.
| Constructor Detail |
|---|
public JoalAudioFactory()
| Method Detail |
|---|
public boolean init()
Initial values for multi-channel formats are set to unknown as OpenAL implementations are only guaranteed to support MONO and STEREO Buffers.
On initialisation, we need to check if this implementation supports multi-channel formats.
This is done by making alGetEnumValue calls to request the value of the Buffer Format Tag Enum (that will be passed to an alBufferData call). Enum Values are retrieved by string names. The following names are defined for multi-channel wave formats ...
init in interface AudioFactoryinit in class AbstractAudioFactorypublic String toString()
toString in class Objectpublic void cleanup()
AudioFactory
cleanup in interface AudioFactorycleanup in class AbstractAudioFactory
public AudioBuffer createNewBuffer(String systemName,
String userName)
AudioFactory
systemName - for this object instanceuserName - for this object instance
public AudioListener createNewListener(String systemName,
String userName)
AudioFactory
systemName - for this object instanceuserName - for this object instance
public AudioListener getActiveAudioListener()
AudioFactory
public AudioSource createNewSource(String systemName,
String userName)
AudioFactory
systemName - for this object instanceuserName - for this object instance
public void setDistanceAttenuated(boolean attenuated)
AudioFactoryDefault = true
setDistanceAttenuated in interface AudioFactorysetDistanceAttenuated in class AbstractAudioFactoryattenuated - true if distance attenuation to be usedpublic static AL getAL()
public static boolean checkALError()
If an error has occurred, log the error as a warning message and return True.
If no error has occurred, return False.
public static boolean checkALError(String msg)
If an error has occurred, log the error as a warning message with the defined message pre-pended and return True.
If no error has occurred, return False.
msg - additional message prepended to the log
public static boolean checkALCError(ALCdevice alcDevice)
If an error has occurred, log the error as a warning message and return True.
If no error has occurred, return False.
alcDevice - OpenAL context device to check
public static boolean checkALCError(ALCdevice alcDevice,
String msg)
If an error has occurred, log the error as a warning message with the defined message pre-pended and return True.
If no error has occurred, return False.
alcDevice - OpenAL context device to checkmsg - additional message prepended to the log
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||