The Audio::IRenderer interface represents a generic audio renderer. More...

#include "murl_audio_i_renderer.h"

Inheritance diagram for Murl::Audio::IRenderer:

Public Member Functions

virtual IEnums::AudioApi GetApi () const =0
 Get the underlying audio API. More...
 
virtual Bool Init (IEngine *engine, const IAppConfiguration *appConfig, IFeatureSet *features, IAudioInterface *audioInterface)=0
 Initialize the renderer. More...
 
virtual Bool DeInit ()=0
 Deinitialize the renderer. More...
 
virtual Bool Start ()=0
 Start the renderer after it has been initialized. More...
 
virtual Bool Stop ()=0
 Stop the renderer before it gets deinitialized. More...
 
virtual Bool Pause ()=0
 Pause the renderer if it is running. More...
 
virtual Bool Continue ()=0
 Continue the renderer if it is paused. More...
 
virtual Bool Suspend ()=0
 Suspend the renderer. More...
 
virtual Bool Resume ()=0
 Resume the renderer. More...
 
virtual IObjectCreateObject (const String &className)=0
 Create a renderer object. More...
 
virtual Bool DestroyObject (IObject *&object)=0
 Destroy an object that was created by this renderer. More...
 
virtual Bool BeginSubmission ()=0
 Begin submission of renderer objects for the next frame. More...
 
virtual Bool EndSubmission ()=0
 End submission of renderer objects for the next frame. More...
 
virtual Bool BeginRendering (Bool triggerSuspend)=0
 Start the actual rendering process after all current objects have been submitted. More...
 
virtual Bool EndRendering ()=0
 Wait for the current rendering process to complete, after calling BeginRendering(). More...
 
virtual Bool RegisterRenderThread (UInt64 threadId)=0
 Register a render (main) thread with the renderer. More...
 
virtual Bool RegisterLogicThread (UInt64 threadId)=0
 Register a logic processing thread with the renderer. More...
 
virtual Bool RegisterLoaderThread (UInt64 threadId)=0
 Register a background loader thread with the renderer. More...
 
virtual Bool UnregisterRenderThread (UInt64 threadId)=0
 Unregister a render (main) thread from the renderer. More...
 
virtual Bool UnregisterLogicThread (UInt64 threadId)=0
 Unregister a logic processing thread from the renderer. More...
 
virtual Bool UnregisterLoaderThread (UInt64 threadId)=0
 Unregister a background loader thread from the renderer. More...
 
virtual Bool RegisterAutomaticallySuspendableObject (IObject *object)=0
 Register an object for automatic resource suspension. More...
 
virtual Bool UnregisterAutomaticallySuspendableObject (IObject *object)=0
 Unregister an object from automatic resource suspension. More...
 
virtual Bool RegisterManuallySuspendableObject (IObject *object)=0
 Register an object for manual resource suspension. More...
 
virtual Bool UnregisterManuallySuspendableObject (IObject *object)=0
 Unregister an object from manual resource suspension. More...
 
virtual void SetCurrentListener (IListener *listener)=0
 Set the current listener affecting subsequent playables. More...
 
virtual void SetCurrentTransform (const Matrix *transform)=0
 Set the current world transform affecting subsequent playables. More...
 
virtual void PushObjectForUpdate (IObject *object, Real localTime=0.0)=0
 Queue up an object for updating. More...
 
virtual void PushObjectForRendering (IPlayable *object, Real localTime)=0
 Queue up a playable object for rendering. More...
 
virtual UInt32 GetRecentNumberOfObjectsRendered () const =0
 Query the number of most recently rendered objects. More...
 
virtual UInt32 GetRecentNumberOfBatchesRendered () const =0
 Query the number of most recently rendered object batches. More...
 
virtual UInt32 GetRecentNumberOfSuspendedObjects () const =0
 Query the number objects suspended after the most recent cycle. More...
 
virtual UInt32 GetRecentNumberOfAllocatedResourceBytes () const =0
 Query the total number of allocated resource bytes. More...
 
virtual void IncreaseNumberOfSuspendedObjects ()=0
 Increase the internal suspended object count by 1. More...
 
virtual void DecreaseNumberOfSuspendedObjects ()=0
 Decrease the internal suspended object count by 1. More...
 
virtual void IncreaseNumberOfAllocatedResourceBytes (UInt32 numBytes)=0
 Increase the internal number of allocated resource bytes. More...
 
virtual void DecreaseNumberOfAllocatedResourceBytes (UInt32 numBytes)=0
 Decrease the internal number of allocated resource bytes. More...
 
- Public Member Functions inherited from Murl::IFactoryObject< IRenderer >
virtual ~IFactoryObject ()
 The destructor. More...
 
virtual const ClassInfo * GetObjectClassInfo () const=0
 Get the object instance's class info, if present. More...
 
virtual void ResetObjectProperties ()=0
 Reset the object instance's properties to their default values.
 
- Public Member Functions inherited from Murl::Audio::IRendererRegistry
virtual Bool RegisterObjectClass (const IObject::ClassInfo &classInfo)=0
 Register an object class. More...
 
virtual Bool UnregisterObjectClass (const IObject::ClassInfo &classInfo)=0
 Unregister a previously registered object class. More...
 
virtual SInt32 GetRegisteredObjectClassInfoIndex (const IObject::ClassInfo &classInfo) const =0
 Query the index of a registered object class, by its ClassInfo structure. More...
 
virtual SInt32 GetRegisteredObjectClassInfoIndex (const String &className) const =0
 Query the index of a registered object class, by its class name. More...
 
virtual UInt32 GetNumberOfRegisteredObjectClassInfos () const =0
 Get the total number of registered object classes. More...
 
virtual const IObject::ClassInfo * GetRegisteredObjectClassInfo (UInt32 index) const =0
 Get the ClassInfo structure of a registered object class. More...
 

Additional Inherited Members

- Public Types inherited from Murl::IFactoryObject< IRenderer >
typedef Array< const ClassInfo *> ClassInfoArray
 Definition of an array of ClassInfo objects. More...
 
- Static Public Member Functions inherited from Murl::IFactoryObject< IRenderer >
static const PropertyInfoGetPropertyInfo ()
 Get the class' property info struct. More...
 
static const AttributeInfoGetAttributeInfo ()
 Get the class' attribute info struct. More...
 
static void ResetProperties (IFactoryObject< IRenderer > *object)
 Reset an object instance's properties to their default values. More...
 

Detailed Description

The Audio::IRenderer interface represents a generic audio renderer.

For most cases, an application does not need to directly interact with this interface. Instead, using audio-related nodes from the Murl::Graph Node Interfaces or Murl::Graph Node Classes sections is the preferred way to implement sound output functionality in a cross-platform manner.

Accessing the audio renderer interface directly may be useful in advanced use cases, when creating custom audio objects or even a complete custom renderer suite.

Member Function Documentation

◆ GetApi()

virtual IEnums::AudioApi Murl::Audio::IRenderer::GetApi ( ) const
pure virtual

Get the underlying audio API.

Returns
The used audio API.

◆ Init()

virtual Bool Murl::Audio::IRenderer::Init ( IEngine engine,
const IAppConfiguration appConfig,
IFeatureSet features,
IAudioInterface audioInterface 
)
pure virtual

Initialize the renderer.

Parameters
engineThe engine to attach to.
appConfigThe application configuration object.
featuresThe feature set to possibly update according to this renderer' capabilities.
audioInterfaceAn interface to the platform front end's audio interface for managing contexts etc.
Returns
true if successful.

◆ DeInit()

virtual Bool Murl::Audio::IRenderer::DeInit ( )
pure virtual

Deinitialize the renderer.

Returns
true if successful.

◆ Start()

virtual Bool Murl::Audio::IRenderer::Start ( )
pure virtual

Start the renderer after it has been initialized.

Returns
true if successful.

◆ Stop()

virtual Bool Murl::Audio::IRenderer::Stop ( )
pure virtual

Stop the renderer before it gets deinitialized.

Returns
true if successful.

◆ Pause()

virtual Bool Murl::Audio::IRenderer::Pause ( )
pure virtual

Pause the renderer if it is running.

Returns
true if successful.

◆ Continue()

virtual Bool Murl::Audio::IRenderer::Continue ( )
pure virtual

Continue the renderer if it is paused.

Returns
true if successful.

◆ Suspend()

virtual Bool Murl::Audio::IRenderer::Suspend ( )
pure virtual

Suspend the renderer.

Returns
true if successful.

◆ Resume()

virtual Bool Murl::Audio::IRenderer::Resume ( )
pure virtual

Resume the renderer.

Returns
true if successful.

◆ CreateObject()

virtual IObject* Murl::Audio::IRenderer::CreateObject ( const String className)
pure virtual

Create a renderer object.

Parameters
classNameThe class name of the renderer object to create.
Returns
The newly created object, or null if failed.

◆ DestroyObject()

virtual Bool Murl::Audio::IRenderer::DestroyObject ( IObject *&  object)
pure virtual

Destroy an object that was created by this renderer.

Parameters
objectA reference to a pointer containing the object to destroy.
Returns
true if successful.

◆ BeginSubmission()

virtual Bool Murl::Audio::IRenderer::BeginSubmission ( )
pure virtual

Begin submission of renderer objects for the next frame.

Any calls to SetCurrentListener() and SetCurrentTransform(), as well as PushObjectForUpdate() and PushObjectForRendering() must happen between a call to this method and the corresponding EndSubmission() call.

Returns
true if successful.

◆ EndSubmission()

virtual Bool Murl::Audio::IRenderer::EndSubmission ( )
pure virtual

End submission of renderer objects for the next frame.

Returns
true if successful.

◆ BeginRendering()

virtual Bool Murl::Audio::IRenderer::BeginRendering ( Bool  triggerSuspend)
pure virtual

Start the actual rendering process after all current objects have been submitted.

Parameters
triggerSuspendIf true, all objects registered for manual resource suspension are triggered to release any resources that are not currently needed.
Returns
true if successful.

◆ EndRendering()

virtual Bool Murl::Audio::IRenderer::EndRendering ( )
pure virtual

Wait for the current rendering process to complete, after calling BeginRendering().

Returns
true if successful.

◆ RegisterRenderThread()

virtual Bool Murl::Audio::IRenderer::RegisterRenderThread ( UInt64  threadId)
pure virtual

Register a render (main) thread with the renderer.

Parameters
threadIdThe thread ID of the main thread.
Returns
true if successful.

◆ RegisterLogicThread()

virtual Bool Murl::Audio::IRenderer::RegisterLogicThread ( UInt64  threadId)
pure virtual

Register a logic processing thread with the renderer.

Parameters
threadIdThe thread ID of the logic thread.
Returns
true if successful.

◆ RegisterLoaderThread()

virtual Bool Murl::Audio::IRenderer::RegisterLoaderThread ( UInt64  threadId)
pure virtual

Register a background loader thread with the renderer.

Parameters
threadIdThe thread ID of the loader thread.
Returns
true if successful.

◆ UnregisterRenderThread()

virtual Bool Murl::Audio::IRenderer::UnregisterRenderThread ( UInt64  threadId)
pure virtual

Unregister a render (main) thread from the renderer.

Parameters
threadIdThe thread ID of the main thread.
Returns
true if successful.

◆ UnregisterLogicThread()

virtual Bool Murl::Audio::IRenderer::UnregisterLogicThread ( UInt64  threadId)
pure virtual

Unregister a logic processing thread from the renderer.

Parameters
threadIdThe thread ID of the logic thread.
Returns
true if successful.

◆ UnregisterLoaderThread()

virtual Bool Murl::Audio::IRenderer::UnregisterLoaderThread ( UInt64  threadId)
pure virtual

Unregister a background loader thread from the renderer.

Parameters
threadIdThe thread ID of the loader thread.
Returns
true if successful.

◆ RegisterAutomaticallySuspendableObject()

virtual Bool Murl::Audio::IRenderer::RegisterAutomaticallySuspendableObject ( IObject object)
pure virtual

Register an object for automatic resource suspension.

Parameters
objectThe object to register.
Returns
true if successful.

◆ UnregisterAutomaticallySuspendableObject()

virtual Bool Murl::Audio::IRenderer::UnregisterAutomaticallySuspendableObject ( IObject object)
pure virtual

Unregister an object from automatic resource suspension.

Parameters
objectThe object to unregister.
Returns
true if successful.

◆ RegisterManuallySuspendableObject()

virtual Bool Murl::Audio::IRenderer::RegisterManuallySuspendableObject ( IObject object)
pure virtual

Register an object for manual resource suspension.

Parameters
objectThe object to register.
Returns
true if successful.

◆ UnregisterManuallySuspendableObject()

virtual Bool Murl::Audio::IRenderer::UnregisterManuallySuspendableObject ( IObject object)
pure virtual

Unregister an object from manual resource suspension.

Parameters
objectThe object to unregister.
Returns
true if successful.

◆ SetCurrentListener()

virtual void Murl::Audio::IRenderer::SetCurrentListener ( IListener listener)
pure virtual

Set the current listener affecting subsequent playables.

This method must only be called between BeginSubmission() and EndSubmission().

Parameters
listenerThe listener to set.

◆ SetCurrentTransform()

virtual void Murl::Audio::IRenderer::SetCurrentTransform ( const Matrix transform)
pure virtual

Set the current world transform affecting subsequent playables.

This method must only be called between BeginSubmission() and EndSubmission().

Parameters
transformThe world transform to set.

◆ PushObjectForUpdate()

virtual void Murl::Audio::IRenderer::PushObjectForUpdate ( IObject object,
Real  localTime = 0.0 
)
pure virtual

Queue up an object for updating.

This method must only be called between BeginSubmission() and EndSubmission().

Parameters
objectThe object to queue up.
localTimeThe time stamp.

◆ PushObjectForRendering()

virtual void Murl::Audio::IRenderer::PushObjectForRendering ( IPlayable object,
Real  localTime 
)
pure virtual

Queue up a playable object for rendering.

This method must only be called between BeginSubmission() and EndSubmission().

Parameters
objectThe playable object to queue up.
localTimeThe time stamp.

◆ GetRecentNumberOfObjectsRendered()

virtual UInt32 Murl::Audio::IRenderer::GetRecentNumberOfObjectsRendered ( ) const
pure virtual

Query the number of most recently rendered objects.

Must be called after EndRendering().

Returns
The number of objects renderered.

◆ GetRecentNumberOfBatchesRendered()

virtual UInt32 Murl::Audio::IRenderer::GetRecentNumberOfBatchesRendered ( ) const
pure virtual

Query the number of most recently rendered object batches.

Must be called after EndRendering().

Returns
The number of batches renderered.

◆ GetRecentNumberOfSuspendedObjects()

virtual UInt32 Murl::Audio::IRenderer::GetRecentNumberOfSuspendedObjects ( ) const
pure virtual

Query the number objects suspended after the most recent cycle.

Must be called after EndRendering().

Returns
The number of suspended objects.

◆ GetRecentNumberOfAllocatedResourceBytes()

virtual UInt32 Murl::Audio::IRenderer::GetRecentNumberOfAllocatedResourceBytes ( ) const
pure virtual

Query the total number of allocated resource bytes.

Must be called after EndRendering().

Returns
The number of allocated bytes.

◆ IncreaseNumberOfSuspendedObjects()

virtual void Murl::Audio::IRenderer::IncreaseNumberOfSuspendedObjects ( )
pure virtual

Increase the internal suspended object count by 1.

Called by an object entering the suspended state.

◆ DecreaseNumberOfSuspendedObjects()

virtual void Murl::Audio::IRenderer::DecreaseNumberOfSuspendedObjects ( )
pure virtual

Decrease the internal suspended object count by 1.

Called by an object leaving the suspended state.

◆ IncreaseNumberOfAllocatedResourceBytes()

virtual void Murl::Audio::IRenderer::IncreaseNumberOfAllocatedResourceBytes ( UInt32  numBytes)
pure virtual

Increase the internal number of allocated resource bytes.

Called by an object whenever it allocates a new memory resource.

Parameters
numBytesThe number of newly allocated bytes.

◆ DecreaseNumberOfAllocatedResourceBytes()

virtual void Murl::Audio::IRenderer::DecreaseNumberOfAllocatedResourceBytes ( UInt32  numBytes)
pure virtual

Decrease the internal number of allocated resource bytes.

Called by an object whenever it releases a memory resource.

Parameters
numBytesThe number of freed bytes.

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


Copyright © 2011-2018 Spraylight GmbH.