Class EnumControl
java.lang.Object
javax.sound.sampled.Control
javax.sound.sampled.EnumControl
An
EnumControl
provides control over a set of discrete possible
values, each represented by an object. In a graphical user interface, such a
control might be represented by a set of buttons, each of which chooses one
value or setting. For example, a reverb control might provide several preset
reverberation settings, instead of providing continuously adjustable
parameters of the sort that would be represented by FloatControl
objects.
Controls that provide a choice between only two settings can often be
implemented instead as a BooleanControl
, and controls that provide a
set of values along some quantifiable dimension might be implemented instead
as a FloatControl
with a coarse resolution. However, a key feature of
EnumControl
is that the returned values are arbitrary objects, rather
than numerical or boolean values. This means that each returned object can
provide further information. As an example, the settings of a
REVERB
control are instances of
ReverbType
that can be queried for the parameter values used for each
setting.
- Since:
- 1.3
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
An instance of theEnumControl.Type
inner class identifies one kind of enumerated control. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
EnumControl
(EnumControl.Type type, Object[] values, Object value) Constructs a new enumerated control object with the given parameters. -
Method Summary
Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Modifier and TypeMethodDescriptionprotected Object
clone()
Creates and returns a copy of this object.boolean
Indicates whether some other object is "equal to" this one.protected void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class
<?> getClass()
Returns the runtime class of thisObject
.int
hashCode()
Returns a hash code value for this object.final void
notify()
Wakes up a single thread that is waiting on this object's monitor.final void
Wakes up all threads that are waiting on this object's monitor.final void
wait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final void
wait
(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final void
wait
(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Constructor Details
-
EnumControl
Constructs a new enumerated control object with the given parameters.- Parameters:
type
- the type of control represented this enumerated control objectvalues
- the set of possible values for the controlvalue
- the initial control value
-
-
Method Details
-
setValue
Sets the current value for the control. The default implementation simply sets the value as indicated. If the value indicated is not supported, anIllegalArgumentException
is thrown. Some controls require that their line be open before they can be affected by setting a value.- Parameters:
value
- the desired new value- Throws:
IllegalArgumentException
- if the value indicated does not fall within the allowable range
-
getValue
-
getValues
Returns the set of possible values for this control.- Returns:
- the set of possible values
-
toString
-