javax.sound.sampled

Interface Line

public interface Line

A Line represents a single input or output audio line.

Since: 1.3

Nested Class Summary
static classLine.Info
An object of this type holds information about a Line.
Method Summary
voidaddLineListener(LineListener listener)
Add a listener which will be notified whenever this Line changes state.
voidclose()
Close this line.
ControlgetControl(Control.Type what)
Return the control associated with this Line that matches the argument.
Control[]getControls()
Return an array of controls associated with this Line.
Line.InfogetLineInfo()
Return the Info object associated with this Line.
booleanisControlSupported(Control.Type what)
Return true if a Control matching the argument is available for this Line, false otherwise.
booleanisOpen()
Return true if this line is open, false otherwise.
voidopen()
Open this line.
voidremoveLineListener(LineListener listener)
Remove the listener from this Line; after this call the listener will no longer be notified when this Line changes state.

Method Detail

addLineListener

public void addLineListener(LineListener listener)
Add a listener which will be notified whenever this Line changes state.

Parameters: listener the listener to notify

close

public void close()
Close this line.

getControl

public Control getControl(Control.Type what)
Return the control associated with this Line that matches the argument.

Parameters: what the type of the control to match

Returns: the associated control

Throws: IllegalArgumentException if a control of this type is not available for this line

getControls

public Control[] getControls()
Return an array of controls associated with this Line. Note that this method will not return null -- if there are no controls, it will return a zero-length array.

getLineInfo

public Line.Info getLineInfo()
Return the Info object associated with this Line.

isControlSupported

public boolean isControlSupported(Control.Type what)
Return true if a Control matching the argument is available for this Line, false otherwise.

Parameters: what the type of the control to match

isOpen

public boolean isOpen()
Return true if this line is open, false otherwise.

open

public void open()
Open this line.

Throws: LineUnavailableException if the line is unavailable for some reason

removeLineListener

public void removeLineListener(LineListener listener)
Remove the listener from this Line; after this call the listener will no longer be notified when this Line changes state.

Parameters: listener the listener to remove