|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjass.engine.Out
jass.engine.InOut
public abstract class InOut
Input/output unit. Needs only implementation of computeBuffer(). Each attached source can be labeled passive, which means that we will call getBuffer() without a time stamp on it, so no computation is triggered. This is needed only when using the ThreadMixer which would result in deadlocks on closed loops. So you have to explicitly mark source connections passive to eliminate loops. When using only 1 thread this is not needed.
Field Summary | |
---|---|
protected java.util.Vector<Source> |
sourceContainer
|
protected java.util.Vector<java.lang.Boolean> |
sourcePassivity
|
protected float[][] |
srcBuffers
Array of buffers of the sources |
Fields inherited from class jass.engine.Out |
---|
buf, bufferSize, bufOld, lock |
Constructor Summary | |
---|---|
InOut(int bufferSize)
|
Method Summary | |
---|---|
java.lang.Object |
addSource(Source s)
add source to Sink. |
java.lang.Object |
addSource(Source s,
boolean p)
add source to Sink, can flag as passive (so will trigger no computation) |
float[] |
getBuffer(long t)
Get buffer with frame index t. |
Source[] |
getSources()
Get array of sources. |
void |
removeSource(Source s)
Remove a Source |
void |
resetTime(long t)
Reset time of self and all inputs |
Methods inherited from class jass.engine.Out |
---|
clearBuffer, computeBuffer, copyToOld, getBuffer, getBufferSize, getTime, peekAtBuffer, setBufferSize, setTime, setTimeAndNotify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Vector<Source> sourceContainer
protected java.util.Vector<java.lang.Boolean> sourcePassivity
protected float[][] srcBuffers
Constructor Detail |
---|
public InOut(int bufferSize)
Method Detail |
---|
public java.lang.Object addSource(Source s) throws SinkIsFullException
addSource
in interface Sink
s
- Source to add.
SinkIsFullException
public java.lang.Object addSource(Source s, boolean p) throws SinkIsFullException
s
- Source to add.passive
- flag; true if passive, otherwise will be active (normal)
SinkIsFullException
public void removeSource(Source s)
Sink
removeSource
in interface Sink
s
- Source to removepublic Source[] getSources()
getSources
in interface Sink
public float[] getBuffer(long t) throws BufferNotAvailableException
getBuffer
in interface Source
getBuffer
in class Out
t
- timestamp of buffer = frame index.
BufferNotAvailableException
public void resetTime(long t)
resetTime
in class Out
t
- time to reset to. Patch must be in a state s.t. none of the current times == t
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |