jass.generators
Class OneShotBuffer
java.lang.Object
jass.engine.Out
jass.generators.LoopBuffer
jass.generators.OneShotBuffer
- All Implemented Interfaces:
- Source
- Direct Known Subclasses:
- BangForce
public class OneShotBuffer
- extends LoopBuffer
A force model based on looping through a buffer once, loaded from an audio
file or provided by caller.
- Author:
- Kees van den Doel (kvdoel@cs.ubc.ca)
Constructor Summary |
OneShotBuffer(float srate,
int bufferSize,
float[] loopBuffer)
Construct loop force and provide buffer. |
OneShotBuffer(float srate,
int bufferSize,
java.lang.String fn)
Construct loop force from named file. |
Method Summary |
void |
computeBuffer()
Compute the next buffer. |
void |
hit()
Calling this method will cause next call to getBuffer() to
start playback of the buffer. |
Methods inherited from class jass.engine.Out |
clearBuffer, copyToOld, getBuffer, getBuffer, getBufferSize, getTime, peekAtBuffer, resetTime, setBufferSize, setTime, setTimeAndNotify |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OneShotBuffer
public OneShotBuffer(float srate,
int bufferSize,
java.lang.String fn)
- Construct loop force from named file.
- Parameters:
srate
- sampling rate in Hertz.bufferSize
- bufferSize of this Out.fn
- Audio file name.
OneShotBuffer
public OneShotBuffer(float srate,
int bufferSize,
float[] loopBuffer)
- Construct loop force and provide buffer.
- Parameters:
srate
- sampling rate in Hertz.bufferSize
- bufferSize of this Out.loopBuffer
- looping buffer.
hit
public void hit()
- Calling this method will cause next call to getBuffer() to
start playback of the buffer.
computeBuffer
public void computeBuffer()
- Compute the next buffer. If not hit return zero.
- Overrides:
computeBuffer
in class LoopBuffer