jass.generators
Class ConstantOneShotBuffer

java.lang.Object
  extended by jass.engine.Out
      extended by jass.generators.ConstantLoopBuffer
          extended by jass.generators.ConstantOneShotBuffer
All Implemented Interfaces:
Source

public class ConstantOneShotBuffer
extends ConstantLoopBuffer

Play a buffer once

Author:
Kees van den Doel (kvdoel@cs.ubc.ca)

Field Summary
 
Fields inherited from class jass.generators.ConstantLoopBuffer
ix, loopBuffer, loopBufferLength, srate
 
Fields inherited from class jass.engine.Out
buf, bufferSize, bufOld, lock
 
Constructor Summary
ConstantOneShotBuffer(float srate, int bufferSize, float[] loopBuffer)
          Construct loop force and provide buffer.
ConstantOneShotBuffer(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.generators.ConstantLoopBuffer
getLoopBuffer, getSamplingRate
 
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
 

Constructor Detail

ConstantOneShotBuffer

public ConstantOneShotBuffer(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.

ConstantOneShotBuffer

public ConstantOneShotBuffer(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.
Method Detail

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 ConstantLoopBuffer