|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jass.engine.Out
public abstract class Out
Output-only unit. Will produce audio-rate buffers. Needs only implementation of computeBuffer().
Field Summary | |
---|---|
protected float[] |
buf
The current buffer. |
protected int |
bufferSize
Buffer length of processed audio buffers. |
protected float[] |
bufOld
The old buffer. |
protected java.lang.Object |
lock
To provide access to the old buffer without locking whole class |
Constructor Summary | |
---|---|
Out()
Create. |
|
Out(int bufferSize)
Create at time 0 (which you may want to change by calling setTime() if objects are created in the middle of some jass.sis process). |
Method Summary | |
---|---|
void |
clearBuffer()
Clears buffer to zero. |
protected abstract void |
computeBuffer()
Compute the next buffer and store in member float[] buf. |
protected void |
copyToOld()
|
float[] |
getBuffer()
Get old buffer in cache. |
float[] |
getBuffer(long t)
Get buffer with frame index t. |
int |
getBufferSize()
Get buffer size. |
long |
getTime()
Get current time. |
float[] |
peekAtBuffer()
Peek at buffer. |
void |
resetTime(long t)
Reset time of self and all inputs |
void |
setBufferSize(int bufferSize)
Set buffer size. |
void |
setTime(long t)
Set current time. |
void |
setTimeAndNotify(long t)
Set current time and notify waiting threads (used by ThreadMixer). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int bufferSize
protected float[] buf
protected float[] bufOld
protected java.lang.Object lock
Constructor Detail |
---|
public Out(int bufferSize)
public Out()
Method Detail |
---|
protected void copyToOld()
public float[] peekAtBuffer()
public long getTime()
getTime
in interface Source
public void setTime(long t)
setTime
in interface Source
t
- current time.public void setTimeAndNotify(long t)
t
- current time.public void resetTime(long t)
t
- time to reset to. Patch must be in a state s.t. none of the current times == tpublic int getBufferSize()
getBufferSize
in interface Source
public void setBufferSize(int bufferSize)
setBufferSize
in interface Source
bufferSize
- buffer size.protected abstract void computeBuffer()
public void clearBuffer()
clearBuffer
in interface Source
public float[] getBuffer(long t) throws BufferNotAvailableException
getBuffer
in interface Source
t
- timestamp of buffer = frame index.
BufferNotAvailableException
public float[] getBuffer() throws BufferNotAvailableException
getBuffer
in interface Source
BufferNotAvailableException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |