OverviewSingleDeprecatedPropertiesEventsXSL Parameters

jsx3.gui

class Sound

Object
->jsx3.lang.Object
  ->jsx3.app.Model
    ->jsx3.gui.Painted
      ->jsx3.gui.Sound

All Implemented Interfaces:

jsx3.gui.Interactive, jsx3.util.EventDispatcher

class Sound
extends jsx3.gui.Painted
Class that provides an object-oriented interface for playing sounds in a GI application.

Note that playing sounds in Internet Explorer requires a plug-in. This class currently supports the following sound plug-ins: The installed plug-ins determine which sound file formats are supported.

Since:

3.1

Field Summary
static void
QUICKTIME
Apple Quicktime sound plugin type.
Constructor Summary
void
init(strName : String, strURL : String)
The instance initializer.
Method Summary
float
Returns the length of the sound in seconds.
String
Returns the full name and version number of the audio plugin used to play this sound.
float
Returns the current position (elapsed time) of the sound in seconds.
String
Returns the URL of the sound file.
int
Returns the volume that the sound plays at.
String
Paints the container for the sound.
void
Pauses the sound.
void
Plays the sound.
void
Stops and rewinds the sound.
void
setPosition(position : float)
Sets the current position (elapsed time) of the sound in seconds.
jsx3.gui.Sound
setURL(strURL : String)
Sets the URL of the sound file.
jsx3.gui.Sound
setVolume(intVolume : int)
Sets the volume of this sound.
Methods Inherited From jsx3.gui.Interactive
doEvent, getCanDrag, getCanDrop, getCanMove, getCanSpy, getEvent, getEvents, getMenu, hasEvent, registerHotKey, removeEvent, removeEvents, setCanDrag, setCanDrop, setCanMove, setCanSpy, setEvent, setMenu, setSpyStyles, showSpy
Methods Inherited From jsx3.gui.Painted
focus, getAbsolutePosition, getAttribute, getAttributes, getRendered, insertHTML, onAfterPaint, onAfterRestoreView, paintChild, paintChildren, recalcBox, removeAttribute, removeAttributes, repaint, setAttribute
Methods Inherited From jsx3.app.Model
adoptChild, assembleFromXML, doClone, findAncestor, findDescendants, getAncestorOfName, getAncestorOfType, getChild, getChildIndex, getChildren, getDescendantOfName, getDescendantsOfType, getDynamicProperty, getFirstChild, getFirstChildOfType, getHelpId, getId, getLastChild, getLoadType, getMetaValue, getNS, getName, getNextSibling, getParent, getPersistence, getPreviousSibling, getServer, getUriResolver, insertBefore, load, loadAndCache, loadXML, onAfterAssemble, onAfterAttach, onBeforeAssemble, onChangeServer, onChildAdded, onDestroy, onRemoveChild, onSetChild, onSetParent, removeChild, removeChildren, selectDescendants, setChild, setDynamicProperty, setHelpId, setLoadType, setMetaValue, setName, setPersistence, toString, toXML, toXMLDoc, toXMLElm
Methods Inherited From jsx3.util.EventDispatcher
publish, subscribe, unsubscribe, unsubscribeAll
Methods Inherited From jsx3.lang.Object
clone, equals, eval, getClass, getInstanceOf, getInstanceOfClass, getInstanceOfPackage, instanceOf, isInstanceOf, isSubclassOf, jsxmix, jsxsuper, jsxsupermix, setInstanceOf
Field Detail

QUICKTIME

static ? QUICKTIME
Apple Quicktime sound plugin type.
Constructor Detail

init

void init(strName : String, strURL : String)
The instance initializer.

Parameters:

strNamethe JSX name
strURLthe URL of the sound file to play
Method Detail

getLength

float getLength()
Returns the length of the sound in seconds.

Returns:

the length in seconds or NaN if the length can not be determined  

getPluginVersion

String getPluginVersion()
Returns the full name and version number of the audio plugin used to play this sound.

Returns:

 

getPosition

float getPosition()
Returns the current position (elapsed time) of the sound in seconds.

Returns:

the current position in seconds or NaN if the position can not be determined  

getURL

String getURL()
Returns the URL of the sound file.

Returns:

the URL of the sound file to play  

getVolume

int getVolume()
Returns the volume that the sound plays at.

Returns:

the volume to play the sound at, [0,100]  

paint

String paint()
Paints the container for the sound.

Returns:

 

Overrides:

paint in jsx3.gui.Painted

pause

void pause()
Pauses the sound. Calling play() after calling pause() will play the sound from the point where it was paused.

play

void play()
Plays the sound.

rewind

void rewind()
Stops and rewinds the sound.

setPosition

void setPosition(position : float)
Sets the current position (elapsed time) of the sound in seconds.

Parameters:

positionthe new position in seconds

setURL

jsx3.gui.Sound setURL(strURL : String)
Sets the URL of the sound file.

Parameters:

strURLthe URL of the sound file to play

Returns:

this object  

setVolume

jsx3.gui.Sound setVolume(intVolume : int)
Sets the volume of this sound. The change takes effect immediately.

Parameters:

intVolumethe volume to play the sound at. 0 is mute, 100 is loudest

Returns:

this object