wyvern.lib.properties
Class Soundtrack

java.lang.Object
  extended bywyvern.kernel.properties.PList
      extended bywyvern.kernel.maps.MapObject
          extended bywyvern.lib.properties.Soundtrack
All Implemented Interfaces:
Alert, Broadcaster, GameObject, MethodHookable, Music, PropertyList

public class Soundtrack
extends MapObject
implements Music

Default implementation for the wyvern.lib.Music interface. Configurable via various properties, it can also be placed in a standalone archetype file and referenced in the "music" property of a map.

Version:
1.0, Jul 24, 2003
Author:
Steve Yegge

Field Summary
static double DEFAULT_GAIN
           
 
Fields inherited from class wyvern.kernel.maps.MapObject
IN_MAP_EDITOR, listenerList_
 
Fields inherited from class wyvern.kernel.properties.PList
readOnly_
 
Fields inherited from interface wyvern.lib.Music
DEFAULT_COMBAT_MUSIC, DEFAULT_FUNERAL_MUSIC, DEFAULT_LEVELUP_MUSIC, DEFAULT_LOW_HP_COMBAT_MUSIC, DEFAULT_REPEAT_DELAY, DEFAULT_REPEATS, LOOP_FOREVER, PRIORITY_HIGH, PRIORITY_NORMAL
 
Fields inherited from interface wyvern.lib.PropertyList
PROPERTY_PACKAGE
 
Constructor Summary
Soundtrack()
          No-arg constructor required for bean properties.
Soundtrack(java.lang.String path)
          Constructs a new Soundtrack
 
Method Summary
 double getGain()
          Returns the sound volume, from 0.0 to 1.0.
 java.lang.String getPath()
          Returns the relative path, including extension, for the music for this soundtrack.
 int getRepeatDelay()
          Returns number of millis to wait between repeats.
 int getRepeats()
          Returns number of repeats. 0 means only play once.
 void initialize()
          Initialize() method, called (for GameObject bean properties) after instantiating the property, and cloning it if it's a MutableProperty, but before it's added to the destination PropertyList.
 void setGain(double gain)
          Sets the sound gain (volume) from 0.0 to 1.0.
 void setPath(java.lang.String path)
          Sets the path.
 void setRepeatDelay(int delay)
          Sets delay in millis between repeats.
 void setRepeats(int repeats)
          Sets the number of repeats to play before stopping.
 java.lang.String toString()
          Returns debugging string.
 
Methods inherited from class wyvern.kernel.maps.MapObject
addContainerChangeListener, addDefaultProperty, addMapChangeListener, addMapMotionListener, addMethodHook, addMotionTracker, addObjectTracker, addPrefix, addSuffix, addToMap, bless, broadcast, broadcast, broadcast, broadcast, broadcast, canEnter, canEnterBlockedBy, canMove, canMove, canMoveBlockedBy, canMoveBlockedBy, canMoveTo, canMoveToBlockedBy, checkDrop, curse, cycleFrame, destroy, ensureListenerList, ensureWeight, externalize, fireContainerEntered, fireContainerExited, fireEnteredMap, fireExitedMap, fireMovedInMap, getAlpha, getAppearance, getArchetype, getBaseName, getBaseWeight, getBitmap, getBounds, getCanonicalClassName, getCategory, getContainer, getCreator, getDamagedDescription, getDescription, getDirection, getGenderPossessive, getGenderPronoun, getImage, getImageDescriptor, getImageDescriptors, getLayer, getLocations, getMap, getMapLink, getMaterial, getMaterialDescription, getMover, getOwningPlayer, getParentMap, getPrefixes, getQuantity, getReferenceLoc, getRelativeLocs, getShortDesc, getSuffixes, getTile, getTile, getValue, getWeight, groupString, inContainer, initLocs, inMapEditor, invalidate, invalidateImage, invalidateParent, invalidateText, isAnimated, isAttackable, isBlessed, isCommandable, isCursed, isDamned, isGroupable, isIdentified, isMonster, isMonsterOrPlayer, isPlayer, isTerrain, isUncursed, isUnpaid, isWizard, makeClone, markPaid, markUnpaid, move, occupies, positionAt, positionAtMap, remove, removeContainerChangeListener, removeFromMap, removeMapChangeListener, removeMapMotionListener, removeMethodHook, removeMotionTracker, removeObjectTracker, removePrefix, removeSuffix, runMethodHook, setAlpha, setAnimated, setBitmap, setCategory, setContainer, setDefaultBitmap, setDefaultCategory, setDefaultDesc, setDefaultImage, setDefaultIntProperty, setDefaultLayer, setDefaultMaterial, setDefaultProperty, setDefaultShortDesc, setDirection, setImage, setImage, setLayer, setLocations, setMap, setMapLink, setQuantity, setShape, setSize, setTransientSize, setWeight, setWeight, teleport, updateMapLocation
 
Methods inherited from class wyvern.kernel.properties.PList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, debugProperties, dismantlePropertyList, getDoubleProperty, getInheritedProperty, getInteger, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProfilingInfo, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, transientlyRemoveProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface wyvern.lib.PropertyList
addProperty, addTransientProperty, adjustDoubleProperty, adjustIntProperty, adjustLongProperty, adjustTransientDoubleProperty, adjustTransientIntProperty, adjustTransientLongProperty, countLocalProperties, getDoubleProperty, getInheritedProperty, getIntProperty, getLocalProperties, getLocalProperty, getLongProperty, getParent, getPersistentDoubleProperty, getPersistentIntProperty, getPersistentLocalProperties, getPersistentLongProperty, getPersistentProperty, getProperties, getProperties, getPropertiesIncludingTransients, getPropertiesIncludingTransients, getProperty, getSerializableProperties, getSerializableProperty, getStringProperty, getTransientDoubleProperty, getTransientIntProperty, getTransientLongProperty, getTransientProperties, getTransientProperty, hasLocalProperty, hasPersistentProperty, hasProperty, hasTransientProperty, inheritProperty, isReadOnly, isRemoved, isTransientlyRemoved, printLocalProperties, printProperties, printProperties, printTransientProperties, removeProperty, removeTransientProperty, setDoubleProperty, setIntProperty, setLongProperty, setParent, setProperty, setReadOnly, setTransientDoubleProperty, setTransientIntProperty, setTransientLongProperty, setTransientProperty, toString, transientlyRemoveProperty
 

Field Detail

DEFAULT_GAIN

public static final double DEFAULT_GAIN
See Also:
Constant Field Values
Constructor Detail

Soundtrack

public Soundtrack()
No-arg constructor required for bean properties.


Soundtrack

public Soundtrack(java.lang.String path)
Constructs a new Soundtrack

Method Detail

initialize

public void initialize()
Initialize() method, called (for GameObject bean properties) after instantiating the property, and cloning it if it's a MutableProperty, but before it's added to the destination PropertyList. All of the bean's sub-properties will have been set by the time initialize() is called.

If the user didn't specify a gain, use the default.

Specified by:
initialize in interface GameObject
Overrides:
initialize in class MapObject

getPath

public java.lang.String getPath()
Returns the relative path, including extension, for the music for this soundtrack.

Specified by:
getPath in interface Alert
Returns:
the relative file path

setPath

public void setPath(java.lang.String path)
Sets the path. Called by javabean system.

Specified by:
setPath in interface Alert
Parameters:
path - relative path to the sound file, e.g. "wiz/foobar/sounds/mysound.ogg"

getRepeats

public int getRepeats()
Returns number of repeats. 0 means only play once. Negative means loop forever until stopped explicitly.

Specified by:
getRepeats in interface Music
Returns:
num repeats.

setRepeats

public void setRepeats(int repeats)
Sets the number of repeats to play before stopping.

Specified by:
setRepeats in interface Music
Parameters:
repeats -

getGain

public double getGain()
Returns the sound volume, from 0.0 to 1.0.

Specified by:
getGain in interface Alert
Returns:
the gain (volume)

setGain

public void setGain(double gain)
Sets the sound gain (volume) from 0.0 to 1.0.

Specified by:
setGain in interface Alert
Parameters:
gain - the new gain, 0.0 is off, 1.0 is max volume

getRepeatDelay

public int getRepeatDelay()
Returns number of millis to wait between repeats.

Specified by:
getRepeatDelay in interface Music
Returns:
number of milliseconds to wait. zero or negative means don't wait.

setRepeatDelay

public void setRepeatDelay(int delay)
Sets delay in millis between repeats.

Specified by:
setRepeatDelay in interface Music
Parameters:
delay - delay in millis between repeats
Returns:
the delay between repeats, if it's cycling

toString

public java.lang.String toString()
Returns debugging string.

Overrides:
toString in class MapObject
Returns:
a short String describing this object. If the object represents a group of items, such as coins, the returned description will be a modified version of the description that includes quantity information.