|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.uiuc.cs397rhc.sound.FadeHelper
FadeHelper is a encapsulation of a general fading procedure that
can be applied to any Fadeable object. To do so, it keeps track
of a local multiplier which it expects will be respected by the
Fadeable object when updateVolume() is called.
| Constructor Summary | |
|---|---|
FadeHelper(Fadeable fadeable)
Creates a new FadeHelper that can be used to fade the volume
on the given Fadeable. |
|
| Method Summary | |
|---|---|
void |
fade(double targetMultiplier)
Fade from the current multiplier to the target multiplier, over Fadeable's default duration and with
Fadeable's default interval between volume changes. |
void |
fade(double targetMultiplier,
long duration)
Fade from the current multiplier to the target multiplier, over the given duration and with Fadeable's default interval
between volume changes. |
void |
fade(double targetMultiplier,
long duration,
int steps)
Fade from the current multiplier to the target multiplier, over the given duration and in the given number of steps. |
double |
getFadeMultiplier()
Returns the current multiplier kept by this FadeHelper. |
boolean |
isFading()
Whether a fade is in progress. |
void |
setFadeMultiplier(double multiplier)
Sets the current multiplier kept by this FadeHelper. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FadeHelper(Fadeable fadeable)
FadeHelper that can be used to fade the volume
on the given Fadeable.
fadeable - the object whose volume is to be faded| Method Detail |
|---|
public double getFadeMultiplier()
FadeHelper. Fading only works if the Fadeable
object respects this multiplier when updateVolume() is
called.
public void setFadeMultiplier(double multiplier)
FadeHelper.
Fading only works if the Fadeable object respects this
multiplier when updateVolume() is called.
multiplier - the new multiplierpublic boolean isFading()
true if a fade is in progress, false
otherwisepublic void fade(double targetMultiplier)
Fadeable's default duration and with
Fadeable's default interval between volume changes. Fading is
done by modifying the local multiplier, then calling the
Fadeable object's updateVolume(), which is
expected to respect the local multiplier.
targetMultiplier - the target multiplier after the fade
public void fade(double targetMultiplier,
long duration)
Fadeable's default interval
between volume changes. Fading is done by modifying the local
multiplier, then calling the Fadeable object's
updateVolume(), which is expected to respect the local
multiplier.
targetMultiplier - the target multiplier after the fadeduration - the duration of the fade in milliseconds
public void fade(double targetMultiplier,
long duration,
int steps)
Fadeable object's updateVolume(), which is
expected to respect the local multiplier.
targetMultiplier - the target multiplier after the fadeduration - the duration of the fade in millisecondssteps - the number of volume changes during the fade
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||