Class JoalAudioListener
- java.lang.Object
-
- jmri.implementation.AbstractNamedBean
-
- jmri.implementation.AbstractAudio
-
- jmri.jmrit.audio.AbstractAudioListener
-
- jmri.jmrit.audio.JoalAudioListener
-
- All Implemented Interfaces:
java.lang.Comparable<NamedBean>
,Audio
,PropertyChangeProvider
,AudioListener
,NamedBean
public class JoalAudioListener extends AbstractAudioListener
JOAL implementation of the Audio Listener sub-class.For now, no system-specific implementations are forseen - this will remain internal-only
This software is based on or using the JOAL Library available from http://jogamp.org/joal/www/
JOAL is released under the BSD license. The full license terms follow:
Copyright (c) 2003-2006 Sun Microsystems, Inc. All Rights Reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistribution of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistribution in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of Sun Microsystems, Inc. or the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
This software is provided "AS IS," without a warranty of any kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
You acknowledge that this software is not designed or intended for use in the design, construction, operation or maintenance of any nuclear facility.
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 class jmri.jmrit.audio.AbstractAudioListener
AbstractAudioListener.AudioListenerMoveThread
-
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
-
-
Field Summary
-
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, register
-
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_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.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description JoalAudioListener(java.lang.String systemName)
Constructor for new JoalAudioListener with system nameJoalAudioListener(java.lang.String systemName, java.lang.String userName)
Constructor for new JoalAudioListener with system name and user name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
changePosition(javax.vecmath.Vector3f pos)
Method to change the current position of this sourceprotected void
cleanup()
Abstract method that concrete classes will implement to perform necessary cleanup routines.void
setGain(float gain)
Set the gain of this AudioListener objectvoid
setMetersPerUnit(float metersPerUnit)
Method to set the Meters per unit ratio for all distance calculations.void
setOrientation(javax.vecmath.Vector3f at, javax.vecmath.Vector3f up)
Set the orientation of this AudioListener objectvoid
setVelocity(javax.vecmath.Vector3f vel)
Sets the velocity of this AudioListener objectvoid
stateChanged(int oldState)
Method used to update the current state of the Audio object-
Methods inherited from class jmri.jmrit.audio.AbstractAudioListener
calculateCurrentPosition, doResetCurrentPosition, getCurrentOrientation, getCurrentPosition, getGain, getMetersPerUnit, getOrientation, getPosition, getSubType, getVelocity, resetCurrentPosition, setPosition, setPosition, setPosition
-
Methods inherited from class jmri.implementation.AbstractAudio
dispose, getBeanType, getState, getUsageReport, roundDecimal, roundDecimal, setState
-
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, describeState, equals, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRef, vetoableChange
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, 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.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Constructor Detail
-
JoalAudioListener
public JoalAudioListener(java.lang.String systemName)
Constructor for new JoalAudioListener with system name- Parameters:
systemName
- AudioListener object system name (e.g. IAL)
-
JoalAudioListener
public JoalAudioListener(java.lang.String systemName, java.lang.String userName)
Constructor for new JoalAudioListener with system name and user name- Parameters:
systemName
- AudioListener object system name (e.g. IAL)userName
- AudioListener object user name
-
-
Method Detail
-
changePosition
protected void changePosition(javax.vecmath.Vector3f pos)
Description copied from class:AbstractAudioListener
Method to change the current position of this source- Specified by:
changePosition
in classAbstractAudioListener
- Parameters:
pos
- new position
-
setVelocity
public void setVelocity(javax.vecmath.Vector3f vel)
Description copied from interface:AudioListener
Sets the velocity of this AudioListener objectApplies only to sub-types:
- Listener
- Source
- Specified by:
setVelocity
in interfaceAudioListener
- Overrides:
setVelocity
in classAbstractAudioListener
- Parameters:
vel
- 3d velocity vector
-
setOrientation
public void setOrientation(javax.vecmath.Vector3f at, javax.vecmath.Vector3f up)
Description copied from interface:AudioListener
Set the orientation of this AudioListener objectApplies only to sub-types:
- Listener
- Specified by:
setOrientation
in interfaceAudioListener
- Overrides:
setOrientation
in classAbstractAudioListener
- Parameters:
at
- 3d vector representing the positionup
- 3d vector representing the look-at point
-
setGain
public void setGain(float gain)
Description copied from interface:AudioListener
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
- Specified by:
setGain
in interfaceAudioListener
- Overrides:
setGain
in classAbstractAudioListener
- Parameters:
gain
- new gain value - range 0.0f to 1.0f
-
setMetersPerUnit
public void setMetersPerUnit(float metersPerUnit)
Description copied from interface:AudioListener
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
- Specified by:
setMetersPerUnit
in interfaceAudioListener
- Overrides:
setMetersPerUnit
in classAbstractAudioListener
- Parameters:
metersPerUnit
- Meters per unit ratio
-
stateChanged
public void stateChanged(int oldState)
Description copied from interface:Audio
Method used to update the current state of the Audio object- Specified by:
stateChanged
in interfaceAudio
- Overrides:
stateChanged
in classAbstractAudioListener
- Parameters:
oldState
- the former state
-
cleanup
protected void cleanup()
Description copied from class:AbstractAudio
Abstract method that concrete classes will implement to perform necessary cleanup routines.This method is now included in dispose(). The caller can call dispose() to cleanup and deregister an audio object.
- Specified by:
cleanup
in classAbstractAudio
-
-