Class NormalizedParameter

java.lang.Object
heronarts.lx.parameter.NormalizedParameter
All Implemented Interfaces:
LXPath, LXNormalizedParameter, LXParameter

public class NormalizedParameter extends Object implements LXNormalizedParameter
Simple normalized parameter which is not listenable.
  • Constructor Details

    • NormalizedParameter

      public NormalizedParameter(String label)
    • NormalizedParameter

      public NormalizedParameter(String label, double value)
  • Method Details

    • setComponent

      public NormalizedParameter setComponent(LXComponent component, String path)
      Description copied from interface: LXParameter
      Sets the component that owns this parameter
      Specified by:
      setComponent in interface LXParameter
      Parameters:
      component - Component
      path - Path name for parameter
      Returns:
      this
    • getParent

      public LXComponent getParent()
      Description copied from interface: LXPath
      Returns the component that this object belongs to
      Specified by:
      getParent in interface LXPath
      Returns:
      Parent component of this path object, or null if it is unowned
    • getPath

      public String getPath()
      Description copied from interface: LXPath
      Returns the immediate path of this component, relative to its parent
      Specified by:
      getPath in interface LXPath
      Returns:
      Path of this object relative to its parent component
    • setDescription

      public NormalizedParameter setDescription(String description)
    • getDescription

      public String getDescription()
      Description copied from interface: LXPath
      Returns a contextual help message explaining the purpose of this parameter or component to the user, or null if none is available.
      Specified by:
      getDescription in interface LXPath
      Returns:
      Contextual help string explaining purpose of the element
    • getFormatter

      public LXParameter.Formatter getFormatter()
      Description copied from interface: LXParameter
      Gets the formatter to be used for printing this parameter's value
      Specified by:
      getFormatter in interface LXParameter
      Returns:
      Formatter
    • setFormatter

      public NormalizedParameter setFormatter(LXParameter.Formatter formatter)
      Description copied from interface: LXParameter
      Sets the formatter used for printing this parameter's value
      Specified by:
      setFormatter in interface LXParameter
      Parameters:
      formatter - Formatter
      Returns:
      The parameter
    • getUnits

      public LXParameter.Units getUnits()
      Description copied from interface: LXParameter
      Gets the unit format that this parameter's value stores.
      Specified by:
      getUnits in interface LXParameter
      Returns:
      Units
    • getPolarity

      public LXParameter.Polarity getPolarity()
      Description copied from interface: LXParameter
      Gets the polarity of this parameter.
      Specified by:
      getPolarity in interface LXParameter
      Returns:
      polarity of this parameter
    • dispose

      public void dispose()
      Description copied from interface: LXParameter
      Invoked when the parameter is done being used and none of its resources are needed anymore.
      Specified by:
      dispose in interface LXParameter
    • reset

      public NormalizedParameter reset()
      Description copied from interface: LXParameter
      A method to reset the value of the parameter, if a default is available. Not necessarily defined for all parameters, may be ignored.
      Specified by:
      reset in interface LXParameter
      Returns:
      this
    • setValue

      public NormalizedParameter setValue(double value)
      Description copied from interface: LXParameter
      Sets the value of the parameter.
      Specified by:
      setValue in interface LXParameter
      Parameters:
      value - The value
      Returns:
      this
    • getValue

      public double getValue()
      Description copied from interface: LXParameter
      Retrieves the value of the parameter
      Specified by:
      getValue in interface LXParameter
      Returns:
      Parameter value
    • getLabel

      public String getLabel()
      Description copied from interface: LXParameter
      Gets the label for this parameter
      Specified by:
      getLabel in interface LXParameter
      Specified by:
      getLabel in interface LXPath
      Returns:
      Label of parameter
    • setNormalized

      public NormalizedParameter setNormalized(double value)
      Description copied from interface: LXNormalizedParameter
      Sets the value or the parameter in normalized space from 0 to 1
      Specified by:
      setNormalized in interface LXNormalizedParameter
      Parameters:
      value - The normalized value, from 0 to 1
      Returns:
      this, for method chaining
    • getNormalized

      public double getNormalized()
      Description copied from interface: LXNormalizedParameter
      Gets the value of the parameter in a normalized space from 0 to 1
      Specified by:
      getNormalized in interface LXNormalizedParameter
      Returns:
      Value of parameter, normalized to range from 0 to 1
    • getNormalizedf

      public float getNormalizedf()
      Description copied from interface: LXNormalizedParameter
      Gets the value of the parameter in a normalized space as a float
      Specified by:
      getNormalizedf in interface LXNormalizedParameter
      Returns:
      Normalized value of parameter, in range from 0 to 1
    • getExponent

      public double getExponent()
      Description copied from interface: LXNormalizedParameter
      Gets the exponent used for scaling this parameter across its normalized range. Default is 1 which means linear scaling.
      Specified by:
      getExponent in interface LXNormalizedParameter
      Returns:
      scaling exponent
    • isMappable

      public boolean isMappable()
      Description copied from interface: LXParameter
      Whether this parameter should be eligible for mapping via MIDI or modulation control.
      Specified by:
      isMappable in interface LXParameter
      Returns:
      true if mappable, false if otherwise