|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.uiuc.cs397rhc.game.Groove
A Groove is a MIDI piece that is faded in, played for a few
seconds, then faded out in response to game events. It is divided up into an
Instrumentation for each team. When activated, it is told which
team has activated it, and will fade in, play, and fade out only the parts
assigned to that particular team. A team's part will continue to play so long
as that team continues to activate the ability before the set duration period
since the last activation has elapsed. Grooves can also be
assigned a master Groove. This will guarantee that, right before
playing, the Groove is synchronized with the position of its
master.
| Field Summary | |
|---|---|
static int |
DEFAULT_DURATION
The default duration of play after an activation. |
| Constructor Summary | |
|---|---|
Groove(java.lang.String filename,
java.util.EnumMap<GameUtils.Team,Instrumentation> teamParts)
Creates a Groove for the given file and with the given
Instrumentations. |
|
Groove(java.lang.String filename,
int duration,
java.util.EnumMap<GameUtils.Team,Instrumentation> teamToPart)
Creates a Groove for the given file and with the given
Instrumentations, which will play for the given duration
when activated. |
|
| Method Summary | |
|---|---|
void |
activate(GameUtils.Team team)
Activates the part associated with the given team for the default duration. |
void |
activate(GameUtils.Team team,
int duration)
Activates the part associated with the given team for the given duration. |
void |
deactivate(GameUtils.Team team)
Deactivates the part associated with the given team. |
java.util.Set<GameUtils.Team> |
getTeamSet()
The number of teams for which parts have been assigned. |
protected javax.sound.midi.Transmitter |
getTransmitter()
The transmitter that is attached to the synthesizer. |
double |
getVolumePercentage()
Gets the independent volume percentage of the object. |
boolean |
isActive()
Whether the Groove is active. |
void |
setMaster(Groove groove)
Sets the master Groove to which this one should be synched
before playing. |
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 |
| Field Detail |
|---|
public static final int DEFAULT_DURATION
| Constructor Detail |
|---|
public Groove(java.lang.String filename,
java.util.EnumMap<GameUtils.Team,Instrumentation> teamParts)
Groove for the given file and with the given
Instrumentations.
filename - the MIDI file's nameteamParts - the parts associated with each team
public Groove(java.lang.String filename,
int duration,
java.util.EnumMap<GameUtils.Team,Instrumentation> teamToPart)
Groove for the given file and with the given
Instrumentations, which will play for the given duration
when activated.
filename - the MIDI file's nameduration - the duration to play when activatedteamToPart - the parts associated with each team| Method Detail |
|---|
public void setMaster(Groove groove)
Groove to which this one should be synched
before playing.
groove - the master Grooveprotected javax.sound.midi.Transmitter getTransmitter()
public boolean isActive()
Groove is active.
true if active, false otherwisepublic java.util.Set<GameUtils.Team> getTeamSet()
Groove is aware.public void setVolumePercentage(double percent)
Equalizable
setVolumePercentage in interface Equalizablepercent - the new volume percentagepublic double getVolumePercentage()
Equalizable
getVolumePercentage in interface Equalizablepublic void activate(GameUtils.Team team)
team - the team to activate
public void activate(GameUtils.Team team,
int duration)
team - the team to activateduration - the duration to play forpublic void deactivate(GameUtils.Team team)
team - the team to deactivate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||