cnrg.itx.gtwy
Class PlayDestination

java.lang.Object
  |
  +--cnrg.itx.gtwy.PlayDestination

public class PlayDestination
extends java.lang.Object
implements cnrg.itx.datax.Destination

The user-defined destination of voice data packets from the computer network to the gateway.

See Also:
PlayChannel, Destination

Field Summary
private  int bytesWritten
          The number of bytes written to the buffer.
private  int iNumPackets
          The number of packets written.
private  boolean isMute
          true if the destination has to be muted; false otherwise.
private  boolean isOpen
          true if destination is open for receiving packets; false otherwise.
private  Line myLine
          The Line instance related to the destination.
 
Constructor Summary
PlayDestination(Line l)
           
 
Method Summary
(package private) static void ()
           
 void close()
          Used to close the destination to receiving voice packets.
 Line getLine()
           
 cnrg.itx.datax.PropertiesCollection getProperties()
          The Gateway is not concerned about properties.
 cnrg.itx.datax.Stats getStatistics()
           
 boolean mute(boolean mode)
          Used to mute the voice data sent to the destination.
 void setPeerProperties(cnrg.itx.datax.PropertiesCollection pc)
          The Gateway does not set peer properties.
 void setProperties(cnrg.itx.datax.PropertiesCollection pc)
          No properties are set.
 void write(byte[] data)
          Writes voice data to a specified buffer on the gateway.
private  void writeToPlay(int lineNumber, byte[] data)
          Writes voice data from computer to buffers in native code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

myLine

private Line myLine
The Line instance related to the destination.

isOpen

private boolean isOpen
true if destination is open for receiving packets; false otherwise.

isMute

private boolean isMute
true if the destination has to be muted; false otherwise.

bytesWritten

private int bytesWritten
The number of bytes written to the buffer.

iNumPackets

private int iNumPackets
The number of packets written. Size specified as transfer size to the phone.
Constructor Detail

PlayDestination

public PlayDestination(Line l)
Parameters:
l - the Line instance related to PlayDestination.
See Also:
Line
Method Detail

static void ()

getLine

public Line getLine()
Returns:
the Line instance for PlayDestination
See Also:
Line

close

public void close()
Used to close the destination to receiving voice packets.
Specified by:
close in interface cnrg.itx.datax.Destination

mute

public boolean mute(boolean mode)
Used to mute the voice data sent to the destination.
Specified by:
mute in interface cnrg.itx.datax.Destination
Parameters:
mode - true if the destination has to be muted; false otherwise.
Returns:
true if the destination has been muted; false otherwise.

write

public void write(byte[] data)
           throws cnrg.itx.datax.DataException
Writes voice data to a specified buffer on the gateway. Data will be played out on a phone later on.
Specified by:
write in interface cnrg.itx.datax.Destination
Parameters:
data - the voice data.

getProperties

public cnrg.itx.datax.PropertiesCollection getProperties()
                                                  throws cnrg.itx.datax.DataException
The Gateway is not concerned about properties. Returns null.

setProperties

public void setProperties(cnrg.itx.datax.PropertiesCollection pc)
                   throws cnrg.itx.datax.DataException
No properties are set.

setPeerProperties

public void setPeerProperties(cnrg.itx.datax.PropertiesCollection pc)
                       throws cnrg.itx.datax.DataException
The Gateway does not set peer properties.

getStatistics

public cnrg.itx.datax.Stats getStatistics()
Returns:
the Stats object which describes the current state of the destination.

writeToPlay

private void writeToPlay(int lineNumber,
                         byte[] data)
Writes voice data from computer to buffers in native code. playPacket plays out the data in the buffers.
Parameters:
lineNumber - the line's designated number.
data - the data being sent.