Interface AudioListener
- 
- All Superinterfaces:
- Audio,- java.lang.Comparable<NamedBean>,- NamedBean,- PropertyChangeProvider
 - All Known Implementing Classes:
- AbstractAudioListener,- JavaSoundAudioListener,- JoalAudioListener,- NullAudioListener
 
 public interface AudioListener extends Audio Represent an AudioListener, a place to store or control sound information.The AbstractAudio class contains a basic implementation of the state and messaging code, and forms a useful start for a system-specific implementation. Specific implementations in the jmrix package, e.g. for LocoNet and NCE, will convert to and from the layout commands. The states and names are Java Bean parameters, so that listeners can be registered to be notified of any changes. Each AudioListener object has a two names. The "user" name is entirely free form, and can be used for any purpose. The "system" name is provided by the system-specific implementations, and provides a unique mapping to the layout control system (for example LocoNet or NCE) and address within that system. 
 
 This file is part of JMRI.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. 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface jmri.NamedBeanNamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
 
- 
 - 
Field Summary- 
Fields inherited from interface jmri.AudioAT, BUFFER, CMD_BIND_BUFFER, CMD_FADE_IN, CMD_FADE_OUT, CMD_INIT_FACTORY, CMD_LOAD_SOUND, CMD_PAUSE, CMD_PAUSE_TOGGLE, CMD_PLAY, CMD_PLAY_TOGGLE, CMD_QUEUE_BUFFERS, CMD_RESET_POSITION, CMD_RESUME, CMD_REWIND, CMD_STOP, CMD_UNQUEUE_BUFFERS, DECIMAL_PLACES, FADE_IN, FADE_NONE, FADE_OUT, LISTENER, MAX_DISTANCE, SOURCE, STATE_EMPTY, STATE_INITIAL, STATE_LOADED, STATE_MOVING, STATE_PLAYING, STATE_POSITIONED, STATE_STOPPED, UP
 - 
Fields inherited from interface jmri.NamedBeanDISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWN
 
- 
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description javax.vecmath.Vector3fgetCurrentOrientation(int which)Return the current orientation of this AudioListener objectjavax.vecmath.Vector3fgetCurrentPosition()Returns the current position of this AudioListener object as a 3-dimensional vector.floatgetGain()Return the current gain settingfloatgetMetersPerUnit()Retrieve the current Meters per unit ratio to use for all distance calculations.javax.vecmath.Vector3fgetOrientation(int which)Return the orientation of this AudioListener objectjavax.vecmath.Vector3fgetPosition()Returns the position of this AudioListener object as a 3-dimensional vector.javax.vecmath.Vector3fgetVelocity()Returns the velocity of this AudioListener object Applies only to sub-types: - Listener - SourcevoidresetCurrentPosition()Method to reset the current position of this AudioListener object to the initial position as defined by setPosition.voidsetGain(float gain)Set the gain of this AudioListener objectvoidsetMetersPerUnit(float metersPerUnit)Method to set the Meters per unit ratio for all distance calculations.voidsetOrientation(javax.vecmath.Vector3f at, javax.vecmath.Vector3f up)Set the orientation of this AudioListener objectvoidsetPosition(float x, float y)Sets the position of this AudioListener object in x and y planes with z plane position fixed at zerovoidsetPosition(float x, float y, float z)Sets the position of this AudioListener object in x, y and z planesvoidsetPosition(javax.vecmath.Vector3f pos)Sets the position of this AudioListener objectvoidsetVelocity(javax.vecmath.Vector3f vel)Sets the velocity of this AudioListener object- 
Methods inherited from interface jmri.AudiogetSubType, stateChanged
 - 
Methods inherited from interface jmri.NamedBeanaddPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getBeanType, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getState, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setState, setUserName, toString, updateListenerRef, vetoableChange
 - 
Methods inherited from interface jmri.beans.PropertyChangeProvideraddPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 
- 
 
- 
- 
- 
Method Detail- 
setPositionvoid setPosition(javax.vecmath.Vector3f pos) Sets the position of this AudioListener objectApplies only to sub-types: - Listener
- Source
 - Parameters:
- pos- 3d position vector
 
 - 
setPositionvoid setPosition(float x, float y, float z) Sets the position of this AudioListener object in x, y and z planesApplies only to sub-types: - Listener
- Source
 - Parameters:
- x- x-coordinate
- y- y-coordinate
- z- z-coordinate
 
 - 
setPositionvoid setPosition(float x, float y) Sets the position of this AudioListener object in x and y planes with z plane position fixed at zeroEquivalent to setPosition(x, y, 0.0f) Applies only to sub-types: - Listener
- Source
 - Parameters:
- x- x-coordinate
- y- y-coordinate
 
 - 
getPositionjavax.vecmath.Vector3f getPosition() Returns the position of this AudioListener object as a 3-dimensional vector.Applies only to sub-types: - Listener
- Source
 - Returns:
- 3d position vector
 
 - 
getCurrentPositionjavax.vecmath.Vector3f getCurrentPosition() Returns the current position of this AudioListener object as a 3-dimensional vector.Applies only to sub-types: - Listener
- Source
 - Returns:
- 3d position vector
 
 - 
resetCurrentPositionvoid resetCurrentPosition() Method to reset the current position of this AudioListener object to the initial position as defined by setPosition.Applies only to sub-types: - Listener
- Source
 
 - 
setVelocityvoid setVelocity(javax.vecmath.Vector3f vel) Sets the velocity of this AudioListener objectApplies only to sub-types: - Listener
- Source
 - Parameters:
- vel- 3d velocity vector
 
 - 
getVelocityjavax.vecmath.Vector3f getVelocity() Returns the velocity of this AudioListener object Applies only to sub-types: - Listener - Source- Returns:
- 3d velocity vector
 
 - 
setOrientationvoid setOrientation(javax.vecmath.Vector3f at, javax.vecmath.Vector3f up) Set the orientation of this AudioListener objectApplies only to sub-types: - Listener
 - Parameters:
- at- 3d vector representing the position
- up- 3d vector representing the look-at point
 
 - 
getOrientationjavax.vecmath.Vector3f getOrientation(int which) Return the orientation of this AudioListener objectApplies only to sub-types: - Listener
 - Parameters:
- which- the orientation vector to return: == AT - position; == UP - look-at point
- Returns:
- vector representing the chosen orientation vector
 
 - 
getCurrentOrientationjavax.vecmath.Vector3f getCurrentOrientation(int which) Return the current orientation of this AudioListener objectApplies only to sub-types: - Listener
 - Parameters:
- which- the orientation vector to return: == AT - position; == UP - look-at point
- Returns:
- vector representing the chosen orientation vector
 
 - 
getGainfloat getGain() Return the current gain settingApplies only to sub-types: - Listener
- Source
 - Returns:
- float gain
 
 - 
setGainvoid setGain(float gain) Set the gain of this AudioListener objectApplicable values 0.0f to 1.0f When applied to Listeners, has the effect of altering the master gain (or volume) Applies only to sub-types: - Listener
- Source
 - Parameters:
- gain- new gain value - range 0.0f to 1.0f
 
 - 
setMetersPerUnitvoid setMetersPerUnit(float metersPerUnit) Method to set the Meters per unit ratio for all distance calculations.Default value = 1.0f (i.e. 1 unit == 1 metre) Typical alternative values: - 0.3048f (i.e. 1 unit == 1 foot)
- 0.9144f (i.e. 1 unit == 1 yard)
 Applies only to sub-types: - Listener
 - Parameters:
- metersPerUnit- Meters per unit ratio
 
 - 
getMetersPerUnitfloat getMetersPerUnit() Retrieve the current Meters per unit ratio to use for all distance calculations.Default value = 1.0f (i.e. 1 unit == 1 metre) Typical alternative values: - 0.3048f (i.e. 1 unit == 1 foot)
- 0.9144f (i.e. 1 unit == 1 yard)
 Applies only to sub-types: - Listener
 - Returns:
- Meters per unit ratio
 
 
- 
 
-