|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.softsynth.jsyn.util.VoiceAllocator
public abstract class VoiceAllocator
Voice Allocator for managing the allocation and reuse of voices.
Uses an abstract method makeVoice() which the user must define in a subclass.
BussedVoiceAllocator is typically used instead of VoiceAllocator.
To allocate a voice if freely available, use allocate().
To allocate a free voice, or steal the oldest voice use steal().
Steal is the preferred method for getting a voice because it is usually more important
to start the new voice then to continue the old one.
com.softsynth.jsyn.examples.TJ_PlayKeys1
,
BussedVoiceAllocator
Constructor Summary | |
---|---|
VoiceAllocator(int maxVoices)
|
|
VoiceAllocator(SynthContext synthContext,
int maxVoices)
Specify the maximum number of voices that can be allocated at a time. |
Method Summary | |
---|---|
SynthCircuit |
allocate()
|
SynthCircuit |
allocate(int startTime)
Allocate a voice to use with an unknown stopTime. |
SynthCircuit |
allocate(int startTime,
int stopTime)
Allocate a voice using a default priority of zero. |
SynthCircuit |
allocate(int startTime,
int stopTime,
int priority)
Allocate a voice for use at startTime, lasting until stopTime. |
void |
clear()
Delete all of the allocated voices and clear records of the allocations. |
void |
delete()
Calls clear(). |
void |
free(int stopTime,
SynthCircuit circuit)
Free a voice for others to use. |
void |
free(SynthCircuit circuit)
|
int |
getMaxVoices()
|
SynthCircuit |
getNthVoice(int index)
|
int |
getNumVoices()
|
abstract SynthCircuit |
makeVoice()
Create a new voice. |
SynthCircuit |
steal()
|
SynthCircuit |
steal(int startTime)
Steal a voice with an unknown stopTime. |
SynthCircuit |
steal(int startTime,
int stopTime)
Steal a voice using a default priority of zero. |
SynthCircuit |
steal(int startTime,
int stopTime,
int priority)
Allocate a voice at startTime, lasting until stopTime. |
void |
stop()
|
void |
stop(int time)
Stop all of the allocated voices. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public VoiceAllocator(SynthContext synthContext, int maxVoices)
public VoiceAllocator(int maxVoices)
Method Detail |
---|
public int getMaxVoices()
public int getNumVoices()
public SynthCircuit getNthVoice(int index)
public abstract SynthCircuit makeVoice() throws SynthException
SynthException
public SynthCircuit allocate(int startTime, int stopTime, int priority) throws SynthException
SynthException
public SynthCircuit allocate(int startTime, int stopTime) throws SynthException
SynthException
public SynthCircuit allocate(int startTime) throws SynthException
SynthException
public SynthCircuit allocate() throws SynthException
SynthException
public SynthCircuit steal(int startTime, int stopTime, int priority) throws SynthException
SynthException
public SynthCircuit steal(int startTime, int stopTime) throws SynthException
SynthException
public SynthCircuit steal(int startTime) throws SynthException
SynthException
public SynthCircuit steal() throws SynthException
SynthException
public void free(int stopTime, SynthCircuit circuit)
public void free(SynthCircuit circuit) throws SynthException
SynthException
public void stop(int time)
public void stop()
public void delete()
public void clear()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |