Package voltage.core

# Class VoltageComponent

java.lang.Object
voltage.core.VoltageComponent

Direct Known Subclasses:
  `Jack`, `MultiJack`, `VoltageAnalogVUMeter`, `VoltageAudioBus`, `VoltageAudioDevice`, `VoltageButton`, `VoltageCable`, `VoltageCanvas`, `VoltageCurve`, `VoltageDigitalCounter`, `VoltageEllipse`, `VoltageImage`, `VoltageKeyboard`, `VoltageKnob`, `VoltageLabel`, `VoltageLED`, `VoltageLine`, `VoltageMidiBus`, `VoltagePluginHost`, `VoltagePolyBus`, `VoltageRectangle`, `VoltageRemoteControl`, `VoltageScrollbar`, `VoltageSlider`, `VoltageSound`, `VoltageSwitch`, `VoltageViewport`, `VoltageVUMeter`

public abstract class VoltageComponent extends Object
VoltageComponent is the base class for knobs, sliders, buttons and other controls. You can do basic operations on these

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final String`
  `componentName`
  `final String`
  `displayName`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `AddChildComponent(VoltageComponent child)`
  Add a child component to this component.
  `long`
  `GetComponentID()`
  Gets the ID
  `String`
  `GetDisplayName()`
  Returns the object's display name.
  `int`
  `GetHeight()`
  Returns the height
  `double`
  `GetMaxValue()`
  Returns the maximum value.
  `double`
  `GetMinValue()`
  Returns the minimum value.
  `Rectangle`
  `GetRect()`
  Gets the bounding rectangle of this control.
  `String`
  `GetSkin()`
  Returns name of skin used on this control
  `String`
  `GetTooltipText()`
  Returns the tooltip
  `double`
  `GetTransparency()`
  Gets the transparency level
  `Object`
  `GetUserProperty(String property)`
  Retrieve the properties for a control.
  `double`
  `GetValue()`
  Returns the value of this control.
  `int`
  `GetWidth()`
  Returns the width
  `int`
  `GetX()`
  Returns X
  `int`
  `GetY()`
  Returns Y
  `boolean`
  `IsEnabled()`
  Returns state of enablement
  `boolean`
  `IsVisible()`
  Returns visibility.
  `boolean`
  `RemoveChildComponent(VoltageComponent child)`
  Remove a child component from this component.
  `void`
  `SetCanBeAutomated(boolean bCanBeAutomated)`
  Can the control be automated?
  `void`
  `SetEnabled(boolean isEnabled)`
  Set to be enabled or disabled.
  `void`
  `SetPosition(int x, int y)`
  Set the position of this control.
  `void`
  `SetRect(int x, int y, int width, int height)`
  Set the position and size of this control.
  `void`
  `SetRect(Rectangle newRect)`
  Sets the position and size of this control.
  `void`
  `SetSize(int width, int height)`
  Set the size of this control.
  `void`
  `SetSkin(String skinResourceName)`
  Sets a new skin.
  `void`
  `SetTransparency(double transparency)`
  Sets the transparency of this control.
  `void`
  `SetUnits(String units)`
  Define the units for this control.
  `void`
  `SetUserProperty(String property, Object value)`
  Set or create any properties for a control.
  `void`
  `SetValue(double newValue)`
  Sets the value of the control.
  `void`
  `SetValue(double newValue, boolean bUpdateGUI)`
  Sets the value of a the control
  `void`
  `SetValueNoNotification(double newValue, boolean bUpdateGUI)`
  Sets the value of the control without sending a Notification.
  `void`
  `SetVisible(boolean isVisible)`
  Set to be visible or hidden.
  `void`
  `SetWantsMouseNotifications(boolean bWants)`
  Sets whether the control wants mouse notifications Messages would be sent to the module's Notify().
  `void`
  `SetZOrder(int zorder)`
  Updates the control z order.
  `double`
  `SkewNormalizedValue(double input)`
  Adjusts a normalized control value (0-1.0) to account for skew settings
  `void`
  `UpdateGUIValue(double newValue)`
  Updates the GUI value of the control
  `boolean`
  `WantsMouseNotifications()`
  Returns whether the object wants mouse notifications.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### componentName

    public final String componentName

  - ### displayName

    public final String displayName

- ## Method Details

  - ### GetComponentID

    public long GetComponentID()
    Gets the ID
    Returns:
      the component's ID

  - ### GetTooltipText

    public String GetTooltipText()
    Returns the tooltip
    Returns:
      The tool tip text for this control

  - ### GetValue

    public double GetValue()
    Returns the value of this control.
    Returns:
      the value of the control

  - ### SetValue

    public void SetValue(double newValue)
    Sets the value of the control.
    Parameters:
      `newValue` - the value to set

  - ### UpdateGUIValue

    public void UpdateGUIValue(double newValue)
    Updates the GUI value of the control
    Parameters:
      `newValue` - visible value of the control.

  - ### SetValue

    public void SetValue(double newValue, boolean bUpdateGUI)
    Sets the value of a the control
    Parameters:
      `newValue` - the value to set
      `bUpdateGUI` - flag to update the GUI. (Updating the GUI can be CPU intensive. Only do this if necessary)

  - ### SetValueNoNotification

    public void SetValueNoNotification(double newValue, boolean bUpdateGUI)
    Sets the value of the control without sending a Notification.
    Parameters:
      `newValue` - the value to set

  - ### GetMinValue

    public double GetMinValue()
    Returns the minimum value.
    Returns:
      the min value for the control

  - ### GetMaxValue

    public double GetMaxValue()
    Returns the maximum value.
    Returns:
      the max value for the control

  - ### SetUserProperty

    public void SetUserProperty(String property, Object value)
    Set or create any properties for a control.
    Parameters:
      `property` - the name of the property
      `value` - the value of the property

  - ### GetUserProperty

    public Object GetUserProperty(String property)
    Retrieve the properties for a control.
    Parameters:
      `property` - the name of the property
    Returns:
      returns the value of the property

  - ### SetUnits

    public void SetUnits(String units)
    Define the units for this control. Not everything is in Hz or Volts. Maybe it's in goobers? As in 0 to 100 goobers.
    Parameters:
      `units` - the name of the unit.

  - ### AddChildComponent

    public boolean AddChildComponent(VoltageComponent child)
    Add a child component to this component. Moving the component will also move any children objects.
    Parameters:
      `child` - the child component.
    Returns:
      true on success.

  - ### RemoveChildComponent

    public boolean RemoveChildComponent(VoltageComponent child)
    Remove a child component from this component.
    Parameters:
      `child` - the child component.
    Returns:
      true on success.

  - ### SetPosition

    public void SetPosition(int x, int y)
    Set the position of this control.
    Parameters:
      `x` - leftmost position
      `y` - top position

  - ### SetSize

    public void SetSize(int width, int height)
    Set the size of this control.
    Parameters:
      `width` - width of control
      `height` - height of control

  - ### SetRect

    public void SetRect(int x, int y, int width, int height)
    Set the position and size of this control.
    Parameters:
      `x` - leftmost position
      `y` - top position
      `width` - width of control
      `height` - height of control

  - ### SetRect

    public void SetRect(Rectangle newRect)
    Sets the position and size of this control.
    Parameters:
      `newRect` - the new rectangle.

  - ### GetRect

    public Rectangle GetRect()
    Gets the bounding rectangle of this control.
    Returns:
      the rectangle indicating size and position of this control.

  - ### GetWidth

    public int GetWidth()
    Returns the width
    Returns:
      the width of this control.

  - ### GetHeight

    public int GetHeight()
    Returns the height
    Returns:
      the height of this control.

  - ### GetX

    public int GetX()
    Returns X
    Returns:
      the (left) x position of this control.

  - ### GetY

    public int GetY()
    Returns Y
    Returns:
      the (top) y position of this control.

  - ### SetVisible

    public void SetVisible(boolean isVisible)
    Set to be visible or hidden.
    Parameters:
      `isVisible` - sets the control to be visible or hidden.

  - ### IsVisible

    public boolean IsVisible()
    Returns visibility.
    Returns:
      visible state. true = visible. false = hidden

  - ### SetEnabled

    public void SetEnabled(boolean isEnabled)
    Set to be enabled or disabled.
    Parameters:
      `isEnabled` - sets the control to be enabled or disabled.

  - ### IsEnabled

    public boolean IsEnabled()
    Returns state of enablement
    Returns:
      enabled state. true = visible. false = hidden

  - ### SetSkin

    public void SetSkin(String skinResourceName)
    Sets a new skin.
    Parameters:
      `skinResourceName` - the name of the skin to set.

  - ### GetSkin

    public String GetSkin()
    Returns name of skin used on this control
    Returns:
      name of skin

  - ### SetTransparency

    public void SetTransparency(double transparency)
    Sets the transparency of this control.
    Parameters:
      `transparency` - 0 - opaque and 1.0 = fully transparent.

  - ### GetTransparency

    public double GetTransparency()
    Gets the transparency level
    Returns:
      the transparency level 0 - opaque and 1.0 = fully transparent.

  - ### SetWantsMouseNotifications

    public void SetWantsMouseNotifications(boolean bWants)
    Sets whether the control wants mouse notifications Messages would be sent to the module's Notify(). Messages can be one of the following: Object_MouseMove Object_MouseLeave Object_LeftButtonDown Object_LeftButtonUp Object_RightButtonDown Object_RightButtonUp
    Parameters:
      `bWants` - set to true to receive mouse notifications in your module.
    See Also:
      - `VoltageModule.ModuleNotifications`

  - ### WantsMouseNotifications

    public boolean WantsMouseNotifications()
    Returns whether the object wants mouse notifications.
    Returns:
      if the control wants mouse notifications.

  - ### GetDisplayName

    public String GetDisplayName()
    Returns the object's display name.
    Returns:
      The object's display name.

  - ### SetCanBeAutomated

    public void SetCanBeAutomated(boolean bCanBeAutomated)
    Can the control be automated?
    Parameters:
      `bCanBeAutomated` - flag to determine if it can be automated from the DAW

  - ### SetZOrder

    public void SetZOrder(int zorder)
    Updates the control z order.
    Parameters:
      `zorder` - the new z-order for the control. Higher z-order controls will display over lower z-order controls. 0 is the bottom. Use -1 to place it at the top.

  - ### SkewNormalizedValue

    public double SkewNormalizedValue(double input)
    Adjusts a normalized control value (0-1.0) to account for skew settings
    Parameters:
      `input` - the normalized control value, from 0 to 1.0.
    Returns:
      the adjusted normalzied value, accounting for control skew settings