Class LXMidiDevice

java.lang.Object
heronarts.lx.midi.LXMidiDevice
Direct Known Subclasses:
LXMidiInput, LXMidiOutput

public abstract class LXMidiDevice extends Object
  • Field Details

    • engine

      protected final LXMidiEngine engine
    • device

      protected MidiDevice device
    • enabled

      public final BooleanParameter enabled
      Whether the midi device is enabled for communication. This means that it should be opened if possible, or re-opened if its connection is lost. This parameter being true doesn't guarantee availability, but it indicates that we want availability if at all possible.
    • connected

      public final BooleanParameter connected
      Whether the MIDI device is connected. It is possible for enabled to be true, but for this parameter to end up being false if the device connection is lost. So long as enabled remains set to true, the connection will attempt to be restored when possible. This is a "read-API" parameter. Do not set its value, the internal implementation will set its value and it may be observed by API clients to determine current connection state. Note that connected is optimistically assumed, the default value is true, but the implementation will set it to false if it notices that this MIDI device is not connected to the system anymore.
  • Constructor Details

  • Method Details

    • close

      protected abstract void close()
    • open

      public final LXMidiDevice open()
      Open the device for input or output. Simply sets the enabled flag to true, which implementation classes should observe and attempt to comply with.
      Returns:
      this
    • getName

      public String getName()
      Get the name of the device.
      Returns:
      Device name
    • getDescription

      public String getDescription()
      Get a description of this device
      Returns:
      Device description
    • onEnabled

      protected abstract void onEnabled(boolean enabled)
      Subclasses have this method invoked when the enabled state changes.
      Parameters:
      enabled - Enabled state, if newly set to true, attempt to open