javax.sound.sampled
Class EnumControl

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.sound.sampled.Control sample code for javax.sound.sampled.Control definition code for javax.sound.sampled.Control 
      extended by javax.sound.sampled.EnumControl

public abstract class EnumControl
extends Control sample code for javax.sound.sampled.Control definition code for javax.sound.sampled.Control

A 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 sample code for javax.sound.sampled.FloatControl definition code for javax.sound.sampled.FloatControl objects.

Controls that provide a choice between only two settings can often be implemented instead as a BooleanControl sample code for javax.sound.sampled.BooleanControl definition code for javax.sound.sampled.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 sample code for javax.sound.sampled.EnumControl.Type.REVERB definition code for javax.sound.sampled.EnumControl.Type.REVERB control are instances of ReverbType sample code for javax.sound.sampled.ReverbType definition code for javax.sound.sampled.ReverbType that can be queried for the parameter values used for each setting.

Since:
1.3

Nested Class Summary
static class EnumControl.Type sample code for javax.sound.sampled.EnumControl.Type definition code for javax.sound.sampled.EnumControl.Type
          An instance of the EnumControl.Type inner class identifies one kind of enumerated control.
 
Constructor Summary
protected EnumControl sample code for javax.sound.sampled.EnumControl.EnumControl(javax.sound.sampled.EnumControl.Type, java.lang.Object[], java.lang.Object) definition code for javax.sound.sampled.EnumControl.EnumControl(javax.sound.sampled.EnumControl.Type, java.lang.Object[], java.lang.Object) (EnumControl.Type sample code for javax.sound.sampled.EnumControl.Type definition code for javax.sound.sampled.EnumControl.Type  type, Object sample code for java.lang.Object definition code for java.lang.Object [] values, Object sample code for java.lang.Object definition code for java.lang.Object  value)
          Constructs a new enumerated control object with the given parameters.
 
Method Summary
 Object sample code for java.lang.Object definition code for java.lang.Object getValue sample code for javax.sound.sampled.EnumControl.getValue() definition code for javax.sound.sampled.EnumControl.getValue() ()
          Obtains this control's current value.
 Object sample code for java.lang.Object definition code for java.lang.Object [] getValues sample code for javax.sound.sampled.EnumControl.getValues() definition code for javax.sound.sampled.EnumControl.getValues() ()
          Returns the set of possible values for this control.
 void setValue sample code for javax.sound.sampled.EnumControl.setValue(java.lang.Object) definition code for javax.sound.sampled.EnumControl.setValue(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  value)
          Sets the current value for the control.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for javax.sound.sampled.EnumControl.toString() definition code for javax.sound.sampled.EnumControl.toString() ()
          Provides a string representation of the control.
 
Methods inherited from class javax.sound.sampled.Control sample code for javax.sound.sampled.Control definition code for javax.sound.sampled.Control
getType sample code for javax.sound.sampled.Control.getType() definition code for javax.sound.sampled.Control.getType()
 
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() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , 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() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , 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)
 

Constructor Detail

EnumControl sample code for javax.sound.sampled.EnumControl(javax.sound.sampled.EnumControl.Type, java.lang.Object[], java.lang.Object) definition code for javax.sound.sampled.EnumControl(javax.sound.sampled.EnumControl.Type, java.lang.Object[], java.lang.Object)

protected EnumControl(EnumControl.Type sample code for javax.sound.sampled.EnumControl.Type definition code for javax.sound.sampled.EnumControl.Type  type,
                      Object sample code for java.lang.Object definition code for java.lang.Object [] values,
                      Object sample code for java.lang.Object definition code for java.lang.Object  value)
Constructs a new enumerated control object with the given parameters.

Parameters:
type - the type of control represented this enumerated control object
values - the set of possible values for the control
value - the initial control value
Method Detail

setValue sample code for javax.sound.sampled.EnumControl.setValue(java.lang.Object) definition code for javax.sound.sampled.EnumControl.setValue(java.lang.Object)

public void setValue(Object sample code for java.lang.Object definition code for java.lang.Object  value)
Sets the current value for the control. The default implementation simply sets the value as indicated. If the value indicated is not supported, an IllegalArgumentException 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 sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the value indicated does not fall within the allowable range

getValue sample code for javax.sound.sampled.EnumControl.getValue() definition code for javax.sound.sampled.EnumControl.getValue()

public Object sample code for java.lang.Object definition code for java.lang.Object  getValue()
Obtains this control's current value.

Returns:
the current value

getValues sample code for javax.sound.sampled.EnumControl.getValues() definition code for javax.sound.sampled.EnumControl.getValues()

public Object sample code for java.lang.Object definition code for java.lang.Object [] getValues()
Returns the set of possible values for this control.

Returns:
the set of possible values

toString sample code for javax.sound.sampled.EnumControl.toString() definition code for javax.sound.sampled.EnumControl.toString()

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

Overrides:
toString sample code for javax.sound.sampled.Control.toString() definition code for javax.sound.sampled.Control.toString() in class Control sample code for javax.sound.sampled.Control definition code for javax.sound.sampled.Control
Returns:
a string description