org.commonreality.sensors.aural
Class GeneralAuralProcessor

java.lang.Object
  extended by org.commonreality.sensors.aural.GeneralAuralProcessor
All Implemented Interfaces:
ICommonRealityListener, IObjectListener<IRealObject>, IRealObjectListener

public class GeneralAuralProcessor
extends java.lang.Object
implements IRealObjectListener

the general aural processor is a component that monitors all the realobjects looking for anything that is audible. Any sound is output to the simulation as an IRealObject with the IAuralPropertyHandler properties. It will then transform that aural into an IAfferentObject for each of the connected agents. Calls to update(double) will remove any IAfferentObject that have exceeded their duration.

If additional properties need to be set on a percept level (i.e. spatial localization of the sound), this can be done by adding an GeneralAuralProcessor.IAuralMutator via add(org.commonreality.sensors.aural.GeneralAuralProcessor.IAuralMutator)

This should be attached to the sensors RealObjectManager on an executor other than the sensors IO executor (since it may have to block to create new IAfferentObjects)

Author:
harrison

Nested Class Summary
static interface GeneralAuralProcessor.IAuralMutator
          interface used to dynamically configure aural percepts
 
Constructor Summary
GeneralAuralProcessor(ISensor sensor)
           
 
Method Summary
 void add(GeneralAuralProcessor.IAuralMutator mutator)
           
 void objectsAdded(IObjectEvent<IRealObject,?> addEvent)
           
 void objectsRemoved(IObjectEvent<IRealObject,?> removeEvent)
          this ignores the removal of the original IRealObject that launched the IAfferentObject percept of the sound, since the percept is internal
 void objectsUpdated(IObjectEvent<IRealObject,?> updateEvent)
          aural events don't change once they've been detected
 double update(double currentTime)
          update all IAfferentObjects representing percepts of hearable aural objects, removing any of those that have elapsed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneralAuralProcessor

public GeneralAuralProcessor(ISensor sensor)
Method Detail

add

public void add(GeneralAuralProcessor.IAuralMutator mutator)

update

public double update(double currentTime)
update all IAfferentObjects representing percepts of hearable aural objects, removing any of those that have elapsed.

Parameters:
currentTime -
Returns:
next expiration time or Double.NaN

objectsAdded

public void objectsAdded(IObjectEvent<IRealObject,?> addEvent)
Specified by:
objectsAdded in interface IObjectListener<IRealObject>

objectsRemoved

public void objectsRemoved(IObjectEvent<IRealObject,?> removeEvent)
this ignores the removal of the original IRealObject that launched the IAfferentObject percept of the sound, since the percept is internal

Specified by:
objectsRemoved in interface IObjectListener<IRealObject>

objectsUpdated

public void objectsUpdated(IObjectEvent<IRealObject,?> updateEvent)
aural events don't change once they've been detected

Specified by:
objectsUpdated in interface IObjectListener<IRealObject>
Parameters:
updateEvent -
See Also:
IObjectListener.objectsUpdated(org.commonreality.object.manager.event.IObjectEvent)