|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vwp.sound.mod.modplay.player.TrackState
public class TrackState
Together with ModuleState this is the heart of JMOD. TrackState represents the state of a track in the module. It deals with local effects, notes and instruments started in a track.
Constructor Summary | |
---|---|
TrackState(ModuleState moduleState,
Module module,
Mixer mixer,
int trackNumber)
|
Method Summary | |
---|---|
void |
doEffects(int pattern,
int division,
int tick)
do the effects |
int |
getInstrument()
|
Module |
getModule()
|
ModuleState |
getModuleState()
|
int |
getNote()
|
Sample |
getSample()
|
double |
getVolume()
|
void |
loadTick(int pattern,
int division,
int tick)
load new intruments, notes and autoeffects, and do whatever needs to be done to volume and panning |
void |
postEffects(int pattern,
int division,
int tick)
the effects may need to do some stuff after a tick is played |
void |
preEffect(int pattern,
int division,
int tick)
the effects may need to do some stuff before a tick is played |
void |
setEnvelopePanning(double envPan)
sets the envelope panning for this track |
void |
setEnvelopePosition(int pos)
sets the current position in any volume/panning envelope for the instrument playing in this track |
void |
setEnvelopeVolume(double envVol)
sets the envelope volume for this track |
void |
setFadeoutVolume(double fadeVol)
|
void |
setFineTune(double tune)
sets the finetune |
void |
setPanning(double pan)
sets the panning used by this track |
void |
setSampleDelay(int delay)
sets the delay of the sample playing in this track |
void |
setSampleOffset(double offset)
sets the current position in the sample playing in this track |
void |
setupMixer(int pattern,
int division,
int tick,
double time)
Initialize the mixer for playing this track volume formula used: volume = (trackVolume + volumeSlide + volumeTune) * envelopeVolume * fadeoutVolume panning formula used: p = panning + effects.panningSlide panning = p + min(p,1-p) * (envelopePanning - 0.5) * 2 the rate is calculated in a format specific way using: note + fineTune + relativeNote + noteTune + noteSlide |
void |
setVolume(double vol)
sets the volume of this track |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TrackState(ModuleState moduleState, Module module, Mixer mixer, int trackNumber)
moduleState
- the associated module statemodule
- the module being playedmixer
- the mixertrackNumber
- the track number of this trackMethod Detail |
---|
public void preEffect(int pattern, int division, int tick)
pattern
- the current pattern positiondivision
- the current divisiontick
- the current tickpublic void loadTick(int pattern, int division, int tick)
pattern
- division
- tick
- public void doEffects(int pattern, int division, int tick)
pattern
- currentdivision
- tick
- public void setupMixer(int pattern, int division, int tick, double time) throws PlayerException
pattern
- division
- tick
- time
-
PlayerException
public void postEffects(int pattern, int division, int tick)
pattern
- division
- tick
- public ModuleState getModuleState()
public Module getModule()
public void setVolume(double vol)
vol
- new volumepublic double getVolume()
public void setPanning(double pan)
pan
- the new panningpublic void setFineTune(double tune)
tune
- public void setSampleOffset(double offset)
offset
- public void setSampleDelay(int delay)
delay
- public void setEnvelopePosition(int pos)
pos
- public int getNote()
public void setEnvelopePanning(double envPan)
envPan
- public void setEnvelopeVolume(double envVol)
envVol
- public void setFadeoutVolume(double fadeVol)
fadeVol
- public Sample getSample()
public int getInstrument()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |