Package heronarts.lx.midi
Class LXMidiDevice
java.lang.Object
heronarts.lx.midi.LXMidiDevice
- Direct Known Subclasses:
LXMidiInput
,LXMidiOutput
-
Field Summary
Modifier and TypeFieldDescriptionfinal BooleanParameter
Whether the MIDI device is connected.protected MidiDevice
final BooleanParameter
Whether the midi device is enabled for communication.protected final LXMidiEngine
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
close()
Get a description of this devicegetName()
Get the name of the device.protected abstract void
onEnabled
(boolean enabled) Subclasses have this method invoked when the enabled state changes.final LXMidiDevice
open()
Open the device for input or output.
-
Field Details
-
engine
-
device
-
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
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
-
LXMidiDevice
-
-
Method Details
-
close
protected abstract void close() -
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
Get the name of the device.- Returns:
- Device name
-
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
-