The IListener graph node interface. More...

#include "murl_graph_i_listener.h"

Inheritance diagram for Murl::Graph::IListener:

Public Member Functions

virtual INodeGetNodeInterface ()=0
 Get the mutable INode interface. More...
 
virtual const INodeGetNodeInterface () const =0
 Get the constant INode interface. More...
 
virtual ISubjectGetSubjectInterface ()=0
 Get the mutable ISubject interface. More...
 
virtual const ISubjectGetSubjectInterface () const =0
 Get the constant ISubject interface. More...
 
virtual IViewNodeTargetGetViewNodeTarget ()=0
 Get the mutable IViewNodeTarget container. More...
 
virtual const IViewNodeTargetGetViewNodeTarget () const =0
 Get the constant IViewNodeTarget container. More...
 
virtual Bool SetVolume (Real volume)=0
 Set the listener's volume (gain). More...
 
virtual Real GetVolume () const =0
 Get the listener's volume (gain). More...
 
virtual Bool SetMaxDistance (Real maxDistance)=0
 Set the maximum hearing distance. More...
 
virtual Real GetMaxDistance () const =0
 Get the maximum hearing distance. More...
 
virtual Bool SetDistanceModel (IEnums::DistanceModel distanceModel)=0
 Set the listener's distance model used for attenuation calculation. More...
 
virtual IEnums::DistanceModel GetDistanceModel () const =0
 Get the listener's distance model used for attenuation calculation. More...
 
virtual UInt32 GetNumberOfStages () const =0
 Get the listener's number of stages. More...
 
virtual Audio::IListenerGetAudioListenerObject (UInt32 stage) const =0
 Get the listener's internal audio renderer object. More...
 
- Public Member Functions inherited from Murl::Graph::IStateSlot
virtual Bool SetSlot (SInt32 slot)=0
 Set the slot index to use. More...
 
virtual SInt32 GetSlot () const =0
 Get the slot index to use. More...
 

Detailed Description

The IListener graph node interface.

A listener represents a node positioned in world space that is "listening" to any sound sources (e.g. IAudioSequence nodes) within its hearing range. All captured sources are attenuated according to their distance and given parameters, and mixed together afterwards.

See Output-States, Slots und Units for an overview of state handling during scene graph traversal.
See Graph::IListenerTransform for setting a listener's position and orientation. See Graph::IListenerState for activating a listener for rendering.

Gain calculation formula:
REFERENCE_DISTANCE = referenceDistance attribute from IPlayable
ROLLOFF_FACTOR = rolloffFactor attribute from IPlayable
MAX_DISTANCE = maxDistance attribute from IPlayable

  • distanceModel="INVERSE"
    gain = REFERENCE_DISTANCE / (REFERENCE_DISTANCE + ROLLOFF_FACTOR * (distance – REFERENCE_DISTANCE))
  • distanceModel="INVERSE_CLAMPED"
    distance = max(distance, REFERENCE_DISTANCE)
    distance = min(distance, MAX_DISTANCE)
    gain = REFERENCE_DISTANCE / (REFERENCE_DISTANCE + ROLLOFF_FACTOR * (distance – REFERENCE_DISTANCE))
  • distanceModel="LINEAR"
    distance = min(distance, MAX_DISTANCE) // avoid negative gain
    gain = (1 – ROLLOFF_FACTOR * (distance – REFERENCE_DISTANCE) / (MAX_DISTANCE – REFERENCE_DISTANCE))
  • distanceModel="LINEAR_CLAMPED"
    distance = max(distance, REFERENCE_DISTANCE)
    distance = min(distance, MAX_DISTANCE)
    gain = (1 – ROLLOFF_FACTOR * (distance – REFERENCE_DISTANCE) / (MAX_DISTANCE – REFERENCE_DISTANCE))
  • distanceModel="EXPONENT"
    gain = (distance / REFERENCE_DISTANCE) ^ (- ROLLOFF_FACTOR)
  • distanceModel="EXPONENT_CLAMPED"
    distance = max(distance, REFERENCE_DISTANCE)
    distance = min(distance, MAX_DISTANCE)
    gain = (distance / REFERENCE_DISTANCE) ^ (- ROLLOFF_FACTOR)

Member Function Documentation

◆ GetNodeInterface() [1/2]

virtual INode* Murl::Graph::IListener::GetNodeInterface ( )
pure virtual

Get the mutable INode interface.

This method returns a mutable pointer to the node's INode interface, to be able to query or modify common node properties such as active state, visibility or ID.

Returns
The mutable INode interface, or null if not available

◆ GetNodeInterface() [2/2]

virtual const INode* Murl::Graph::IListener::GetNodeInterface ( ) const
pure virtual

Get the constant INode interface.

This method returns a constant pointer to the node's INode interface, to be able to query common node properties such as active state, visibility or ID.

Returns
The constant INode interface, or null if not available

◆ GetSubjectInterface() [1/2]

virtual ISubject* Murl::Graph::IListener::GetSubjectInterface ( )
pure virtual

Get the mutable ISubject interface.

This method returns a mutable pointer to the node's ISubject interface, to be able to query or modify subject properties such as world transform, viewing matrix, projection matrix etc.

Returns
The mutable ISubject interface, or null if not available

◆ GetSubjectInterface() [2/2]

virtual const ISubject* Murl::Graph::IListener::GetSubjectInterface ( ) const
pure virtual

Get the constant ISubject interface.

This method returns a constant pointer to the node's ISubject interface, to be able to query subject properties such as world transform, viewing matrix, projection matrix etc.

Returns
The mutable ISubject interface, or null if not available

◆ GetViewNodeTarget() [1/2]

virtual IViewNodeTarget* Murl::Graph::IListener::GetViewNodeTarget ( )
pure virtual

Get the mutable IViewNodeTarget container.

This method returns a mutable pointer to the node's IViewNodeTarget container, which allows to set or query the view object the listener is attached to.

Returns
The mutable IViewNodeTarget container, or null if not available

◆ GetViewNodeTarget() [2/2]

virtual const IViewNodeTarget* Murl::Graph::IListener::GetViewNodeTarget ( ) const
pure virtual

Get the constant IViewNodeTarget container.

This method returns a constant pointer to the node's IViewNodeTarget container, which allows to query the view object the listener is attached to.

Returns
The constant IViewNodeTarget container, or null if not available

◆ SetVolume()

virtual Bool Murl::Graph::IListener::SetVolume ( Real  volume)
pure virtual

Set the listener's volume (gain).

Parameters
volumeThe overall volume.
Returns
true if successful.

◆ GetVolume()

virtual Real Murl::Graph::IListener::GetVolume ( ) const
pure virtual

Get the listener's volume (gain).

Returns
The overall volume.

◆ SetMaxDistance()

virtual Bool Murl::Graph::IListener::SetMaxDistance ( Real  maxDistance)
pure virtual

Set the maximum hearing distance.

Parameters
maxDistanceThe maximum distance.
Returns
true if successful.

◆ GetMaxDistance()

virtual Real Murl::Graph::IListener::GetMaxDistance ( ) const
pure virtual

Get the maximum hearing distance.

Returns
The maximum distance.

◆ SetDistanceModel()

virtual Bool Murl::Graph::IListener::SetDistanceModel ( IEnums::DistanceModel  distanceModel)
pure virtual

Set the listener's distance model used for attenuation calculation.

Parameters
distanceModelThe distance model to use.
Returns
true if successful.

◆ GetDistanceModel()

virtual IEnums::DistanceModel Murl::Graph::IListener::GetDistanceModel ( ) const
pure virtual

Get the listener's distance model used for attenuation calculation.

Returns
The distance model used.

◆ GetNumberOfStages()

virtual UInt32 Murl::Graph::IListener::GetNumberOfStages ( ) const
pure virtual

Get the listener's number of stages.

Returns
The number of stages.

◆ GetAudioListenerObject()

virtual Audio::IListener* Murl::Graph::IListener::GetAudioListenerObject ( UInt32  stage) const
pure virtual

Get the listener's internal audio renderer object.

Parameters
stageThe stage to query.
Returns
The audio renderer object.

The documentation for this interface was generated from the following file:
  • murl_graph_i_listener.h


Copyright © 2011-2018 Spraylight GmbH.