|
||||||||||
| 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.AbstractAudioSource
jmri.jmrit.audio.JoalAudioSource
public class JoalAudioSource
JOAL implementation of the Audio Source sub-class.
For now, no system-specific implementations are forseen - this will remain
internal-only
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 class jmri.jmrit.audio.AbstractAudioSource |
|---|
AbstractAudioSource.AudioSourceFadeThread, AbstractAudioSource.AudioSourceMoveThread |
| Field Summary |
|---|
| Fields inherited from class jmri.implementation.AbstractNamedBean |
|---|
mSystemName, mUserName |
| Fields inherited from interface jmri.jmrit.audio.AudioSource |
|---|
LOOP_CONTINUOUS, LOOP_NONE |
| 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 | |
|---|---|
JoalAudioSource(String systemName)
Constructor for new JoalAudioSource with system name |
|
JoalAudioSource(String systemName,
String userName)
Constructor for new JoalAudioSource with system name and user name |
|
| Method Summary | |
|---|---|
boolean |
bindAudioBuffer(AudioBuffer audioBuffer)
Binds this AudioSource with the specified AudioBuffer Applies only to sub-types: Source |
protected void |
calculateGain()
Method to calculate the gain of this AudioSource based on distance from listener and fade levels |
protected void |
changePosition(Vector3f pos)
Method to change the current position of this source |
protected void |
cleanUp()
Abstract method that concrete classes will implement to perform necessary cleanup routines. |
protected void |
doFadeIn()
Fade in then play this AudioSource |
protected void |
doFadeOut()
Fade out then stop this AudioSource |
protected void |
doPause()
Stop playing the clip but retain the current position |
protected void |
doPlay()
Play the clip from the beginning. |
protected void |
doResume()
Play the clip from the current position |
protected void |
doRewind()
Rewind clip to the beginning |
protected void |
doStop()
Stop playing the clip and rewind to the beginning |
int |
getState()
Provide generic access to internal state. |
void |
setDopplerFactor(float dopplerFactor)
Set the doppler factor of this source Default value = 1.0f Only calculated for JoalAudioSources Applies only to sub-types: Source |
void |
setGain(float gain)
Set the gain of this AudioSource object Default value = 1.0f Applies only to sub-types: Listener Source |
void |
setMaximumDistance(float maximumDistance)
Set the current maximum distance setting Default value = Audio.MAX_DISTANCE The maximum distance is that where the volume of the sound would normally be zero. |
void |
setPitch(float pitch)
Set the pitch of this AudioSource object Values are restricted from 0.5f to 2.0f, i.e. half to double Default value = 1.0f Applies only to sub-types: Source |
void |
setReferenceDistance(float referenceDistance)
Set the reference distance of this AudioSource object. |
void |
setRollOffFactor(float rollOffFactor)
Set the roll-off factor of this AudioSource object Default value = 1.0f Applies only to sub-types: Source |
void |
setVelocity(Vector3f vel)
Sets the velocity of this AudioSource object Applies only to sub-types: Listener Source |
void |
stateChanged(int oldState)
Method used to update the current state of the Audio object |
| Methods inherited from class jmri.implementation.AbstractAudio |
|---|
roundDecimal, roundDecimal, setState |
| Methods inherited from class jmri.implementation.AbstractNamedBean |
|---|
addPropertyChangeListener, dispose, firePropertyChange, getComment, getDisplayName, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setUserName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jmri.NamedBean |
|---|
addPropertyChangeListener, dispose, getComment, getDisplayName, getNumPropertyChangeListeners, getProperty, getSystemName, getUserName, removePropertyChangeListener, setComment, setProperty, setState, setUserName |
| Constructor Detail |
|---|
public JoalAudioSource(String systemName)
systemName - AudioSource object system name (e.g. IAS1)
public JoalAudioSource(String systemName,
String userName)
systemName - AudioSource object system name (e.g. IAS1)userName - AudioSource object user name| Method Detail |
|---|
public boolean bindAudioBuffer(AudioBuffer audioBuffer)
AudioSourceApplies only to sub-types:
audioBuffer - the AudioBuffer to bind to this AudioSource
protected void changePosition(Vector3f pos)
AbstractAudioSource
changePosition in class AbstractAudioSourcepos - new positionpublic void setVelocity(Vector3f vel)
AudioSourceApplies only to sub-types:
setVelocity in interface AudioSourcesetVelocity in class AbstractAudioSourcevel - 3d velocity vectorpublic void setGain(float gain)
AudioSourceDefault value = 1.0f
Applies only to sub-types:
setGain in interface AudioSourcesetGain in class AbstractAudioSourcegain - the gain of this AudioSourcepublic void setPitch(float pitch)
AudioSourceValues are restricted from 0.5f to 2.0f, i.e. half to double
Default value = 1.0f
Applies only to sub-types:
setPitch in interface AudioSourcesetPitch in class AbstractAudioSourcepitch - the pitch of this AudioSourcepublic void setReferenceDistance(float referenceDistance)
AudioSourceDefault value = 1.0f
The Reference Distance is one of the main parameters you have for controlling the way that sounds attenutate with distance. A Source with Reference Distance set to 5 (meters) will be at maximum volume while it is within 5 metere of the listener, and start to fade out as it moves further away. At 10 meters it will be at half volume, and at 20 meters at a quarter volume, etc ...
Applies only to sub-types:
setReferenceDistance in interface AudioSourcesetReferenceDistance in class AbstractAudioSourcereferenceDistance - the Reference Distance for this AudioSourcepublic void setMaximumDistance(float maximumDistance)
AudioSourceDefault value = Audio.MAX_DISTANCE
The maximum distance is that where the volume of the sound would normally be zero.
Applies only to sub-types:
setMaximumDistance in interface AudioSourcesetMaximumDistance in class AbstractAudioSourcemaximumDistance - maximum distance of this sourcepublic void setRollOffFactor(float rollOffFactor)
AudioSourceDefault value = 1.0f
Applies only to sub-types:
setRollOffFactor in interface AudioSourcesetRollOffFactor in class AbstractAudioSourcerollOffFactor - roll-off factorpublic void setDopplerFactor(float dopplerFactor)
AudioSourceDefault value = 1.0f
Only calculated for JoalAudioSources
Applies only to sub-types:
setDopplerFactor in interface AudioSourcesetDopplerFactor in class AbstractAudioSourcedopplerFactor - factor to apply in doppler calculationspublic int getState()
NamedBeanThis generally shouldn't be used by Java code; use the class-specific form instead. (E.g. getCommandedState in Turnout) This provided to make Jython script access easier to read.
getState in interface NamedBeangetState in class AbstractAudiopublic void stateChanged(int oldState)
Audio
stateChanged in interface AudiostateChanged in class AbstractAudioSourceprotected void doPlay()
AbstractAudioSource
doPlay in class AbstractAudioSourceprotected void doStop()
AbstractAudioSource
doStop in class AbstractAudioSourceprotected void doPause()
AbstractAudioSource
doPause in class AbstractAudioSourceprotected void doResume()
AbstractAudioSource
doResume in class AbstractAudioSourceprotected void doRewind()
AbstractAudioSource
doRewind in class AbstractAudioSourceprotected void doFadeIn()
AbstractAudioSource
doFadeIn in class AbstractAudioSourceprotected void doFadeOut()
AbstractAudioSource
doFadeOut in class AbstractAudioSourceprotected void cleanUp()
AbstractAudio
cleanUp in class AbstractAudioprotected void calculateGain()
AbstractAudioSource
calculateGain in class AbstractAudioSource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||