com.cloudgarden.audio
Class DefaultAudioConnector

java.lang.Object
  |
  +--com.cloudgarden.audio.DefaultAudioObject
        |
        +--com.cloudgarden.audio.DefaultAudioSource
              |
              +--com.cloudgarden.audio.DefaultAudioConnector
All Implemented Interfaces:
AudioConnector, AudioObject, AudioSink, AudioSource
Direct Known Subclasses:
AudioPipe, DefaultAudioConverter

public abstract class DefaultAudioConnector
extends DefaultAudioSource
implements AudioConnector


Field Summary
protected  AudioSource source
           
 
Fields inherited from class com.cloudgarden.audio.DefaultAudioSource
sending, sendThread, sink
 
Fields inherited from class com.cloudgarden.audio.DefaultAudioObject
contentType, exception, format, listeners, paused, pauseSync, running, waiting
 
Fields inherited from interface com.cloudgarden.audio.AudioObject
END_OF_DATA
 
Constructor Summary
DefaultAudioConnector()
           
 
Method Summary
 AudioSource getSource()
          Returns the AudioSource set by setSource
 void setSource(AudioSource src)
          Sets the source for this sink - this method should also call the setSink method on the source object (while avoiding an endless loop) to ensure that sink and source are connected to each other (and not to different sinks/sources).
 int write(byte[] data, int len)
          Convenience method - should call write(data, 0, len)
 
Methods inherited from class com.cloudgarden.audio.DefaultAudioSource
drain, getSink, isSending, read, setAudioFormat, setBufferSize, setContentType, setSink, startSending, stopSending
 
Methods inherited from class com.cloudgarden.audio.DefaultAudioObject
addTransferListener, blockWhilePaused, blockWhileWaiting, bytesTransferred, canSetAudioFormat, getAudioFormat, getContentType, getLastException, isPaused, isWaiting, removeTransferListener, setPaused
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.cloudgarden.audio.AudioSource
getSink, isSending, read, read, setSink, startSending, stopSending
 
Methods inherited from interface com.cloudgarden.audio.AudioObject
addTransferListener, canSetAudioFormat, drain, getAudioFormat, getContentType, isPaused, isWaiting, removeTransferListener, setAudioFormat, setContentType, setPaused
 
Methods inherited from interface com.cloudgarden.audio.AudioSink
write
 

Field Detail

source

protected AudioSource source
Constructor Detail

DefaultAudioConnector

public DefaultAudioConnector()
Method Detail

write

public int write(byte[] data,
                 int len)
          throws java.io.IOException
Description copied from interface: AudioSink
Convenience method - should call write(data, 0, len)
Specified by:
write in interface AudioSink

setSource

public void setSource(AudioSource src)
               throws java.io.IOException
Description copied from interface: AudioSink
Sets the source for this sink - this method should also call the setSink method on the source object (while avoiding an endless loop) to ensure that sink and source are connected to each other (and not to different sinks/sources). Also ensures continuity of the AudioFormat and ContentType (as described below).

If the source's AudioFormat is null or the source's format differs from this AudioSink's format, then the source's format is set equal to that of this AudioSink.

If the source's AudioFormat is not null and this AudioSink's format is null then this AudioSink's format is set equal to the source's.

The same is done for the ContentType as described above for the AudioFormat.

Specified by:
setSource in interface AudioSink
Following copied from interface: com.cloudgarden.audio.AudioSink
See Also:
AudioSink.getSource()

getSource

public AudioSource getSource()
Description copied from interface: AudioSink
Returns the AudioSource set by setSource
Specified by:
getSource in interface AudioSink
Following copied from interface: com.cloudgarden.audio.AudioSink
See Also:
AudioSink.setSource(com.cloudgarden.audio.AudioSource)