Package voltage.core

# Class VoltageMidiJack

java.lang.Object
voltage.core.VoltageComponent
voltage.core.MultiJack
voltage.core.VoltageMidiJack

public class VoltageMidiJack extends MultiJack
This is a multi-jack of MIDI jacks. This contains multiple MIDI jacks.

- ## Field Summary

  ### Fields inherited from class voltage.core.MultiJack

  `INITIAL_JACKS_PER_MULTIJACK`

  ### Fields inherited from class voltage.core.VoltageComponent

  `componentName, displayName`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VoltageMidiJack(String name, String displayName, VoltageModule module, Jack.JackType type)`
  Constructs a MIDI Jack
  `VoltageMidiJack(String name, VoltageModule module, Jack.JackType type)`
  Constructs a MIDI Jack

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `AddMessage(ShortMessage message)`
  Add a MIDI message to the jack.
  `void`
  `ClearMessages()`
  Called by readers if they want to force a cable to be cleared.
  `void`
  `ClearMessagesBeforeWriting()`
  Called by writers if they want to force cables to be cleared of MIDI messages before writing to them.
  `ArrayList<ShortMessage>`
  `GetMessages()`
  Get any MIDI messages.

  ### Methods inherited from class voltage.core.MultiJack

  `IsConnected`

  ### Methods inherited from class voltage.core.VoltageComponent

  `AddChildComponent, GetComponentID, GetDisplayName, GetHeight, GetMaxValue, GetMinValue, GetRect, GetSkin, GetTooltipText, GetTransparency, GetUserProperty, GetValue, GetWidth, GetX, GetY, IsEnabled, IsVisible, RemoveChildComponent, SetCanBeAutomated, SetEnabled, SetPosition, SetRect, SetRect, SetSize, SetSkin, SetTransparency, SetUnits, SetUserProperty, SetValue, SetValue, SetValueNoNotification, SetVisible, SetWantsMouseNotifications, SetZOrder, SkewNormalizedValue, UpdateGUIValue, WantsMouseNotifications`

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

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

- ## Constructor Details

  - ### VoltageMidiJack

    public VoltageMidiJack(String name, VoltageModule module, Jack.JackType type)
    Constructs a MIDI Jack
    Parameters:
      `name` - the name of the jack.
      `module` - the module this belongs to.

  - ### VoltageMidiJack

    public VoltageMidiJack(String name, String displayName, VoltageModule module, Jack.JackType type)
    Constructs a MIDI Jack
    Parameters:
      `name` - the name of the jack.
      `displayName` - the display name of the jack.
      `module` - the module this belongs to.

- ## Method Details

  - ### AddMessage

    public void AddMessage(ShortMessage message)
    Add a MIDI message to the jack.
    Parameters:
      `message` - the ShortMessage to add.

  - ### GetMessages

    public ArrayList<ShortMessage> GetMessages()
    Get any MIDI messages. If there are not any messages this will return null. Ensure checking for null.
    Returns:
      the array list of MIDI ShortMessage's.

  - ### ClearMessages

    public void ClearMessages()
    Called by readers if they want to force a cable to be cleared. However, should not be necessary to call this, as a call to GetMessages will also clear messages.

  - ### ClearMessagesBeforeWriting

    public void ClearMessagesBeforeWriting()
    Called by writers if they want to force cables to be cleared of MIDI messages before writing to them. Should not be necessary to call this, but if a faulty module fails to read messages from its jacks, they could pile up.