java.lang.Object | ||
↳ | javax.sound.sampled.Control | |
↳ | javax.sound.sampled.BooleanControl |
A BooleanControl
provides the ability to switch between
two possible settings that affect a line's audio. The settings are boolean
values (true
and false
). A graphical user interface
might represent the control by a two-state button, an on/off switch, two
mutually exclusive buttons, or a checkbox (among other possibilities).
For example, depressing a button might activate a
control to silence
the line's audio.
MUTE
As with other
subclasses, a method is
provided that returns string labels for the values, suitable for
display in the user interface.Control
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
BooleanControl.Type | An instance of the BooleanControl.Type class identifies one kind of
boolean control. |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new boolean control object with the given parameters.
| |||||||||||
Constructs a new boolean control object with the given parameters.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Obtains the label for the specified state.
| |||||||||||
Obtains this control's current value.
| |||||||||||
Sets the current value for the control.
| |||||||||||
Provides a string representation of the control
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Constructs a new boolean control object with the given parameters.
type | the type of control represented this float control object |
---|---|
initialValue | the initial control value |
trueStateLabel | the label for the state represented by true ,
such as "true" or "on." |
falseStateLabel | the label for the state represented by false ,
such as "false" or "off."
|
Constructs a new boolean control object with the given parameters.
The labels for the true
and false
states
default to "true" and "false."
type | the type of control represented by this float control object |
---|---|
initialValue | the initial control value |
Obtains the label for the specified state.
true
, or "false" or "off" for false
.
Obtains this control's current value.
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.
value | desired new value. |
---|
Provides a string representation of the control