|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.uiuc.cs397rhc.sound.MidiFilter
edu.uiuc.cs397rhc.game.InstrumentationFilter
InstrumentationFilter is a concatenation of a
VolumeFilter and a VelocityFilter that control the
volume of both channels and drum notes, represented by an
Instrumentation. The InstrumentationFilter itself
is actually a pass-through filter, in that it doesn't modify any events.
However, it does ensure that those events get passed through a volume and/or
velocity filter before reaching its Receiver.
| Field Summary |
|---|
| Fields inherited from interface edu.uiuc.cs397rhc.sound.Fadeable |
|---|
DEFAULT_FADE_DURATION, DEFAULT_SLEEP_INTERVAL |
| Constructor Summary | |
|---|---|
InstrumentationFilter(Instrumentation instr)
Creates a new InstrumentationFilter with no
Receiver for the given Instrumentation. |
|
InstrumentationFilter(javax.sound.midi.Receiver receiver,
Instrumentation instr)
Creates a new InstrumentationFilter with the given
Receiver for the given Instrumentation. |
|
| Method Summary | |
|---|---|
javax.sound.midi.MidiEvent[] |
applyFilter(javax.sound.midi.MidiMessage msg,
long time)
This method always returns null, since the
InstrumentationFilter makes no change to events itself; it
just reroutes them through other filters before letting them reach its
Receiver. |
void |
close()
|
void |
fade(double targetPercent)
Fade from the current multiplier to the target multiplier, over the default duration and with the default interval between volume changes. |
void |
fade(double targetPercent,
long duration)
Fade from the current multiplier to the target mulitplier, over the given duration and with the default interval between volume changes. |
void |
fade(double targetPercent,
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 fade multiplier. |
javax.sound.midi.Receiver |
getReceiver()
|
double |
getVolumePercentage()
Gets the independent volume percentage of the object. |
boolean |
isApplicable(javax.sound.midi.MidiMessage msg,
long time)
This method always returns false, since the
InstrumentationFilter makes no changes to events itself; it
just reroutes them through other filters before letting them reach its
Receiver. |
boolean |
isFading()
Whether a fade is in progress |
void |
setFadeMultiplier(double multiplier)
Sets the current fade multiplier, thereby also stopping any fading. |
void |
setReceiver(javax.sound.midi.Receiver receiver)
|
void |
setVolumePercentage(double percent)
Sets the volume percentage of the object independently of other volume manipulations, such as fading. |
void |
updateVolume()
Update the volume to reflect the current fade multiplier. |
| Methods inherited from class edu.uiuc.cs397rhc.sound.MidiFilter |
|---|
getMicrosecondPosition, getSequencer, send, setSequencer |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InstrumentationFilter(Instrumentation instr)
InstrumentationFilter with no
Receiver for the given Instrumentation.
instr - the instrumentation
public InstrumentationFilter(javax.sound.midi.Receiver receiver,
Instrumentation instr)
InstrumentationFilter with the given
Receiver for the given Instrumentation.
receiver - the receiverinstr - the instrumentation| Method Detail |
|---|
public void setReceiver(javax.sound.midi.Receiver receiver)
setReceiver in interface javax.sound.midi.TransmittersetReceiver in class MidiFilterpublic javax.sound.midi.Receiver getReceiver()
getReceiver in interface javax.sound.midi.TransmittergetReceiver in class MidiFilterpublic void close()
close in interface javax.sound.midi.Receiverclose in class MidiFilter
public boolean isApplicable(javax.sound.midi.MidiMessage msg,
long time)
false, since the
InstrumentationFilter makes no changes to events itself; it
just reroutes them through other filters before letting them reach its
Receiver.
isApplicable in class MidiFiltermsg - a MidiMessagetime - a timestamp
false
public javax.sound.midi.MidiEvent[] applyFilter(javax.sound.midi.MidiMessage msg,
long time)
null, since the
InstrumentationFilter makes no change to events itself; it
just reroutes them through other filters before letting them reach its
Receiver.
applyFilter in class MidiFiltermsg - a MidiMessagetime - a timestamp
nullpublic double getVolumePercentage()
Equalizable
getVolumePercentage in interface Equalizablepublic void setVolumePercentage(double percent)
Equalizable
setVolumePercentage in interface Equalizablepercent - the new volume percentagepublic double getFadeMultiplier()
Fadeable
getFadeMultiplier in interface Fadeablepublic void setFadeMultiplier(double multiplier)
Fadeable
setFadeMultiplier in interface Fadeablemultiplier - the new fade multiplierpublic boolean isFading()
Fadeable
isFading in interface Fadeabletrue if a fade is in progress, false
otherwisepublic void fade(double targetPercent)
Fadeable
fade in interface FadeabletargetPercent - the target volume percentage after the fade
public void fade(double targetPercent,
long duration)
Fadeable
fade in interface FadeabletargetPercent - the target volume percentage after the fadeduration - the duration of the fade in milliseconds
public void fade(double targetPercent,
long duration,
int steps)
Fadeable
fade in interface FadeabletargetPercent - the target volume percentage after the fadeduration - the duration of the fade in millisecondssteps - the number of volume changes during the fadepublic void updateVolume()
Fadeable
updateVolume in interface Fadeable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||