|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.implementation.AbstractNamedBean
jmri.implementation.AbstractAudio
jmri.jmrit.audio.AbstractAudioListener
public abstract class AbstractAudioListener
Base implementation of the AudioListener class.
Specific implementations will extend this base class.
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 |
|---|
| Fields inherited from interface jmri.Audio |
|---|
AT, 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_RESET_POSITION, CMD_RESUME, CMD_REWIND, CMD_STOP, 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.NamedBean |
|---|
INCONSISTENT, UNKNOWN |
| Constructor Summary | |
|---|---|
AbstractAudioListener(String systemName)
Abstract constructor for new AudioListener with system name |
|
AbstractAudioListener(String systemName,
String userName)
Abstract constructor for new AudioListener with system name and user name |
|
| Method Summary | |
|---|---|
Vector3f |
getCurrentOrientation(int which)
Return the current orientation of this AudioListener object Applies only to sub-types: Listener |
Vector3f |
getCurrentPosition()
Returns the current position of this AudioListener object as a 3-dimensional vector. |
float |
getGain()
Return the current gain setting Applies only to sub-types: Listener Source |
float |
getMetersPerUnit()
Retrieve the current Meters per unit ratio to use for all distance calculations. |
Vector3f |
getOrientation(int which)
Return the orientation of this AudioListener object Applies only to sub-types: Listener |
Vector3f |
getPosition()
Returns the position of this AudioListener object as a 3-dimensional vector. |
char |
getSubType()
An Audio object can represent one of a number of subtypes of object. |
Vector3f |
getVelocity()
Returns the velocity of this AudioListener object Applies only to sub-types: - Listener - Source |
void |
resetCurrentPosition()
Method to reset the current position of this AudioListener object to the initial position as defined by setPosition. |
void |
setGain(float gain)
Set the gain of this AudioListener object Applicable 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 |
void |
setMetersPerUnit(float metersPerUnit)
Method to set the Meters per unit ratio for all distance calculations. |
void |
setOrientation(Vector3f at,
Vector3f up)
Set the orientation of this AudioListener object Applies only to sub-types: Listener |
void |
setPosition(float x,
float y)
Sets the position of this AudioListener object in x and y planes with z plane position fixed at zero Equivalent to setPosition(x, y, 0.0f) Applies only to sub-types: Listener Source |
void |
setPosition(float x,
float y,
float z)
Sets the position of this AudioListener object in x, y and z planes Applies only to sub-types: Listener Source |
void |
setPosition(Vector3f pos)
Sets the position of this AudioListener object Applies only to sub-types: Listener Source |
void |
setVelocity(Vector3f vel)
Sets the velocity of this AudioListener object Applies only to sub-types: Listener Source |
void |
stateChanged(int oldState)
Method used to update the current state of the Audio object |
String |
toString()
|
| Methods inherited from class jmri.implementation.AbstractAudio |
|---|
getState, roundDecimal, roundDecimal, setState |
| Methods inherited from class jmri.implementation.AbstractNamedBean |
|---|
addPropertyChangeListener, dispose, getComment, getDisplayName, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyKeys, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setUserName |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jmri.NamedBean |
|---|
addPropertyChangeListener, dispose, getComment, getDisplayName, getNumPropertyChangeListeners, getProperty, getPropertyKeys, getState, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setState, setUserName |
| Constructor Detail |
|---|
public AbstractAudioListener(String systemName)
systemName - AudioListener object system name (e.g. IAL)
public AbstractAudioListener(String systemName,
String userName)
systemName - AudioListener object system name (e.g. IAL)userName - AudioListener object user name| Method Detail |
|---|
public char getSubType()
AudioThis method enables us to determine which of those subtypes this particular instance is and be able to process accordingly.
Current supported subtypes are:
getSubType in interface Audiopublic void setPosition(Vector3f pos)
AudioListenerApplies only to sub-types:
setPosition in interface AudioListenerpos - 3d position vector
public void setPosition(float x,
float y,
float z)
AudioListenerApplies only to sub-types:
setPosition in interface AudioListenerx - x-coordinatey - y-coordinatez - z-coordinate
public void setPosition(float x,
float y)
AudioListenerEquivalent to setPosition(x, y, 0.0f)
Applies only to sub-types:
setPosition in interface AudioListenerx - x-coordinatey - y-coordinatepublic Vector3f getPosition()
AudioListenerApplies only to sub-types:
getPosition in interface AudioListenerpublic Vector3f getCurrentPosition()
AudioListenerApplies only to sub-types:
getCurrentPosition in interface AudioListenerpublic void setVelocity(Vector3f vel)
AudioListenerApplies only to sub-types:
setVelocity in interface AudioListenervel - 3d velocity vectorpublic Vector3f getVelocity()
AudioListener
getVelocity in interface AudioListenerpublic void resetCurrentPosition()
AudioListenerApplies only to sub-types:
resetCurrentPosition in interface AudioListener
public void setOrientation(Vector3f at,
Vector3f up)
AudioListenerApplies only to sub-types:
setOrientation in interface AudioListenerat - 3d vector representing the positionup - 3d vector representing the look-at pointpublic Vector3f getOrientation(int which)
AudioListenerApplies only to sub-types:
getOrientation in interface AudioListenerwhich - the orientation vector to return:
== AT - position;
== UP - look-at point
public Vector3f getCurrentOrientation(int which)
AudioListenerApplies only to sub-types:
getCurrentOrientation in interface AudioListenerwhich - the orientation vector to return:
== AT - position;
== UP - look-at point
public void setGain(float gain)
AudioListenerApplicable 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:
setGain in interface AudioListenerpublic float getGain()
AudioListenerApplies only to sub-types:
getGain in interface AudioListenerpublic void setMetersPerUnit(float metersPerUnit)
AudioListenerDefault value = 1.0f (i.e. 1 unit == 1 metre)
Typical alternative values:
Applies only to sub-types:
setMetersPerUnit in interface AudioListenermetersPerUnit - Meters per unit ratiopublic float getMetersPerUnit()
AudioListenerDefault value = 1.0f (i.e. 1 unit == 1 metre)
Typical alternative values:
Applies only to sub-types:
getMetersPerUnit in interface AudioListenerpublic void stateChanged(int oldState)
Audio
stateChanged in interface Audiopublic String toString()
toString in class AbstractAudio
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||