|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object micromod.LoopDecoder
LoopDecoder streams the samples of an instrument in the correct order. Because looping is done independently of anything else, it makes bidi loops etc. easy to do, and fast, because the loop can be made tight. This implementation is rather strange, because in order to emulate a widely used quirk of ProTracker, an Instrument can be assigned to the decoder while another one is playing. The assigned instrument will be triggered automatically by the decoder depending upon certain conditions.
Field Summary | |
protected Instrument |
assigned
|
protected Instrument |
instrument
|
protected int |
samplePos
|
Constructor Summary | |
LoopDecoder()
Constructor |
Method Summary | |
void |
assignInstrument(Instrument inst)
Assign an Instrument to the decoder. |
boolean |
finishedPlaying()
|
Instrument |
getInstrument()
|
int |
getSamplePosition()
|
void |
output(short[] buffer,
int offset,
int length,
boolean snapBack)
Output looped(or not) audio into buffer. |
void |
setAssigned()
Switch to the assigned instrument |
void |
setSamplePosition(int samplePosition)
Set the sample position of playback. |
protected static void |
zero(short[] buffer,
int start,
int end)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Instrument instrument
protected Instrument assigned
protected int samplePos
Constructor Detail |
public LoopDecoder()
Method Detail |
public void assignInstrument(Instrument inst)
public void setAssigned()
public Instrument getInstrument()
public boolean finishedPlaying()
public void setSamplePosition(int samplePosition)
public int getSamplePosition()
public void output(short[] buffer, int offset, int length, boolean snapBack)
snapBack
- if true, the sample position will not be updated.protected static void zero(short[] buffer, int start, int end)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |