javax.sound.sampled
Class Port.Info

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.sound.sampled.Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.Line.Info 
      extended by javax.sound.sampled.Port.Info
Enclosing interface:
Port sample code for javax.sound.sampled.Port definition code for javax.sound.sampled.Port

public static class Port.Info
extends Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.Line.Info

The Port.Info class extends Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.Line.Info with additional information specific to ports, including the port's name and whether it is a source or a target for its mixer. By definition, a port acts as either a source or a target to its mixer, but not both. (Audio input ports are sources; audio output ports are targets.)

To learn what ports are available, you can retrieve port info objects through the getSourceLineInfo sample code for javax.sound.sampled.Mixer.getSourceLineInfo() definition code for javax.sound.sampled.Mixer.getSourceLineInfo() and getTargetLineInfo sample code for javax.sound.sampled.Mixer.getTargetLineInfo() definition code for javax.sound.sampled.Mixer.getTargetLineInfo() methods of the Mixer interface. Instances of the Port.Info class may also be constructed and used to obtain lines matching the parameters specified in the Port.Info object.

Since:
1.3

Field Summary
static Port.Info sample code for javax.sound.sampled.Port.Info definition code for javax.sound.sampled.Port.Info COMPACT_DISC sample code for javax.sound.sampled.Port.Info.COMPACT_DISC definition code for javax.sound.sampled.Port.Info.COMPACT_DISC
          A type of port that gets audio from a CD-ROM drive.
static Port.Info sample code for javax.sound.sampled.Port.Info definition code for javax.sound.sampled.Port.Info HEADPHONE sample code for javax.sound.sampled.Port.Info.HEADPHONE definition code for javax.sound.sampled.Port.Info.HEADPHONE
          A type of port that sends audio to a headphone jack.
static Port.Info sample code for javax.sound.sampled.Port.Info definition code for javax.sound.sampled.Port.Info LINE_IN sample code for javax.sound.sampled.Port.Info.LINE_IN definition code for javax.sound.sampled.Port.Info.LINE_IN
          A type of port that gets audio from a line-level audio input jack.
static Port.Info sample code for javax.sound.sampled.Port.Info definition code for javax.sound.sampled.Port.Info LINE_OUT sample code for javax.sound.sampled.Port.Info.LINE_OUT definition code for javax.sound.sampled.Port.Info.LINE_OUT
          A type of port that sends audio to a line-level audio output jack.
static Port.Info sample code for javax.sound.sampled.Port.Info definition code for javax.sound.sampled.Port.Info MICROPHONE sample code for javax.sound.sampled.Port.Info.MICROPHONE definition code for javax.sound.sampled.Port.Info.MICROPHONE
          A type of port that gets audio from a built-in microphone or a microphone jack.
static Port.Info sample code for javax.sound.sampled.Port.Info definition code for javax.sound.sampled.Port.Info SPEAKER sample code for javax.sound.sampled.Port.Info.SPEAKER definition code for javax.sound.sampled.Port.Info.SPEAKER
          A type of port that sends audio to a built-in speaker or a speaker jack.
 
Constructor Summary
Port.Info sample code for javax.sound.sampled.Port.Info.Port.Info(java.lang.Class, java.lang.String, boolean) definition code for javax.sound.sampled.Port.Info.Port.Info(java.lang.Class, java.lang.String, boolean) (Class sample code for java.lang.Class definition code for java.lang.Class <?> lineClass, String sample code for java.lang.String definition code for java.lang.String  name, boolean isSource)
          Constructs a port's info object from the information given.
 
Method Summary
 boolean equals sample code for javax.sound.sampled.Port.Info.equals(java.lang.Object) definition code for javax.sound.sampled.Port.Info.equals(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Finalizes the equals method
 String sample code for java.lang.String definition code for java.lang.String getName sample code for javax.sound.sampled.Port.Info.getName() definition code for javax.sound.sampled.Port.Info.getName() ()
          Obtains the name of the port.
 int hashCode sample code for javax.sound.sampled.Port.Info.hashCode() definition code for javax.sound.sampled.Port.Info.hashCode() ()
          Finalizes the hashCode method
 boolean isSource sample code for javax.sound.sampled.Port.Info.isSource() definition code for javax.sound.sampled.Port.Info.isSource() ()
          Indicates whether the port is a source or a target for its mixer.
 boolean matches sample code for javax.sound.sampled.Port.Info.matches(javax.sound.sampled.Line.Info) definition code for javax.sound.sampled.Port.Info.matches(javax.sound.sampled.Line.Info) (Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.Line.Info  info)
          Indicates whether this info object specified matches this one.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for javax.sound.sampled.Port.Info.toString() definition code for javax.sound.sampled.Port.Info.toString() ()
          Provides a String representation of the port.
 
Methods inherited from class javax.sound.sampled.Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.Line.Info
getLineClass sample code for javax.sound.sampled.Line.Info.getLineClass() definition code for javax.sound.sampled.Line.Info.getLineClass()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

MICROPHONE sample code for javax.sound.sampled.Port.Info.MICROPHONE

public static final Port.Info sample code for javax.sound.sampled.Port.Info definition code for javax.sound.sampled.Port.Info  MICROPHONE
A type of port that gets audio from a built-in microphone or a microphone jack.


LINE_IN sample code for javax.sound.sampled.Port.Info.LINE_IN

public static final Port.Info sample code for javax.sound.sampled.Port.Info definition code for javax.sound.sampled.Port.Info  LINE_IN
A type of port that gets audio from a line-level audio input jack.


COMPACT_DISC sample code for javax.sound.sampled.Port.Info.COMPACT_DISC

public static final Port.Info sample code for javax.sound.sampled.Port.Info definition code for javax.sound.sampled.Port.Info  COMPACT_DISC
A type of port that gets audio from a CD-ROM drive.


SPEAKER sample code for javax.sound.sampled.Port.Info.SPEAKER

public static final Port.Info sample code for javax.sound.sampled.Port.Info definition code for javax.sound.sampled.Port.Info  SPEAKER
A type of port that sends audio to a built-in speaker or a speaker jack.


HEADPHONE sample code for javax.sound.sampled.Port.Info.HEADPHONE

public static final Port.Info sample code for javax.sound.sampled.Port.Info definition code for javax.sound.sampled.Port.Info  HEADPHONE
A type of port that sends audio to a headphone jack.


LINE_OUT sample code for javax.sound.sampled.Port.Info.LINE_OUT

public static final Port.Info sample code for javax.sound.sampled.Port.Info definition code for javax.sound.sampled.Port.Info  LINE_OUT
A type of port that sends audio to a line-level audio output jack.

Constructor Detail

Port.Info sample code for javax.sound.sampled.Port.Info(java.lang.Class<?>, java.lang.String, boolean) definition code for javax.sound.sampled.Port.Info(java.lang.Class<?>, java.lang.String, boolean)

public Port.Info(Class sample code for java.lang.Class definition code for java.lang.Class <?> lineClass,
                 String sample code for java.lang.String definition code for java.lang.String  name,
                 boolean isSource)
Constructs a port's info object from the information given. This constructor is typically used by an implementation of Java Sound to describe a supported line.

Parameters:
lineClass - the class of the port described by the info object.
name - the string that names the port
isSource - true if the port is a source port (such as a microphone), false if the port is a target port (such as a speaker).
Method Detail

getName sample code for javax.sound.sampled.Port.Info.getName() definition code for javax.sound.sampled.Port.Info.getName()

public String sample code for java.lang.String definition code for java.lang.String  getName()
Obtains the name of the port.

Returns:
the string that names the port

isSource sample code for javax.sound.sampled.Port.Info.isSource() definition code for javax.sound.sampled.Port.Info.isSource()

public boolean isSource()
Indicates whether the port is a source or a target for its mixer.

Returns:
true if the port is a source port (such as a microphone), false if the port is a target port (such as a speaker).

matches sample code for javax.sound.sampled.Port.Info.matches(javax.sound.sampled.Line.Info) definition code for javax.sound.sampled.Port.Info.matches(javax.sound.sampled.Line.Info)

public boolean matches(Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.Line.Info  info)
Indicates whether this info object specified matches this one. To match, the match requirements of the superclass must be met and the types must be equal.

Overrides:
matches sample code for javax.sound.sampled.Line.Info.matches(javax.sound.sampled.Line.Info) definition code for javax.sound.sampled.Line.Info.matches(javax.sound.sampled.Line.Info) in class Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.Line.Info
Parameters:
info - the info object for which the match is queried
Returns:
true if the specified object matches this one, false otherwise

equals sample code for javax.sound.sampled.Port.Info.equals(java.lang.Object) definition code for javax.sound.sampled.Port.Info.equals(java.lang.Object)

public final boolean equals(Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Finalizes the equals method

Overrides:
equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) in class Object sample code for java.lang.Object definition code for java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.
See Also:
Object.hashCode() sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

hashCode sample code for javax.sound.sampled.Port.Info.hashCode() definition code for javax.sound.sampled.Port.Info.hashCode()

public final int hashCode()
Finalizes the hashCode method

Overrides:
hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() in class Object sample code for java.lang.Object definition code for java.lang.Object
Returns:
a hash code value for this object.
See Also:
Object.equals(java.lang.Object) sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable

toString sample code for javax.sound.sampled.Port.Info.toString() definition code for javax.sound.sampled.Port.Info.toString()

public final String sample code for java.lang.String definition code for java.lang.String  toString()
Provides a String representation of the port.

Overrides:
toString sample code for javax.sound.sampled.Line.Info.toString() definition code for javax.sound.sampled.Line.Info.toString() in class Line.Info sample code for javax.sound.sampled.Line.Info definition code for javax.sound.sampled.Line.Info
Returns:
a string that describes the port