micromod.output
Class HasAvailableOutputDevice

java.lang.Object
  extended bymicromod.output.PCM16StreamOutputDevice
      extended bymicromod.output.HasAvailableOutputDevice
All Implemented Interfaces:
OutputDevice, PCM16, StreamOutputDevice
Direct Known Subclasses:
JavaSoundOutputDevice

public abstract class HasAvailableOutputDevice
extends PCM16StreamOutputDevice

A HasAvailableOutputDevice has an internal buffer whose status can be determined at any time. All stream devices have such a buffer, but some may not support the ability to request the amount of data within it.


Field Summary
 
Fields inherited from class micromod.output.PCM16StreamOutputDevice
bytesPerFrame, CONVERT_BUFFER_FRAMES, convertBuffer, converter
 
Constructor Summary
HasAvailableOutputDevice()
           
 
Method Summary
protected abstract  int bytesAvailable()
           
 int framesAvailable()
          A frame of PCM audio is one sample.
 
Methods inherited from class micromod.output.PCM16StreamOutputDevice
initialise, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface micromod.output.StreamOutputDevice
pause, write
 
Methods inherited from interface micromod.output.OutputDevice
close, start, stop
 
Methods inherited from interface micromod.output.PCM16
getSamplingRate
 

Constructor Detail

HasAvailableOutputDevice

public HasAvailableOutputDevice()
Method Detail

bytesAvailable

protected abstract int bytesAvailable()
Returns:
The number of bytes available in the buffer.

framesAvailable

public int framesAvailable()
A frame of PCM audio is one sample. Eg) 1 frame is 4 bytes with 16 bit stereo audio.

Returns:
the number of frames of audio that can be written directly to the buffer without "blocking" (having to wait until the space becomes available)