javax.sound.sampled

Class EnumControl


  • public abstract class EnumControl
    extends 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 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
    • Constructor Detail

      • EnumControl

        protected EnumControl(EnumControl.Type type,
                   Object[] values,
                   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

        public void setValue(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 - if the value indicated does not fall within the allowable range
      • getValue

        public Object getValue()
        Obtains this control's current value.
        Returns:
        the current value
      • getValues

        public Object[] getValues()
        Returns the set of possible values for this control.
        Returns:
        the set of possible values
      • toString

        public String toString()
        Provides a string representation of the control.
        Overrides:
        toString in class Control
        Returns:
        a string description

Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/sound/sampled/enumcontrol.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : https://docs.oracle.com

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut