APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.media.sound

pack-priv final Class PortMixer

extends AbstractMixer
Class Inheritance
Imports
java.util.Vector, javax.sound.sampled.BooleanControl, .CompoundControl, .Control, .FloatControl, .Line, .LineUnavailableException, .Port

A Mixer which only provides Ports.
Author
Florian Bomers

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
PortMixer.BoolCtrl

Private inner class representing a BooleanControl for PortMixerPort.

private static class
PortMixer.CompCtrl

Private inner class representing a CompoundControl for PortMixerPort.

private static class
PortMixer.FloatCtrl

Private inner class representing a BooleanControl for PortMixerPort.

private static class
PortMixer.PortInfo

Private inner class representing a port info.

private static class
PortMixer.PortMixerPort

Private inner class representing a Port for the PortMixer.

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int
private static final int
private static final int
private long
private final Port.Info[]
private PortMixer.PortMixerPort[]
private static final int
private static final int
private static final int
private static final int
private static final int
Inherited from com.sun.media.sound.AbstractMixer:
ALAWPCMsourceLineInfotargetLineInfoULAW

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv long
public Line
getLine(Line.Info info)

Implements abstract com.sun.media.sound.AbstractMixer.getLine.

Implements javax.sound.sampled.Mixer.getLine.

Obtains a line that is available for use and that matches the description in the specified Line.Info object.

public int
getMaxLines(Line.Info info)

Implements abstract com.sun.media.sound.AbstractMixer.getMaxLines.

Implements javax.sound.sampled.Mixer.getMaxLines.

Obtains the approximate maximum number of lines of the requested type that can be open simultaneously on the mixer.

pack-priv int
pack-priv Port
getPort(int index)

private Port.Info
getPortInfo(int portIndex, int type)

protected void
protected void
protected void
protected void
private static native void
nClose(long id)

private static native float
nControlGetFloatValue(long controlID)

private static native int
nControlGetIntValue(long controlID)

private static native void
nControlSetFloatValue(long controlID, float value)

private static native void
nControlSetIntValue(long controlID, int value)

private static native void
nGetControls(long id, int portIndex, Vector<E> vector)

private static native int
nGetPortCount(long id)

private static native String
nGetPortName(long id, int portIndex)

private static native int
nGetPortType(long id, int portIndex)

private static native long
nOpen(int mixerIndex)

Inherited from com.sun.media.sound.AbstractMixer:
closeclosegetLineInfogetMixerInfogetSourceLineInfogetSourceLineInfogetSourceLinesgetTargetLineInfogetTargetLineInfogetTargetLinesisLineSupportedisSourceLineisSynchronizationSupportedisTargetLineopenopenopenstartstopsynchronizeunsynchronize

Field Detail

DST_HEADPHONEback to summary
private static final int DST_HEADPHONE
DST_LINE_OUTback to summary
private static final int DST_LINE_OUT
DST_MASKback to summary
private static final int DST_MASK
DST_SPEAKERback to summary
private static final int DST_SPEAKER
DST_UNKNOWNback to summary
private static final int DST_UNKNOWN
idback to summary
private long id
portInfosback to summary
private final Port.Info[] portInfos
portsback to summary
private PortMixer.PortMixerPort[] ports
SRC_COMPACT_DISCback to summary
private static final int SRC_COMPACT_DISC
SRC_LINE_INback to summary
private static final int SRC_LINE_IN
SRC_MASKback to summary
private static final int SRC_MASK
SRC_MICROPHONEback to summary
private static final int SRC_MICROPHONE
SRC_UNKNOWNback to summary
private static final int SRC_UNKNOWN

Constructor Detail

PortMixerback to summary
pack-priv PortMixer(PortMixerProvider.PortMixerInfo portMixerInfo)

Method Detail

getIDback to summary
pack-priv long getID()
getLineback to summary
public Line getLine(Line.Info info) throws LineUnavailableException

Implements abstract com.sun.media.sound.AbstractMixer.getLine.

Implements javax.sound.sampled.Mixer.getLine.

Doc from javax.sound.sampled.Mixer.getLine.

Obtains a line that is available for use and that matches the description in the specified Line.Info object.

If a DataLine is requested, and info is an instance of DataLine.Info specifying at least one fully qualified audio format, the last one will be used as the default format of the returned DataLine.

Annotations
@Override
Exceptions
LineUnavailableException:
if a matching line is not available due to resource restrictions
getMaxLinesback to summary
public int getMaxLines(Line.Info info)

Implements abstract com.sun.media.sound.AbstractMixer.getMaxLines.

Implements javax.sound.sampled.Mixer.getMaxLines.

Doc from javax.sound.sampled.Mixer.getMaxLines.

Obtains the approximate maximum number of lines of the requested type that can be open simultaneously on the mixer.

Certain types of mixers do not have a hard bound and may allow opening more lines. Since certain lines are a shared resource, a mixer may not be able to open the maximum number of lines if another process has opened lines of this mixer.

The requested type is any line that matches the description in the provided Line.Info object. For example, if the info object represents a speaker port, and the mixer supports exactly one speaker port, this method should return 1. If the info object represents a source data line and the mixer supports the use of 32 source data lines simultaneously, the return value should be 32. If there is no limit, this function returns AudioSystem#NOT_SPECIFIED.

Annotations
@Override
getMixerIndexback to summary
pack-priv int getMixerIndex()
getPortback to summary
pack-priv Port getPort(int index)
getPortInfoback to summary
private Port.Info getPortInfo(int portIndex, int type)
implCloseback to summary
protected void implClose()

Implements abstract com.sun.media.sound.AbstractMixer.implClose.

Annotations
@Override
implOpenback to summary
protected void implOpen() throws LineUnavailableException

Implements abstract com.sun.media.sound.AbstractMixer.implOpen.

Annotations
@Override
implStartback to summary
protected void implStart()

Implements abstract com.sun.media.sound.AbstractMixer.implStart.

Annotations
@Override
implStopback to summary
protected void implStop()

Implements abstract com.sun.media.sound.AbstractMixer.implStop.

Annotations
@Override
nCloseback to summary
private static native void nClose(long id)
nControlGetFloatValueback to summary
private static native float nControlGetFloatValue(long controlID)
nControlGetIntValueback to summary
private static native int nControlGetIntValue(long controlID)
nControlSetFloatValueback to summary
private static native void nControlSetFloatValue(long controlID, float value)
nControlSetIntValueback to summary
private static native void nControlSetIntValue(long controlID, int value)
nGetControlsback to summary
private static native void nGetControls(long id, int portIndex, Vector<E> vector)
Annotations
@SuppressWarnings:rawtypes
nGetPortCountback to summary
private static native int nGetPortCount(long id)
nGetPortNameback to summary
private static native String nGetPortName(long id, int portIndex)
nGetPortTypeback to summary
private static native int nGetPortType(long id, int portIndex)
nOpenback to summary
private static native long nOpen(int mixerIndex) throws LineUnavailableException
com.sun.media.sound back to summary

private final Class PortMixer.BoolCtrl

extends BooleanControl
Class Inheritance

Private inner class representing a BooleanControl for PortMixerPort.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
PortMixer.BoolCtrl.BCT

inner class for custom types.

Field Summary

Modifier and TypeField and Description
private boolean
private final long

Constructor Summary

AccessConstructor and Description
private
BoolCtrl(long controlID, String name)

private
BoolCtrl(long controlID, BooleanControl.Type typ)

Method Summary

Modifier and TypeMethod and Description
private static BooleanControl.Type
public boolean
getValue()

Overrides javax.sound.sampled.BooleanControl.getValue.

Obtains this control's current value.

public void
setValue(boolean value)

Overrides javax.sound.sampled.BooleanControl.setValue.

Sets the current value for the control.

Inherited from javax.sound.sampled.BooleanControl:
getStateLabeltoString

Field Detail

closedback to summary
private boolean closed
controlIDback to summary
private final long controlID

Constructor Detail

BoolCtrlback to summary
private BoolCtrl(long controlID, String name)
BoolCtrlback to summary
private BoolCtrl(long controlID, BooleanControl.Type typ)

Method Detail

createTypeback to summary
private static BooleanControl.Type createType(String name)
getValueback to summary
public boolean getValue()

Overrides javax.sound.sampled.BooleanControl.getValue.

Doc from javax.sound.sampled.BooleanControl.getValue.

Obtains this control's current value.

Annotations
@Override
setValueback to summary
public void setValue(boolean value)

Overrides javax.sound.sampled.BooleanControl.setValue.

Doc from javax.sound.sampled.BooleanControl.setValue.

Sets the current value for the control. The default implementation simply sets the value as indicated. Some controls require that their line be open before they can be affected by setting a value.

Annotations
@Override
com.sun.media.sound back to summary

private final Class PortMixer.BoolCtrl.BCT

extends Type
Class Inheritance

inner class for custom types.

Constructor Summary

AccessConstructor and Description
private
BCT(String name)

Constructor Detail

BCTback to summary
private BCT(String name)
com.sun.media.sound back to summary

private final Class PortMixer.CompCtrl

extends CompoundControl
Class Inheritance

Private inner class representing a CompoundControl for PortMixerPort.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
PortMixer.CompCtrl.CCT

inner class for custom compound control types.

Constructor Summary

AccessConstructor and Description
private
CompCtrl(String name, Control[] controls)

Method Summary

Inherited from javax.sound.sampled.CompoundControl:
getMemberControlstoString

Constructor Detail

CompCtrlback to summary
private CompCtrl(String name, Control[] controls)
com.sun.media.sound back to summary

private final Class PortMixer.CompCtrl.CCT

extends Type
Class Inheritance

inner class for custom compound control types.

Constructor Summary

AccessConstructor and Description
private
CCT(String name)

Constructor Detail

CCTback to summary
private CCT(String name)
com.sun.media.sound back to summary

private final Class PortMixer.FloatCtrl

extends FloatControl
Class Inheritance

Private inner class representing a BooleanControl for PortMixerPort.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
PortMixer.FloatCtrl.FCT

inner class for custom types.

Field Summary

Modifier and TypeField and Description
private boolean
private final long
private static final FloatControl.Type[]

Constructor Summary

AccessConstructor and Description
private
FloatCtrl(long controlID, String name, float min, float max, float precision, String units)

private
FloatCtrl(long controlID, int type, float min, float max, float precision, String units)

private
FloatCtrl(long controlID, FloatControl.Type typ, float min, float max, float precision, String units)

Method Summary

Modifier and TypeMethod and Description
public float
getValue()

Overrides javax.sound.sampled.FloatControl.getValue.

Obtains this control's current value.

public void
setValue(float value)

Overrides javax.sound.sampled.FloatControl.setValue.

Sets the current value for the control.

Inherited from javax.sound.sampled.FloatControl:
getMaximumgetMaxLabelgetMidLabelgetMinimumgetMinLabelgetPrecisiongetUnitsgetUpdatePeriodshifttoString

Field Detail

closedback to summary
private boolean closed
controlIDback to summary
private final long controlID
FLOAT_CONTROL_TYPESback to summary
private static final FloatControl.Type[] FLOAT_CONTROL_TYPES

Constructor Detail

FloatCtrlback to summary
private FloatCtrl(long controlID, String name, float min, float max, float precision, String units)
FloatCtrlback to summary
private FloatCtrl(long controlID, int type, float min, float max, float precision, String units)
FloatCtrlback to summary
private FloatCtrl(long controlID, FloatControl.Type typ, float min, float max, float precision, String units)

Method Detail

getValueback to summary
public float getValue()

Overrides javax.sound.sampled.FloatControl.getValue.

Doc from javax.sound.sampled.FloatControl.getValue.

Obtains this control's current value.

Annotations
@Override
setValueback to summary
public void setValue(float value)

Overrides javax.sound.sampled.FloatControl.setValue.

Doc from javax.sound.sampled.FloatControl.setValue.

Sets the current value for the control. The default implementation simply sets the value as indicated. If the value indicated is greater than the maximum value, or smaller than the minimum value, an IllegalArgumentException is thrown. Some controls require that their line be open before they can be affected by setting a value.

Annotations
@Override
com.sun.media.sound back to summary

private final Class PortMixer.FloatCtrl.FCT

extends Type
Class Inheritance

inner class for custom types.

Constructor Summary

AccessConstructor and Description
private
FCT(String name)

Constructor Detail

FCTback to summary
private FCT(String name)
com.sun.media.sound back to summary

private final Class PortMixer.PortInfo

extends Info
Class Inheritance

Private inner class representing a port info.

Field Summary

Inherited from javax.sound.sampled.Port.Info:
COMPACT_DISCHEADPHONELINE_INLINE_OUTMICROPHONESPEAKER

Constructor Summary

AccessConstructor and Description
private
PortInfo(String name, boolean isSource)

Method Summary

Inherited from javax.sound.sampled.Port.Info:
equalsgetNamehashCodeisSourcematchestoString

Constructor Detail

PortInfoback to summary
private PortInfo(String name, boolean isSource)
com.sun.media.sound back to summary

private final Class PortMixer.PortMixerPort

extends AbstractLine
implements Port
Class Inheritance
All Implemented Interfaces
javax.sound.sampled.Port, javax.sound.sampled.Line, java.lang.AutoCloseable

Private inner class representing a Port for the PortMixer.

Field Summary

Modifier and TypeField and Description
private long
private final int
Inherited from com.sun.media.sound.AbstractLine:
controlsinfomixer

Constructor Summary

AccessConstructor and Description
private
PortMixerPort(Port.Info info, PortMixer mixer, int portIndex)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements abstract com.sun.media.sound.AbstractLine.close.

Implements javax.sound.sampled.Line.close.

Closes the line, indicating that any system resources in use by the line can be released.

private void
private void
enableControls(Control[] controls, boolean enable)

pack-priv void
pack-priv void
public void
open()

Implements abstract com.sun.media.sound.AbstractLine.open.

Implements javax.sound.sampled.Line.open.

Opens the line, indicating that it should acquire any required system resources and become operational.

Inherited from com.sun.media.sound.AbstractLine:
addLineListenergetControlgetControlsgetEventDispatchergetFramePositiongetLineInfogetLongFramePositiongetMixerisControlSupportedisOpenremoveLineListenersendEventssetOpen

Field Detail

idback to summary
private long id
portIndexback to summary
private final int portIndex

Constructor Detail

PortMixerPortback to summary
private PortMixerPort(Port.Info info, PortMixer mixer, int portIndex)

Method Detail

closeback to summary
public void close()

Implements abstract com.sun.media.sound.AbstractLine.close.

Implements javax.sound.sampled.Line.close.

Doc from javax.sound.sampled.Line.close.

Closes the line, indicating that any system resources in use by the line can be released. If this operation succeeds, the line is marked closed and a CLOSE event is dispatched to the line's listeners.

Annotations
@Override
disposeControlsback to summary
private void disposeControls()
enableControlsback to summary
private void enableControls(Control[] controls, boolean enable)
implCloseback to summary
pack-priv void implClose()
implOpenback to summary
pack-priv void implOpen() throws LineUnavailableException
openback to summary
public void open() throws LineUnavailableException

Implements abstract com.sun.media.sound.AbstractLine.open.

Implements javax.sound.sampled.Line.open.

Doc from javax.sound.sampled.Line.open.

Opens the line, indicating that it should acquire any required system resources and become operational. If this operation succeeds, the line is marked as open, and an OPEN event is dispatched to the line's listeners.

Note that some lines, once closed, cannot be reopened. Attempts to reopen such a line will always result in an LineUnavailableException.

Some types of lines have configurable properties that may affect resource allocation. For example, a DataLine must be opened with a particular format and buffer size. Such lines should provide a mechanism for configuring these properties, such as an additional open method or methods which allow an application to specify the desired settings.

This method takes no arguments, and opens the line with the current settings. For SourceDataLine and TargetDataLine objects, this means that the line is opened with default settings. For a Clip, however, the buffer size is determined when data is loaded. Since this method does not allow the application to specify any data to load, an IllegalArgumentException is thrown. Therefore, you should instead use one of the open methods provided in the Clip interface to load data into the Clip.

For DataLine's, if the DataLine.Info object which was used to retrieve the line, specifies at least one fully qualified audio format, the last one will be used as the default format.

Annotations
@Override
Exceptions
LineUnavailableException:
if the line cannot be opened due to resource restrictions