media/EventSounds. EventSounds

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(parentopt)

EventSounds constructor

Parameters:
NameTypeAttributesDescription
parentmodule: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.

Members

elements :object

Collection of EventSoundsElement objects

Type:
  • object

enabled :number

Whether this event sounds are enabled or not

Type:
  • number

globalEnabled :boolean

This attribute is intended to be used at prototype level, to indicate a globally disabled
or enabled state.

Type:
  • boolean

(static) MEDIA :object

Audio data for default event sounds

Type:
  • object

Methods

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:
  • The resulting object, with minimal attrributes
Type: 
object

play(eventName)

Plays a specific event sound

Parameters:
NameTypeDescription
eventNamestring

The identifier of the event to be played

realize(ps, mediaBag)

Instantiates the audio objects needed to play event sounds

Parameters:
NameTypeDescription
psmodule:JClicPlayer.JClicPlayer
mediaBagmodule:bags/MediaBag.MediaBag

setAttributes(data) → {module:media/EventSounds.EventSounds}

Reads the properties of this EventSounds from a data object

Parameters:
NameTypeDescription
dataobject

The data object to be parsed

setProperties($xml)

Reads the object properties from an XML element

Parameters:
NameTypeDescription
$xmlexternal:jQuery

The XML element to be parsed