Methods Summary |
---|
public void | connect()
for (int i = 0; i < sources.length; i++)
sources[i].connect();
|
public void | disconnect()
for (int i = 0; i < sources.length; i++)
sources[i].disconnect();
|
public java.lang.String | getContentType()Returns the content-type of the merged streams. If all streams are RAW,
the returned content-type is RAW. Otherwise, the return content-type is
MIXED.
if (sources.length == 1)
return sources[0].getContentType();
boolean isRaw = true;
for (int index = 0; index < sources.length; index++) {
if (!sources[index].getContentType().equals(ContentDescriptor.RAW)) {
isRaw = false;
break;
}
}
if (isRaw)
return ContentDescriptor.RAW;
else if (sources.length == 1)
return sources[0].getContentType();
else
return ContentDescriptor.MIXED;
|
public java.lang.Object | getControl(java.lang.String controlType)Obtain the object that implements the specified
Class or Interface
The full class or interface name must be used.
If the control is not supported then null
is returned.
try {
Class cls = Class.forName(controlType);
Object cs[] = getControls();
for (int i = 0; i < cs.length; i++) {
if (cls.isInstance(cs[i]))
return cs[i];
}
return null;
} catch (Exception e) { // no such controlType or such control
return null;
}
|
public java.lang.Object[] | getControls()Obtain the collection of objects that
control the object that implements this interface.
If no controls are supported, a zero length
array is returned.
if (controls == null) {
Vector vcontrols = new Vector(1);
for (int i = 0; i < sources.length; i++) {
Object [] cs = (Object[]) sources[i].getControls();
if (cs.length > 0) {
for (int j = 0; j < cs.length; j++) {
vcontrols.addElement(cs[j]);
}
}
}
controls = new Object[vcontrols.size()];
for (int c = 0; c < vcontrols.size(); c++)
controls[c] = vcontrols.elementAt(c);
}
return controls;
|
public javax.media.Time | getDuration()Get the duration of the media represented
by this object.
The value returned is the media's duration
when played at the default rate.
If the duration can't be determined (for example, the media object is presenting live
video) getDuration returns DURATION_UNKNOWN .
Time longest = new Time(0);
for (int i = 0; i < sources.length; i++) {
Time sourceDuration = sources[i].getDuration();
if (sourceDuration.getSeconds() > longest.getSeconds())
longest = sourceDuration;
}
return longest;
|
public void | start()
for (int i = 0; i < sources.length; i++)
sources[i].start();
|
public void | stop()
for (int i = 0; i < sources.length; i++)
sources[i].stop();
|