com.cloudgarden.audio
Class DefaultAudioClient

java.lang.Object
  |
  +--com.cloudgarden.audio.DefaultAudioObject
        |
        +--com.cloudgarden.audio.DefaultAudioClient
All Implemented Interfaces:
AudioObject

public class DefaultAudioClient
extends DefaultAudioObject

The base class which connects to an AudioServerI and handles communication of AudioFormat information with the server.


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
DefaultAudioClient(java.lang.String remoteName, java.lang.String server, int port)
          Creates new AudioClientSink, and connects to the remote AudioInputSocketI identified by the server, port and remoteName parameters.
 
Method Summary
 void closeConnection()
          Informs the AudioServerSource that this client has finished with it's connection
 javax.sound.sampled.AudioFormat getAudioFormat()
          Constructs and returns an AudioFormat using calls to the remote underlying AudioOutputSocket.
 java.lang.String getContentType()
           
 void setAudioFormat(javax.sound.sampled.AudioFormat format)
          Tries to set the AudioFormat of the remote AudioSource.
 void setContentType(java.lang.String contentType)
          Sets the content type for this AudioObject - contentType must be one of the FileTypeDescriptor String fields, eg MPEG_AUDIO.
 
Methods inherited from class com.cloudgarden.audio.DefaultAudioObject
addTransferListener, blockWhilePaused, blockWhileWaiting, bytesTransferred, canSetAudioFormat, drain, getLastException, isPaused, isWaiting, removeTransferListener, setPaused
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAudioClient

public DefaultAudioClient(java.lang.String remoteName,
                          java.lang.String server,
                          int port)
                   throws java.rmi.NotBoundException,
                          java.net.MalformedURLException,
                          java.rmi.RemoteException
Creates new AudioClientSink, and connects to the remote AudioInputSocketI identified by the server, port and remoteName parameters.
Method Detail

closeConnection

public void closeConnection()
                     throws java.rmi.RemoteException
Informs the AudioServerSource that this client has finished with it's connection

getAudioFormat

public javax.sound.sampled.AudioFormat getAudioFormat()
Constructs and returns an AudioFormat using calls to the remote underlying AudioOutputSocket. Any RemoteExceptions thrown by the remote calls are caught and a null AudioFormat is returned.
Overrides:
getAudioFormat in class DefaultAudioObject
Following copied from interface: com.cloudgarden.audio.AudioObject
See Also:
AudioObject.setAudioFormat(javax.sound.sampled.AudioFormat)

setAudioFormat

public void setAudioFormat(javax.sound.sampled.AudioFormat format)
Tries to set the AudioFormat of the remote AudioSource. Generally the client should try to set it's own audio format to match that of the remote AudioSource.
Overrides:
setAudioFormat in class DefaultAudioObject
Following copied from interface: com.cloudgarden.audio.AudioObject
Throws:
java.io.IOException - if unable to set the AudioFormat for any reason (eg. if canSetAudioFormat returns false and setAudioFormat is used to try to change the AudioFormat).
See Also:
AudioObject.getAudioFormat()

setContentType

public void setContentType(java.lang.String contentType)
                    throws java.io.IOException
Description copied from interface: AudioObject
Sets the content type for this AudioObject - contentType must be one of the FileTypeDescriptor String fields, eg MPEG_AUDIO.
Overrides:
setContentType in class DefaultAudioObject

getContentType

public java.lang.String getContentType()
Overrides:
getContentType in class DefaultAudioObject
Following copied from interface: com.cloudgarden.audio.AudioObject
See Also:
setContentType