|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cnrg.itx.datax.Channel
Class representing a channel in the Connection
object. A Channel
acts as a pipe between a Source
and all the Destination
objects
and copies data between them.
Field Summary | |
protected boolean |
closed
Flag for specifying if the channel has been closed |
protected java.util.Vector |
destinations
Attribute to store the list of destination objects. |
static int |
INPUT
Constant to specify that a channel is an input channel. |
protected int |
mode
Attribute to hold the mode of the channel |
static int |
OTHER
Constant to specify that a channel is neither an output nor input channel (maybe a hybrid). |
static int |
OUTPUT
Constant to specify that a channel is an output channel. |
protected java.io.PipedInputStream |
pipedInput
Input pipe |
protected java.io.PipedOutputStream |
pipedOutput
|
protected java.lang.Thread |
readerThread
Reader thread |
protected boolean |
running
Flag for specifying if the channel is running. |
static int |
SAMPLE_SIZE
Default channel sample size |
protected int |
sampleSize
Sample size |
protected Source |
source
Attribute to store the source object. |
Constructor Summary | |
Channel()
Default constructor for a channel. |
|
Channel(int sampleSize)
Constructor for a channel. |
Method Summary | |
void |
addDestination(Destination d)
Method to add a destination for the Channel. |
void |
close()
Method to close the Channel. |
private int |
getMode(int mode)
Method to get the mode for the channel. |
PropertiesCollection |
getProperties()
Gets the properties for this audioConnection |
Source |
getSource()
Method to get the source for the Channel. |
Stats |
getStatistics()
Method to get the statistics from the channel. |
void |
mute(boolean state)
Method to mute all the sources and destinations |
void |
open()
Method to open the Channel. |
void |
push(byte[] bData)
Method that receives the data from the source. |
void |
removeAllDestinations()
Method to remove all destinations. |
boolean |
removeDestination(Destination d)
Method to remove a destination from the list. |
void |
run()
Channel reader thread function. |
private void |
setMode(int mode)
Method to set the mode for the Channel. |
void |
setPeerProperties(PropertiesCollection pc)
Interface to set the given properties collection into the device. |
void |
setProperties(PropertiesCollection pc)
Sets the properties for this audioConnection |
void |
setSource(Source source)
Method to set the source for the Channel. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int SAMPLE_SIZE
public static final int INPUT
public static final int OUTPUT
public static final int OTHER
protected int mode
protected Source source
protected java.util.Vector destinations
protected boolean running
protected boolean closed
protected java.io.PipedInputStream pipedInput
protected java.io.PipedOutputStream pipedOutput
protected java.lang.Thread readerThread
protected int sampleSize
Constructor Detail |
public Channel()
public Channel(int sampleSize)
sampleSize
- size (in bytes) read by the channel read threadMethod Detail |
public void setSource(Source source)
source
- The Source for the Channelpublic Source getSource()
private void setMode(int mode)
mode
- The new modeprivate int getMode(int mode)
public void addDestination(Destination d) throws DuplicateDestinationException
d
- The destination to add to the list of destination for the channelpublic void open() throws DataException
public void run()
public void push(byte[] bData)
Note: the buffer that is passed should persist for some time.
bData
- buffer that will be guaranteed to be unchanged for some amount of time.
FIXME: what to do with excetions?public void close()
public boolean removeDestination(Destination d)
d
- The Destination object to removepublic void removeAllDestinations()
public void mute(boolean state)
state
- The state of the mute. true to mute and false to unmutepublic Stats getStatistics()
public PropertiesCollection getProperties()
public void setProperties(PropertiesCollection pc)
public void setPeerProperties(PropertiesCollection pc) throws DataException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |