|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--cnrg.itx.datax.Channel
|
+--cnrg.itx.datax.MixerChannel
MixerChannel acts as a channel with multiple inputs. Destinations can be set (as in a standard Channel) with the addDestination() method. To use multiple inputs, call the getNewInput method. This returns a Channel object that can be assigned a source. Example:
The following creates a MixerChannel and adds a microphone soruce and a mixer source to it.
Channel ch; MixerChannel mc = new MixerChannel(); ch = mc.getNewInput(); ch.setSource(new MicrophoneSource(ch)); ch = mc.getNewInput(); ch.setSource(new NetworkSource(...,ch,...));
| Fields inherited from class cnrg.itx.datax.Channel |
INPUT,
OTHER,
OUTPUT,
SAMPLE_SIZE |
| Constructor Summary | |
MixerChannel()
Creates an mixerChannel with no sources or destinations. |
|
MixerChannel(int sampleSize)
Creates a new mixerChannel with the specified sample size. |
|
| Method Summary | |
void |
addDestination(Destination d)
Method to add a destination for the Channel. |
void |
close()
This method closes the MixerChannel. |
Channel |
getNewInput()
Adds an additional source to the mixerChannel. |
Channel |
getNewSubtractedInput(Destination dest)
Adds an additional source to the mixerChannel that will be silent to the given destination. |
PropertiesCollection |
getProperties()
Gets the properties for this MixerChannel |
Source |
getSource()
Returns the channel's source. |
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[] b)
This method will push data into the MixerChannel's output channel skipping over the mixer. |
void |
removeAllDestinations()
Method to remove all destinations. |
boolean |
removeDestination(Destination d)
Method to remove a destination from the list. |
void |
removeInput(Channel c)
Closes and removes a channel form the mixer. |
void |
removeInput(Source s)
Closes and removes from the mixer the channel corresponding to the given source. |
void |
run()
Implements the mixer thread. |
void |
setPeerProperties(PropertiesCollection pc)
Interface to set the given properties collection into the device. |
void |
setProperties(PropertiesCollection pc)
Sets the properties for this MixerChannel |
void |
setSource(Source s)
Sets the source of the Mixer channel to a single source. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public MixerChannel()
public MixerChannel(int sampleSize)
sampleSize - the number of bytes to be sent by the channel in each write.| Method Detail |
public void addDestination(Destination d)
throws DuplicateDestinationException
d - The destination to add to the list of destination for the channelpublic boolean removeDestination(Destination d)
d - The Destination object to removepublic void removeAllDestinations()
public void open()
throws DataException
public void mute(boolean state)
state - The state of the mute. true to mute and false to unmutepublic PropertiesCollection getProperties()
public void setProperties(PropertiesCollection pc)
pc - The new PropertiesCollection for this MixerChannel
public void setPeerProperties(PropertiesCollection pc)
throws DataException
public Stats getStatistics()
public Source getSource()
public void setSource(Source s)
s - the new source for the MixerChannelpublic Channel getNewInput()
public Channel getNewSubtractedInput(Destination dest)
dest - the Destination object to be removed from the mix sent to the returned channelpublic void removeInput(Channel c)
Closing this channel also closes its source.
the - channel corresponding to the input to be removed.public void removeInput(Source s)
(closes both channel and source)
NOTE: slower than removeInput(Channel c).
s - the Source corresponding to the input to be removedpublic void run()
public void close()
public void push(byte[] b)
b - the data to be sent to the output
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||