EventSounds
Source: EventSounds.js:55
The EventSounds objects contains specific sounds to be played when JClic events are fired:
- start
- click
- actionError
- actionOk
- finishedError
- finishedOk
The sounds are stored in an array of EventSoundsElement objects.
Constructor
new EventSounds(
parent?: module:media/EventSounds.EventSounds,
): EventSoundsEventSounds constructor
Parameters
parent(module:media/EventSounds.EventSounds, optional) — Another EventSounds object that will act as a parent of this one,
used to resolve which sound must be played for events when not defined here.
Instance Methods
setProperties($xml: external:jQuery)
Reads the object properties from an XML element
Parameters
$xml(external:jQuery) — The XML element to be parsed
getAttributes(): object
Gets a object with the basic attributes needed to rebuild this instance excluding functions,
parent references, constants and also attributes retaining the default value.
The resulting object is commonly usued to serialize elements in JSON format.
Returns
object
setAttributes(
data: object,
): module:media/EventSounds.EventSounds
Reads the properties of this EventSounds from a data object
Parameters
data(object) — The data object to be parsed
Returns
realize(
ps: module:JClicPlayer.JClicPlayer,
mediaBag: module:bags/MediaBag.MediaBag,
)
Instantiates the audio objects needed to play event sounds
Parameters
ps(module:JClicPlayer.JClicPlayer)mediaBag(module:bags/MediaBag.MediaBag)
play(eventName: string)
Plays a specific event sound
Parameters
eventName(string) — The identifier of the event to be played
Instance Fields
elements: object
Collection of EventSoundsElement objects
enabled: number
Whether this event sounds are enabled or not
globalEnabled: boolean
This attribute is intended to be used at prototype level, to indicate a globally disabled
or enabled state.
Static Fields
MEDIA: object
Audio data for default event sounds