javaFlacEncoder
Class FrameThread

java.lang.Object
  extended by javaFlacEncoder.FrameThread
All Implemented Interfaces:
java.lang.Runnable

public class FrameThread
extends java.lang.Object
implements java.lang.Runnable

The FrameThread class provides threading support for a Frame object, allowing multi-threaded encodings of FLAC frames. It's job is to repeatedly get a BlockEncodeRequest from a BlockThreadManager, and encode it.

Author:
Preston Lacey

Constructor Summary
FrameThread(Frame f, BlockThreadManager manager)
          Constructor.
 
Method Summary
 void run()
          Run method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrameThread

public FrameThread(Frame f,
                   BlockThreadManager manager)
Constructor. Sets the Frame object that this FrameThread will use for encodings.

Parameters:
f - Frame object to use for encoding.
manager - BlockThreadManager to use as the BlockEncodeRequest source and destination.
Method Detail

run

public void run()
Run method. This FrameThread will get a BlockEncodeRequest from the BlockThreadManager, encode the block, return it to the manager, then repeat. If no BlockEncodeRequest is available, or if it recieves a request with the "frameNumber" field set to a negative value, it will break the loop and end, notifying the manager it has ended.

Specified by:
run in interface java.lang.Runnable