com.cloudgarden.audio
Class CGDataSink

java.lang.Object
  |
  +--com.cloudgarden.audio.CGDataSink
All Implemented Interfaces:
javax.media.protocol.BufferTransferHandler, javax.media.ControllerListener, javax.media.Controls, javax.media.DataSink, javax.media.MediaHandler, javax.media.protocol.SourceTransferHandler

public class CGDataSink
extends java.lang.Object
implements javax.media.DataSink, javax.media.ControllerListener, javax.media.protocol.BufferTransferHandler, javax.media.protocol.SourceTransferHandler

This class should only be created by the JSAPI implementation - a new instance is created and returned by a call to CGAudioManager.getDataSink


Field Summary
protected  java.lang.String contentType
           
protected  javax.sound.sampled.AudioFormat format
           
protected  boolean paused
           
protected  boolean running
           
protected  boolean sending
           
protected  boolean waiting
           
 
Constructor Summary
CGDataSink(AudioPipe pipe)
          Creates new CGDataSink
 
Method Summary
 void addDataSinkListener(javax.media.datasink.DataSinkListener dataSinkListener)
           
 void close()
           
 void controllerUpdate(javax.media.ControllerEvent evt)
           
 java.lang.String getContentType()
           
 java.lang.Object getControl(java.lang.String str)
           
 java.lang.Object[] getControls()
           
 javax.media.MediaLocator getOutputLocator()
           
static void main(java.lang.String[] args)
           
protected  void notifyDataSinkListeners(javax.media.datasink.DataSinkEvent evt)
           
 void open()
           
 void removeDataSinkListener(javax.media.datasink.DataSinkListener dataSinkListener)
           
 void setOutputLocator(javax.media.MediaLocator mediaLocator)
           
 void setSource(javax.media.protocol.DataSource dataSource)
           
 void start()
           
 void stop()
           
 void transferData(javax.media.protocol.PushBufferStream bstream)
           
 void transferData(javax.media.protocol.PushSourceStream pushSourceStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

running

protected boolean running

sending

protected boolean sending

waiting

protected boolean waiting

paused

protected boolean paused

format

protected javax.sound.sampled.AudioFormat format

contentType

protected java.lang.String contentType
Constructor Detail

CGDataSink

public CGDataSink(AudioPipe pipe)
Creates new CGDataSink
Method Detail

getControls

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

addDataSinkListener

public void addDataSinkListener(javax.media.datasink.DataSinkListener dataSinkListener)
Specified by:
addDataSinkListener in interface javax.media.DataSink

removeDataSinkListener

public void removeDataSinkListener(javax.media.datasink.DataSinkListener dataSinkListener)
Specified by:
removeDataSinkListener in interface javax.media.DataSink

start

public void start()
           throws java.io.IOException
Specified by:
start in interface javax.media.DataSink

stop

public void stop()
          throws java.io.IOException
Specified by:
stop in interface javax.media.DataSink

open

public void open()
          throws java.io.IOException,
                 java.lang.SecurityException
Specified by:
open in interface javax.media.DataSink

getOutputLocator

public javax.media.MediaLocator getOutputLocator()
Specified by:
getOutputLocator in interface javax.media.DataSink

getControl

public java.lang.Object getControl(java.lang.String str)
Specified by:
getControl in interface javax.media.Controls

setOutputLocator

public void setOutputLocator(javax.media.MediaLocator mediaLocator)
Specified by:
setOutputLocator in interface javax.media.DataSink

getContentType

public java.lang.String getContentType()
Specified by:
getContentType in interface javax.media.DataSink

close

public void close()
Specified by:
close in interface javax.media.DataSink

setSource

public void setSource(javax.media.protocol.DataSource dataSource)
               throws java.io.IOException,
                      javax.media.IncompatibleSourceException
Specified by:
setSource in interface javax.media.MediaHandler

transferData

public void transferData(javax.media.protocol.PushBufferStream bstream)
Specified by:
transferData in interface javax.media.protocol.BufferTransferHandler

transferData

public void transferData(javax.media.protocol.PushSourceStream pushSourceStream)
Specified by:
transferData in interface javax.media.protocol.SourceTransferHandler

controllerUpdate

public void controllerUpdate(javax.media.ControllerEvent evt)
Specified by:
controllerUpdate in interface javax.media.ControllerListener

notifyDataSinkListeners

protected void notifyDataSinkListeners(javax.media.datasink.DataSinkEvent evt)

main

public static final void main(java.lang.String[] args)