Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Static Public Attributes | List of all members
om::sound::acoustics::contexts::AcousticContext Class Referenceabstract

A generic interface for classes that perform sound propagation and rendering. More...

#include <omAcousticContext.h>

Inheritance diagram for om::sound::acoustics::contexts::AcousticContext:
om::sound::acoustics::contexts::GeometricAcousticContext

Public Member Functions

virtual ~AcousticContext ()
 Destroy an acoustic context and release all internal resources. More...
 
virtual void update (const AcousticRequest &request, const Time &dt, AcousticResult *result=((void *) 0))=0
 Update the state of all scenes and listeners in the acoustic context for the specified timestep. More...
 
virtual Bool updateScene (SoundSceneID sceneID, const AcousticRequest &request, const Time &dt, AcousticResult *result=((void *) 0))=0
 Update the state of all listeners in the given scene for the specified timestep. More...
 
virtual Bool updateListener (SoundListenerID listenerID, const AcousticRequest &request, const Time &dt, AcousticResult *result=((void *) 0))=0
 Update the state of a single listener in the acoustic context for the specified timestep. More...
 
virtual SoundResult renderListener (SoundListenerID listenerID, SoundBuffer &buffer, Size numSamples)=0
 Render a buffer of output sound for the specified listener. More...
 
virtual Size getListenerCount () const =0
 Return the number of listeners there are in this acoustic context. More...
 
virtual SoundListenerID addListener (SoundListener *listener)=0
 Add a new sound listener to this acoustic context and return the ID of the listener in the context. More...
 
virtual Bool removeListener (SoundListenerID listenerID)=0
 Remove the listener with the specified ID from this acoustic context. More...
 
virtual void clearListeners ()=0
 Remove all listeners from this acoustic context. More...
 
virtual Size getSourceCount () const =0
 Return the number of sources there are in this acoustic context. More...
 
virtual SoundSourceID addSource (SoundSource *source)=0
 Add a new sound source to this acoustic context and return the ID of the source in the context. More...
 
virtual Bool removeSource (SoundSourceID sourceID)=0
 Remove the source with the specified ID from this acoustic context. More...
 
virtual void clearSources ()=0
 Remove all sources from this acoustic context. More...
 
virtual Size getObjectCount () const =0
 Return the number of objects there are in this acoustic context. More...
 
virtual SoundObjectID addObject (SoundObject *object)=0
 Add a new sound object to this acoustic context and return the ID of the object in the context. More...
 
virtual Bool removeObject (SoundObjectID objectID)=0
 Remove the object with the specified ID from this acoustic context. More...
 
virtual void clearObjects ()=0
 Remove all objects from this acoustic context. More...
 
virtual Size getShapeCount () const =0
 Return the number of shapes there are in this acoustic context. More...
 
virtual SoundShapeID addShape (SoundShape *shape)=0
 Add a new sound shape to this acoustic context and return the ID of the shape in the context. More...
 
virtual Bool removeShape (SoundShapeID shapeID)=0
 Remove the shape with the specified ID from this acoustic context. More...
 
virtual void clearShapes ()=0
 Remove all shapes from this acoustic context. More...
 
virtual Size getSceneCount () const =0
 Return the number of scenes there are in this acoustic context. More...
 
virtual SoundSceneID addScene ()=0
 Add a new sound scene to this acoustic context and return the ID of the scene in the context. More...
 
virtual Bool removeScene (SoundSceneID sceneID)=0
 Remove the object with the specified ID from this acoustic context. More...
 
virtual void clearScenes ()=0
 Remove all scenes from this acoustic context. More...
 
virtual Bool addSceneObject (SoundSceneID scene, SoundObjectID object)=0
 Add an existing object to the scene with the given ID. More...
 
virtual Bool removeSceneObject (SoundSceneID scene, SoundObjectID object)=0
 Remove an existing object from the scene with the given ID. More...
 
virtual Bool addSceneSource (SoundSceneID scene, SoundSourceID source)=0
 Add an existing source to the scene with the given ID. More...
 
virtual Bool removeSceneSource (SoundSceneID scene, SoundSourceID source)=0
 Remove an existing source from the scene with the given ID. More...
 
virtual Bool addSceneListener (SoundSceneID scene, SoundListenerID listener)=0
 Add an existing listener to the scene with the given ID. More...
 
virtual Bool removeSceneListener (SoundSceneID scene, SoundListenerID listener)=0
 Remove an existing listener from the scene with the given ID. More...
 
virtual Bool addObjectShape (SoundObjectID object, SoundShapeID shape)=0
 Add an existing shape to the object with the given ID. More...
 
virtual Bool removeObjectShape (SoundObjectID object, SoundShapeID shape)=0
 Remove an existing shape from the object with the given ID. More...
 
virtual Bool addSourceShape (SoundSourceID source, SoundShapeID shape)=0
 Add an existing shape to the source with the given ID. More...
 
virtual Bool removeSourceShape (SoundSourceID source, SoundShapeID shape)=0
 Remove an existing shape from the source with the given ID. More...
 
virtual Bool addListenerShape (SoundListenerID listener, SoundShapeID shape)=0
 Add an existing shape to the listener with the given ID. More...
 
virtual Bool removeListenerShape (SoundListenerID listener, SoundShapeID shape)=0
 Remove an existing shape from the listener with the given ID. More...
 
virtual const AcousticContextDelegategetDelegate () const =0
 Return a reference to the delegate for this acoustic context. More...
 
virtual void setDelegate (const AcousticContextDelegate &newDelegate)=0
 Set the delegate for this acoustic context. More...
 

Static Public Attributes

static const AcousticID INVALID_ID = -1
 The ID to use to represent an invalid context object ID. More...
 

Detailed Description

A generic interface for classes that perform sound propagation and rendering.

Subclasses can provide different implementations that meet the requirements of various applications.

Constructor & Destructor Documentation

virtual om::sound::acoustics::contexts::AcousticContext::~AcousticContext ( )
virtual

Destroy an acoustic context and release all internal resources.

Member Function Documentation

virtual void om::sound::acoustics::contexts::AcousticContext::update ( const AcousticRequest request,
const Time dt,
AcousticResult result = ((void *) 0) 
)
pure virtual

Update the state of all scenes and listeners in the acoustic context for the specified timestep.

The requested output acoustic data is placed in the result object if the pointer is not NULL.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Bool om::sound::acoustics::contexts::AcousticContext::updateScene ( SoundSceneID  sceneID,
const AcousticRequest request,
const Time dt,
AcousticResult result = ((void *) 0) 
)
pure virtual

Update the state of all listeners in the given scene for the specified timestep.

The state of the specified scene is updated but no other scenes are changed. This method can be used to update scenes at different rates (e.g. for different priorities).

The requested output acoustic data is placed in the result object if the pointer is not NULL.

The method returns whether or not the specified scene was able to be updated.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Bool om::sound::acoustics::contexts::AcousticContext::updateListener ( SoundListenerID  listenerID,
const AcousticRequest request,
const Time dt,
AcousticResult result = ((void *) 0) 
)
pure virtual

Update the state of a single listener in the acoustic context for the specified timestep.

The state of the specified listener is updated but no other listeners are changed. This method can be used to update listeners at different rates (e.g. for different priorities).

The requested output acoustic data is placed in the result object if the pointer is not NULL.

The method returns whether or not the specified listener was able to be updated.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual SoundResult om::sound::acoustics::contexts::AcousticContext::renderListener ( SoundListenerID  listenerID,
SoundBuffer buffer,
Size  numSamples 
)
pure virtual

Render a buffer of output sound for the specified listener.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Size om::sound::acoustics::contexts::AcousticContext::getListenerCount ( ) const
pure virtual

Return the number of listeners there are in this acoustic context.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual SoundListenerID om::sound::acoustics::contexts::AcousticContext::addListener ( SoundListener listener)
pure virtual

Add a new sound listener to this acoustic context and return the ID of the listener in the context.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Bool om::sound::acoustics::contexts::AcousticContext::removeListener ( SoundListenerID  listenerID)
pure virtual

Remove the listener with the specified ID from this acoustic context.

The method returns whether or not the listener was able to be removed.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual void om::sound::acoustics::contexts::AcousticContext::clearListeners ( )
pure virtual

Remove all listeners from this acoustic context.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Size om::sound::acoustics::contexts::AcousticContext::getSourceCount ( ) const
pure virtual

Return the number of sources there are in this acoustic context.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual SoundSourceID om::sound::acoustics::contexts::AcousticContext::addSource ( SoundSource source)
pure virtual

Add a new sound source to this acoustic context and return the ID of the source in the context.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Bool om::sound::acoustics::contexts::AcousticContext::removeSource ( SoundSourceID  sourceID)
pure virtual

Remove the source with the specified ID from this acoustic context.

The method returns whether or not the source was able to be removed.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual void om::sound::acoustics::contexts::AcousticContext::clearSources ( )
pure virtual

Remove all sources from this acoustic context.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Size om::sound::acoustics::contexts::AcousticContext::getObjectCount ( ) const
pure virtual

Return the number of objects there are in this acoustic context.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual SoundObjectID om::sound::acoustics::contexts::AcousticContext::addObject ( SoundObject object)
pure virtual

Add a new sound object to this acoustic context and return the ID of the object in the context.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Bool om::sound::acoustics::contexts::AcousticContext::removeObject ( SoundObjectID  objectID)
pure virtual

Remove the object with the specified ID from this acoustic context.

The method returns whether or not the object was able to be removed.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual void om::sound::acoustics::contexts::AcousticContext::clearObjects ( )
pure virtual

Remove all objects from this acoustic context.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Size om::sound::acoustics::contexts::AcousticContext::getShapeCount ( ) const
pure virtual

Return the number of shapes there are in this acoustic context.

virtual SoundShapeID om::sound::acoustics::contexts::AcousticContext::addShape ( SoundShape shape)
pure virtual

Add a new sound shape to this acoustic context and return the ID of the shape in the context.

virtual Bool om::sound::acoustics::contexts::AcousticContext::removeShape ( SoundShapeID  shapeID)
pure virtual

Remove the shape with the specified ID from this acoustic context.

The method returns whether or not the shape was able to be removed.

virtual void om::sound::acoustics::contexts::AcousticContext::clearShapes ( )
pure virtual

Remove all shapes from this acoustic context.

virtual Size om::sound::acoustics::contexts::AcousticContext::getSceneCount ( ) const
pure virtual

Return the number of scenes there are in this acoustic context.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual SoundSceneID om::sound::acoustics::contexts::AcousticContext::addScene ( )
pure virtual

Add a new sound scene to this acoustic context and return the ID of the scene in the context.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Bool om::sound::acoustics::contexts::AcousticContext::removeScene ( SoundSceneID  sceneID)
pure virtual

Remove the object with the specified ID from this acoustic context.

The method returns whether or not the object was able to be removed.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual void om::sound::acoustics::contexts::AcousticContext::clearScenes ( )
pure virtual

Remove all scenes from this acoustic context.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Bool om::sound::acoustics::contexts::AcousticContext::addSceneObject ( SoundSceneID  scene,
SoundObjectID  object 
)
pure virtual

Add an existing object to the scene with the given ID.

An object can be part of more than one scene. The method returns whether or not the object was able to be added to the scene.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Bool om::sound::acoustics::contexts::AcousticContext::removeSceneObject ( SoundSceneID  scene,
SoundObjectID  object 
)
pure virtual

Remove an existing object from the scene with the given ID.

The method returns whether or not the object was able to be removed from the scene.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Bool om::sound::acoustics::contexts::AcousticContext::addSceneSource ( SoundSceneID  scene,
SoundSourceID  source 
)
pure virtual

Add an existing source to the scene with the given ID.

An source can be part of more than one scene. The method returns whether or not the source was able to be added to the scene.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Bool om::sound::acoustics::contexts::AcousticContext::removeSceneSource ( SoundSceneID  scene,
SoundSourceID  source 
)
pure virtual

Remove an existing source from the scene with the given ID.

The method returns whether or not the source was able to be removed from the scene.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Bool om::sound::acoustics::contexts::AcousticContext::addSceneListener ( SoundSceneID  scene,
SoundListenerID  listener 
)
pure virtual

Add an existing listener to the scene with the given ID.

An listener can be part of more than one scene. The method returns whether or not the listener was able to be added to the scene.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Bool om::sound::acoustics::contexts::AcousticContext::removeSceneListener ( SoundSceneID  scene,
SoundListenerID  listener 
)
pure virtual

Remove an existing listener from the scene with the given ID.

The method returns whether or not the listener was able to be removed from the scene.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual Bool om::sound::acoustics::contexts::AcousticContext::addObjectShape ( SoundObjectID  object,
SoundShapeID  shape 
)
pure virtual

Add an existing shape to the object with the given ID.

A shape can be part of more than one object. The method returns whether or not the shape was able to be added to the object.

virtual Bool om::sound::acoustics::contexts::AcousticContext::removeObjectShape ( SoundObjectID  object,
SoundShapeID  shape 
)
pure virtual

Remove an existing shape from the object with the given ID.

The method returns whether or not the shape was able to be removed from the object.

virtual Bool om::sound::acoustics::contexts::AcousticContext::addSourceShape ( SoundSourceID  source,
SoundShapeID  shape 
)
pure virtual

Add an existing shape to the source with the given ID.

A shape can be part of more than one source. The method returns whether or not the shape was able to be added to the source.

virtual Bool om::sound::acoustics::contexts::AcousticContext::removeSourceShape ( SoundSourceID  source,
SoundShapeID  shape 
)
pure virtual

Remove an existing shape from the source with the given ID.

The method returns whether or not the shape was able to be removed from the source.

virtual Bool om::sound::acoustics::contexts::AcousticContext::addListenerShape ( SoundListenerID  listener,
SoundShapeID  shape 
)
pure virtual

Add an existing shape to the listener with the given ID.

A shape can be part of more than one listener. The method returns whether or not the shape was able to be added to the listener.

virtual Bool om::sound::acoustics::contexts::AcousticContext::removeListenerShape ( SoundListenerID  listener,
SoundShapeID  shape 
)
pure virtual

Remove an existing shape from the listener with the given ID.

The method returns whether or not the shape was able to be removed from the listener.

virtual const AcousticContextDelegate& om::sound::acoustics::contexts::AcousticContext::getDelegate ( ) const
pure virtual

Return a reference to the delegate for this acoustic context.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

virtual void om::sound::acoustics::contexts::AcousticContext::setDelegate ( const AcousticContextDelegate newDelegate)
pure virtual

Set the delegate for this acoustic context.

Implemented in om::sound::acoustics::contexts::GeometricAcousticContext.

Member Data Documentation

const AcousticID om::sound::acoustics::contexts::AcousticContext::INVALID_ID = -1
static

The ID to use to represent an invalid context object ID.


The documentation for this class was generated from the following file: