Module:BackgroundMusic

From PanoZona

Contents

BackgroundMusic
Author Marek Standio
Module version 1.2
Compatibility SaladoPlayer 1.0 +

BackgroundMusic is simple module for playing music in background. You can easily asign different sound files to be played in different panoramas, module can also cooperate with other modules such like ButtonBar or ImageButton.


Configuration structure

Configuration details

BackgroundMusic

Attribute TypeSub-attribute TypeDefaultValuesDescription
path S - - path to swf file Mandatory attribute. Value points to module swf file.

settings

Attribute TypeSub-attribute TypeDefaultValuesDescription
play B - false true, false Determines if current track is played whenever module is loaded.
onPlay S - - action id Action executed when music starts playing.
onStop S - - action id Action executed when music stops playing.

track

Attribute TypeSub-attribute TypeDefaultValuesDescription
id S - - - Mandatory attribute. Id of track, must be unique among other tracks.
path S - - path to sound file Mandatory attribute. Points to *.mp3 file used by given track.
volume N - 1.0 0.0 to 1.0 Volume of played sound file.
loop B - true true, false Determines if sound file is repeated after it finishes playing.
next S - - track id If track loop attribute is set to false you can determine which track is played when given track finishes playing.

sound

Attribute TypeSub-attribute TypeDefaultValuesDescription
id S - - - Mandatory attribute. Id of sound, must be unique among other sounds.
path S - - path to sound file Mandatory attribute. Points to *.mp3 file used by given track.
volume N - 1.0 0.0 to 1.0 Volume of played sound file.

Functions

setTrack

TypeDescriptionFunction description
S track id Function is used to set "current" track. If music is playing, changing track results in playing different sound file. If music is stopped, setting track changes sound file that will be played when users starts playing music. By default first track in configuration is used as "current" track.

setPlay

TypeDescriptionFunction description
B value Function is used for stopping and starting playing "current" track.

togglePlay

TypeDescriptionFunction description
- - If music is playing, calling this functions stops it. Similarly, when music is stopped, calling this function starts playing "current" track.

playSound

TypeDescriptionFunction description
S sound id Function is used to play single sound of given id.