edu.uiuc.cs397rhc.game
Class MP3Mood

java.lang.Object
  extended by edu.uiuc.cs397rhc.game.Mood
      extended by edu.uiuc.cs397rhc.game.MP3Mood
All Implemented Interfaces:
Equalizable

public class MP3Mood
extends Mood

MP3Mood is a Mood that plays an MP3 file.

Author:
Pedro DeRose

Constructor Summary
MP3Mood(java.lang.String filename)
          Creates a new MP3Mood that will play the given MP3 file.
 
Method Summary
 void begin()
          Begins the music by fading it in.
 void end()
          Ends the music by fading it out.
 double getVolumePercentage()
          Gets the independent volume percentage of the object.
 boolean isActive()
          Whether the Mood is playing.
static void main(java.lang.String[] args)
           
 void setVolumePercentage(double percent)
          Sets the volume percentage of the object independently of other volume manipulations, such as fading.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MP3Mood

public MP3Mood(java.lang.String filename)
Creates a new MP3Mood that will play the given MP3 file.

Parameters:
filename - the MP3 file's name
Method Detail

isActive

public boolean isActive()
Description copied from class: Mood
Whether the Mood is playing.

Specified by:
isActive in class Mood
Returns:
true if playing, false otherwise

begin

public void begin()
Description copied from class: Mood
Begins the music by fading it in.

Specified by:
begin in class Mood

end

public void end()
Description copied from class: Mood
Ends the music by fading it out.

Specified by:
end in class Mood

setVolumePercentage

public void setVolumePercentage(double percent)
Description copied from interface: Equalizable
Sets the volume percentage of the object independently of other volume manipulations, such as fading.

Specified by:
setVolumePercentage in interface Equalizable
Specified by:
setVolumePercentage in class Mood
Parameters:
percent - the new volume percentage

getVolumePercentage

public double getVolumePercentage()
Description copied from interface: Equalizable
Gets the independent volume percentage of the object.

Specified by:
getVolumePercentage in interface Equalizable
Specified by:
getVolumePercentage in class Mood
Returns:
the volume percentage

main

public static void main(java.lang.String[] args)