ddf.minim
Class LineReader

java.lang.Object
  extended byjava.lang.Thread
      extended byddf.minim.LineReader
All Implemented Interfaces:
java.lang.Runnable

public class LineReader
extends java.lang.Thread

LineReader reads audio from a TargetDataLine and puts it in a FloatSampleBuffer. It then passes this buffer to all of its listeners so that they can make a copy of the data. You will never need to use this class directly.

Author:
Damien Di Fede

Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LineReader(javax.sound.sampled.TargetDataLine tdl, LineReaderListener readListener, int bufferSize)
          Constructs a LineReader that will read from tdl and then send the samples to readListener, using a buffer of the requested size.
 
Method Summary
 void finish()
          Tell the thread to stop execution.
 void run()
          Read loop for the TargetDataLine this is reading from.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LineReader

public LineReader(javax.sound.sampled.TargetDataLine tdl,
                  LineReaderListener readListener,
                  int bufferSize)
Constructs a LineReader that will read from tdl and then send the samples to readListener, using a buffer of the requested size.

Parameters:
tdl - the TargetDataLine to read from
readListener - the LineReaderListener to send samples to
bufferSize - the buffer size to use
Method Detail

finish

public void finish()
Tell the thread to stop execution.


run

public void run()
Read loop for the TargetDataLine this is reading from.