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"

Inheritance diagram for Murl::Logic::GraphSoundObject:

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.
 
AudioSequenceNode mAudioSequenceNode
 The audio sequence node reference.
 

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>

Constructor & Destructor Documentation

◆ GraphSoundObject() [1/2]

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

The default constructor.

The default master volume is 1.0.

Referenced by Create().

◆ 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.

References GraphSoundObject().

◆ 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.

References GraphSoundObject().

◆ 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.

References Murl::Graph::IRoot::GetRootNamespace().

Referenced by Murl::Logic::GraphSoundInstance::Init().

◆ 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.

References Murl::Logic::INodeObserver::Add(), Murl::Logic::GraphNodeT< NodeType >::GetReference(), Murl::Logic::GraphNodeT< NodeType >::IsValid(), mAudioSequenceNode, and mTimelineNode.

◆ DeInit()

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

Deinitialize the object.

Returns
true if successful.

Reimplemented in Murl::Logic::GraphSoundInstance.

References StopPlaying().

Referenced by Murl::Logic::GraphSoundInstance::DeInit().

◆ 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.

References Murl::Graph::IPlayable::GetTotalDuration(), Murl::Graph::IPlayable::IsEndlessLoopEnabled(), Murl::Logic::GraphNodeT< NodeType >::IsValid(), mAudioSequenceNode, mTimelineNode, and Murl::Graph::IRunnable::Start().

Referenced by ContinuePlaying().

◆ 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.

References Murl::Logic::GraphNodeT< NodeType >::IsValid(), mAudioSequenceNode, mTimelineNode, and Murl::Graph::IRunnable::Start().

◆ IsPlaying()

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

Check if the sound is playing.

Returns
true if the sound is playing.

References Murl::Graph::IRunnable::IsRunning(), Murl::Logic::GraphNodeT< NodeType >::IsValid(), and mTimelineNode.

◆ PausePlaying()

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

Pause playing the sound.

Returns
true successful.

References Murl::Logic::GraphNodeT< NodeType >::IsValid(), mTimelineNode, and Murl::Graph::IRunnable::Pause().

◆ 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.

References Murl::Graph::IRunnable::IsPaused(), Murl::Logic::GraphNodeT< NodeType >::IsValid(), mTimelineNode, Murl::Graph::IRunnable::Start(), and StartPlaying().

◆ StopPlaying()

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

◆ 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].

References Murl::Logic::GraphNodeT< NodeType >::IsValid(), mAudioSequenceNode, and Murl::Graph::IAudible::SetVolume().

◆ SetMasterVolume()

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

Set the master volume.

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

Referenced by Murl::Logic::GraphSoundInstance::OnReset().

◆ GetMasterVolume()

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

Get the master volume.

Returns
The master volume.

The documentation for this class was generated from the following file:
  • murl_logic_graph_sound_object.h


Copyright © 2011-2024 Spraylight GmbH.