net.sf.fmj.media.renderer.audio
Class JavaSoundRenderer

java.lang.Object
  extended by net.sf.fmj.media.renderer.audio.JavaSoundRenderer
All Implemented Interfaces:
Controls, PlugIn, Renderer

public class JavaSoundRenderer
extends java.lang.Object
implements Renderer

Audio Renderer which uses JavaSound.

Author:
Warren Bloomer, Ken Larson

Field Summary
 
Fields inherited from interface javax.media.PlugIn
BUFFER_PROCESSED_FAILED, BUFFER_PROCESSED_OK, INPUT_BUFFER_NOT_CONSUMED, OUTPUT_BUFFER_NOT_FILLED, PLUGIN_TERMINATED
 
Constructor Summary
JavaSoundRenderer()
           
 
Method Summary
 void close()
          Free the data line.
 java.lang.Object getControl(java.lang.String controlType)
           
 java.lang.Object[] getControls()
           
 java.lang.String getName()
          Returns the name of the pluging.
 Format[] getSupportedInputFormats()
          Set supported input formats for the default or selected Mixer.
 int hashCode()
           
 void open()
          Open the plugin.
 int process(Buffer buffer)
          Write the buffer to the SourceDataLine.
 void reset()
          Reset the state of the plugin.
 Format setInputFormat(Format format)
           
 void start()
          Start the rendering process
 void stop()
          Stop the rendering process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaSoundRenderer

public JavaSoundRenderer()
Method Detail

getName

public java.lang.String getName()
Returns the name of the pluging.

Specified by:
getName in interface PlugIn

getSupportedInputFormats

public Format[] getSupportedInputFormats()
Set supported input formats for the default or selected Mixer. Perhaps just list generic LINEAR, ALAW and ULAW. At the moment, we are returning all the formats handled by the current default mixer.

Specified by:
getSupportedInputFormats in interface Renderer

setInputFormat

public Format setInputFormat(Format format)
Specified by:
setInputFormat in interface Renderer

getControl

public java.lang.Object getControl(java.lang.String controlType)
Specified by:
getControl in interface Controls

getControls

public java.lang.Object[] getControls()
Specified by:
getControls in interface Controls

open

public void open()
          throws ResourceUnavailableException
Open the plugin. Must be called after the formats have been determined and before "process" is called. Open the DataLine.

Specified by:
open in interface PlugIn
Throws:
ResourceUnavailableException

close

public void close()
Free the data line.

Specified by:
close in interface PlugIn

reset

public void reset()
Reset the state of the plugin. The reset method is typically called if the end of media is reached or the media is repositioned.

Specified by:
reset in interface PlugIn

start

public void start()
Start the rendering process

Specified by:
start in interface Renderer

stop

public void stop()
Stop the rendering process.

Specified by:
stop in interface Renderer

process

public int process(Buffer buffer)
Write the buffer to the SourceDataLine.

Specified by:
process in interface Renderer

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object