javax.sound.sampled
Interface Line

All Known Subinterfaces:
Clip, DataLine, Mixer, Port, SourceDataLine, TargetDataLine

public interface Line

A Line represents a single input or output audio line.

Since:
1.3

Nested Class Summary
static class Line.Info
          An object of this type holds information about a Line.
 
Method Summary
 void addLineListener(LineListener listener)
          Add a listener which will be notified whenever this Line changes state.
 void close()
          Close this line.
 Control getControl(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.Info getLineInfo()
          Return the Info object associated with this Line.
 boolean isControlSupported(Control.Type what)
          Return true if a Control matching the argument is available for this Line, false otherwise.
 boolean isOpen()
          Return true if this line is open, false otherwise.
 void open()
          Open this line.
 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.
 

Method Detail

addLineListener

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

Parameters:
listener - the listener to notify

close

void close()
Close this line.


getControl

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

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

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


isControlSupported

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

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


open

void open()
          throws LineUnavailableException
Open this line.

Throws:
LineUnavailableException - if the line is unavailable for some reason

removeLineListener

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