Murl Engine Lua Addon API  Version 1.0 beta
Murl.Logic.GraphSoundObject

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>


Table members

Functions


Murl.Logic.GraphSoundObject.new()

Create a GraphSoundObject object. The default master volume is 1.0.

Murl.SharedPointer.LogicGraphSoundObject new()

Returns
Murl.SharedPointer.LogicGraphSoundObject The GraphSoundObject shared pointer.

Murl.Logic.GraphSoundObject.new(masterVolume)

Create a GraphSoundObject object with a given master volume.

Murl.SharedPointer.LogicGraphSoundObject new(Number masterVolume)

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

Murl.Logic.GraphSoundObject.Create()

Create a GraphSoundObject object. The default master volume is 1.0.

Murl.SharedPointer.LogicGraphSoundObject Create()

Returns
Murl.SharedPointer.LogicGraphSoundObject The GraphSoundObject shared pointer.

Murl.Logic.GraphSoundObject.Create(masterVolume)

Create a GraphSoundObject object with a given master volume.

Murl.SharedPointer.LogicGraphSoundObject Create(Number masterVolume)

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


Methods


Init(nodeObserver, namespaceNode, timelinePath, sequencePath, index)

Initialize the object.

Boolean Init(Murl.Logic.INodeObserver nodeObserver, Murl.Graph.INamespace namespaceNode, String timelinePath, String sequencePath, Integer index)

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
Boolean true if successful.

Init(nodeObserver, root, timelinePath, sequencePath, index)

Initialize the object.

Boolean Init(Murl.Logic.INodeObserver nodeObserver, Murl.Graph.IRoot root, String timelinePath, String sequencePath, Integer index)

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
Boolean true if successful.

DeInit()

Deinitialize the object.

Boolean DeInit()

Returns
Boolean true if successful.

StartPlaying(startTime)

Start playing the sound.

Boolean StartPlaying(Number startTime)

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

StartPlaying(startTime, endTime)

Start playing the sound.

Boolean StartPlaying(Number startTime, Number endTime)

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

IsPlaying()

Check if the sound is playing.

Boolean IsPlaying()

Returns
Boolean true if the sound is playing.

PausePlaying()

Pause playing the sound.

Boolean PausePlaying()

Returns
Boolean true successful.

ContinuePlaying()

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

Boolean ContinuePlaying()

Returns
Boolean true successful.

StopPlaying()

Stop playing the sound.

Boolean StopPlaying()

Returns
Boolean true successful.

SetVolume(volume)

Set the sound volume. The sound volume is multiplied by the master volume.

SetVolume(Number volume)

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

SetMasterVolume(volume)

Set the master volume.

SetMasterVolume(Number volume)

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

GetMasterVolume()

Get the master volume.

Number GetMasterVolume()

Returns
Number The master volume.


Instance Members


mTimelineNode

The timeline node reference.

Returns
Murl.Logic.GraphNodeT.GraphITimeline

mAudioSequenceNode

The audio sequence node reference.

Returns
Murl.Logic.GraphNodeT.GraphIAudioSequence