Murl Engine API  Version 2018.3
Murl::Logic::GraphSoundObject Class Reference

Class handling the play state and volume of a Graph::ITimelineNode which is enclosing a Graph::IAudioSequenceNode node. More...

#include <murl_logic_graph_sound_object.h>

Detailed Description

Class handling the play state and volume of a Graph::ITimelineNode which is enclosing a Graph::IAudioSequenceNode node.

e.g.

<Graph numberOfLoops="0" volume="1.0">
<Namespace id="{soundId}">
<Timeline id="timeline" autoRewind="yes" numberOfLoops="{numberOfLoops}">
<AudioSource id="sound" audioResourceId="{package}:{soundId}"/>
<AudioSequence id="sequence" audioSourceIds="sound" volume="{volume}"/>
</Timeline>
</Namespace>
</Graph>
Inheritance diagram for Murl::Logic::GraphSoundObject:
Murl::Logic::GraphSoundInstance

Public Member Functions

 GraphSoundObject ()
 The default constructor. More...
 
 GraphSoundObject (Real masterVolume)
 Constructor taking a master volume. More...
 
virtual ~GraphSoundObject ()
 The destructor.
 
virtual Bool Init (INodeObserver *nodeObserver, const Graph::IRoot *root, const String &timelinePath, const String &sequencePath, SInt32 index)
 Initialize the object. More...
 
virtual Bool Init (INodeObserver *nodeObserver, Graph::INamespace *namespaceNode, const String &timelinePath, const String &sequencePath, SInt32 index)
 Initialize the object. More...
 
virtual Bool DeInit ()
 Deinitialize the object. More...
 
virtual Bool StartPlaying (Real startTime=0)
 Start playing the sound. More...
 
virtual Bool StartPlaying (Real startTime, Real endTime)
 Start playing the sound. More...
 
virtual Bool IsPlaying () const
 Check if the sound is playing. More...
 
virtual Bool PausePlaying ()
 Pause playing the sound. More...
 
virtual Bool ContinuePlaying ()
 Continue playing the sound. More...
 
virtual Bool StopPlaying ()
 Stop playing the sound. More...
 
virtual void SetVolume (Real volume)
 Set the sound volume. More...
 
virtual void SetMasterVolume (Real volume)
 Set the master volume. More...
 
virtual Real GetMasterVolume () const
 Get the master volume. More...
 

Static Public Member Functions

static GraphSoundObjectPtr Create ()
 Create a GraphSoundObject object. More...
 
static GraphSoundObjectPtr Create (Real masterVolume)
 Create a GraphSoundObject object with a given master volume. More...
 

Public Attributes

TimelineNode mTimelineNode
 The timeline node reference. More...
 
AudioSequenceNode mAudioSequenceNode
 The audio sequence node reference. More...
 

Constructor & Destructor Documentation

◆ GraphSoundObject() [1/2]

Murl::Logic::GraphSoundObject::GraphSoundObject ( )
inline

The default constructor.

The default master volume is 1.0.

◆ GraphSoundObject() [2/2]

Murl::Logic::GraphSoundObject::GraphSoundObject ( Real  masterVolume)
inline

Constructor taking a master volume.

Parameters
masterVolumeThe master volume in range [0.0 .. 1.0].

Member Function Documentation

◆ Create() [1/2]

static GraphSoundObjectPtr Murl::Logic::GraphSoundObject::Create ( )
inlinestatic

Create a GraphSoundObject object.

The default master volume is 1.0.

Returns
The GraphSoundObject shared pointer.

◆ Create() [2/2]

static GraphSoundObjectPtr Murl::Logic::GraphSoundObject::Create ( Real  masterVolume)
inlinestatic

Create a GraphSoundObject object with a given master volume.

Parameters
masterVolumeThe master volume in range [0.0 .. 1.0].
Returns
The GraphSoundObject shared pointer.

◆ Init() [1/2]

virtual Bool Murl::Logic::GraphSoundObject::Init ( INodeObserver nodeObserver,
const Graph::IRoot root,
const String timelinePath,
const String sequencePath,
SInt32  index 
)
inlinevirtual

Initialize the object.

Parameters
nodeObserverThe INodeObserver object.
rootThe graph root node.
timelinePathThe full path to the graph timeline node instance.
sequencePathThe full path to the graph audio sequence node instance.
indexThe index of the instance.
Returns
true if successful.

◆ Init() [2/2]

virtual Bool Murl::Logic::GraphSoundObject::Init ( INodeObserver nodeObserver,
Graph::INamespace namespaceNode,
const String timelinePath,
const String sequencePath,
SInt32  index 
)
inlinevirtual

Initialize the object.

Parameters
nodeObserverThe INodeObserver object.
namespaceNodeThe graph namespace node.
timelinePathThe relative path to the graph timeline node instance.
sequencePathThe relative path to the graph audio sequence node instance.
indexThe index of the instance.
Returns
true if successful.

◆ DeInit()

virtual Bool Murl::Logic::GraphSoundObject::DeInit ( )
inlinevirtual

Deinitialize the object.

Returns
true if successful.

Reimplemented in Murl::Logic::GraphSoundInstance.

◆ StartPlaying() [1/2]

virtual Bool Murl::Logic::GraphSoundObject::StartPlaying ( Real  startTime = 0)
inlinevirtual

Start playing the sound.

Parameters
startTimeThe start time in seconds.
Returns
true if successful.

◆ StartPlaying() [2/2]

virtual Bool Murl::Logic::GraphSoundObject::StartPlaying ( Real  startTime,
Real  endTime 
)
inlinevirtual

Start playing the sound.

Parameters
startTimeThe start time in seconds.
endTimeThe end time in seconds.
Returns
true if successful.

◆ IsPlaying()

virtual Bool Murl::Logic::GraphSoundObject::IsPlaying ( ) const
inlinevirtual

Check if the sound is playing.

Returns
true if the sound is playing.

◆ PausePlaying()

virtual Bool Murl::Logic::GraphSoundObject::PausePlaying ( )
inlinevirtual

Pause playing the sound.

Returns
true successful.

◆ ContinuePlaying()

virtual Bool Murl::Logic::GraphSoundObject::ContinuePlaying ( )
inlinevirtual

Continue playing the sound.

Continue if the sound is paused, otherwise start the sound.

Returns
true successful.

◆ StopPlaying()

virtual Bool Murl::Logic::GraphSoundObject::StopPlaying ( )
inlinevirtual

Stop playing the sound.

Returns
true successful.

◆ SetVolume()

virtual void Murl::Logic::GraphSoundObject::SetVolume ( Real  volume)
inlinevirtual

Set the sound volume.

The sound volume is multiplied by the master volume.

Parameters
volumeThe volume in range [0.0 .. 1.0].

◆ SetMasterVolume()

virtual void Murl::Logic::GraphSoundObject::SetMasterVolume ( Real  volume)
inlinevirtual

Set the master volume.

Parameters
volumeThe master volume in range [0.0 .. 1.0].

◆ GetMasterVolume()

virtual Real Murl::Logic::GraphSoundObject::GetMasterVolume ( ) const
inlinevirtual

Get the master volume.

Returns
The master volume.

Member Data Documentation

◆ mTimelineNode

TimelineNode Murl::Logic::GraphSoundObject::mTimelineNode

The timeline node reference.

◆ mAudioSequenceNode

AudioSequenceNode Murl::Logic::GraphSoundObject::mAudioSequenceNode

The audio sequence node reference.


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