javax.media.control
Interface FormatControl

All Known Subinterfaces:
TrackControl

public interface FormatControl
extends Control

The FormatControl interfaces is implemented by objects which supports format setting.

Since:
JMF 2.0

Method Summary
 Format getFormat()
          Obtain the format that this object is set to.
 Format[] getSupportedFormats()
          Lists the possible input formats supported by this plug-in.
 boolean isEnabled()
          Return the state of the track.
 void setEnabled(boolean enabled)
          Enable or disable the track.
 Format setFormat(Format format)
          Sets the data format.
 
Methods inherited from interface javax.media.Control
getControlComponent
 

Method Detail

getFormat

public Format getFormat()
Obtain the format that this object is set to.
Returns:
the current format.

setFormat

public Format setFormat(Format format)
Sets the data format. The method returns null if the format is not supported. Otherwise, it returns the format that's actually set.

However in some situations, returning a non-null format does not necessarily mean that the format is supported since determining the supported formats may be state dependent or simply too costly. In such cases, the setFormat call will succeed but the object may fail in another state-transition operation such as when the object is being initialized.

Alternatively, the getSupportedFormats method can be used to query for the list of supported formats. The resulting list can be used to screen for the valid formats before setting that on the object.

Returns:
null if the format is not supported; otherwise return the format that's actually set.

getSupportedFormats

public Format[] getSupportedFormats()
Lists the possible input formats supported by this plug-in.
Returns:
an array of the supported formats

isEnabled

public boolean isEnabled()
Return the state of the track.
Returns:
A boolean telling whether or not the track is enabled.

setEnabled

public void setEnabled(boolean enabled)
Enable or disable the track.
Parameters:
enabled - true if the track is to be enabled.


Submit a bug or feature
Copyright 1999-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved. See the Specification License for more details.
Sun, Sun Microsystems, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.