|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.sound.sampled.Control javax.sound.sampled.FloatControl
public abstract class FloatControl
A FloatControl
object provides control over a range of
floating-point values. Float controls are often
represented in graphical user interfaces by continuously
adjustable objects such as sliders or rotary knobs. Concrete subclasses
of FloatControl
implement controls, such as gain and pan, that
affect a line's audio signal in some way that an application can manipulate.
The
inner class provides static instances of types that are used to
identify some common kinds of float control.
FloatControl.Type
The FloatControl
abstract class provides methods to set and get
the control's current floating-point value. Other methods obtain the possible
range of values and the control's resolution (the smallest increment between
returned values). Some float controls allow ramping to a
new value over a specified period of time. FloatControl
also
includes methods that return string labels for the minimum, maximum, and midpoint
positions of the control.
Line.getControls()
,
Line.isControlSupported(javax.sound.sampled.Control.Type)
Nested Class Summary | |
---|---|
static class |
FloatControl.Type
An instance of the FloatControl.Type inner class identifies one kind of
float control. |
Constructor Summary | |
---|---|
protected |
FloatControl(FloatControl.Type type,
float minimum,
float maximum,
float precision,
int updatePeriod,
float initialValue,
String units)
Constructs a new float control object with the given parameters. |
protected |
FloatControl(FloatControl.Type type,
float minimum,
float maximum,
float precision,
int updatePeriod,
float initialValue,
String units,
String minLabel,
String midLabel,
String maxLabel)
Constructs a new float control object with the given parameters |
Method Summary | |
---|---|
float |
getMaximum()
Obtains the maximum value permitted. |
String |
getMaxLabel()
Obtains the label for the maximum value, such as "Right" or "Full." |
String |
getMidLabel()
Obtains the label for the mid-point value, such as "Center" or "Default." |
float |
getMinimum()
Obtains the minimum value permitted. |
String |
getMinLabel()
Obtains the label for the minimum value, such as "Left" or "Off." |
float |
getPrecision()
Obtains the resolution or granularity of the control, in the units that the control measures. |
String |
getUnits()
Obtains the label for the units in which the control's values are expressed, such as "dB" or "frames per second." |
int |
getUpdatePeriod()
Obtains the smallest time interval, in microseconds, over which the control's value can change during a shift. |
float |
getValue()
Obtains this control's current value. |
void |
setValue(float newValue)
Sets the current value for the control. |
void |
shift(float from,
float to,
int microseconds)
Changes the control value from the initial value to the final value linearly over the specified time period, specified in microseconds. |
String |
toString()
Provides a string representation of the control |
Methods inherited from class javax.sound.sampled.Control |
---|
getType |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected FloatControl(FloatControl.Type type, float minimum, float maximum, float precision, int updatePeriod, float initialValue, String units, String minLabel, String midLabel, String maxLabel)
type
- the kind of control represented by this float control objectminimum
- the smallest value permitted for the controlmaximum
- the largest value permitted for the controlprecision
- the resolution or granularity of the control.
This is the size of the increment between discrete valid values.updatePeriod
- the smallest time interval, in microseconds, over which the control
can change from one discrete value to the next during a shift
initialValue
- the value that the control starts with when constructedunits
- the label for the units in which the control's values are expressed,
such as "dB" or "frames per second"minLabel
- the label for the minimum value, such as "Left" or "Off"midLabel
- the label for the midpoint value, such as "Center" or "Default"maxLabel
- the label for the maximum value, such as "Right" or "Full"protected FloatControl(FloatControl.Type type, float minimum, float maximum, float precision, int updatePeriod, float initialValue, String units)
type
- the kind of control represented by this float control objectminimum
- the smallest value permitted for the controlmaximum
- the largest value permitted for the controlprecision
- the resolution or granularity of the control.
This is the size of the increment between discrete valid values.updatePeriod
- the smallest time interval, in microseconds, over which the control
can change from one discrete value to the next during a shift
initialValue
- the value that the control starts with when constructedunits
- the label for the units in which the control's values are expressed,
such as "dB" or "frames per second"Method Detail |
---|
public void setValue(float newValue)
newValue
- desired new value
IllegalArgumentException
- if the value indicated does not fall
within the allowable rangepublic float getValue()
public float getMaximum()
public float getMinimum()
public String getUnits()
public String getMinLabel()
public String getMidLabel()
public String getMaxLabel()
public float getPrecision()
public int getUpdatePeriod()
shift(float, float, int)
public void shift(float from, float to, int microseconds)
from
- initial value at the beginning of the shiftto
- final value after the shiftmicroseconds
- maximum duration of the shift in microsecondsgetUpdatePeriod()
public String toString()
toString
in class Control
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.