Package heronarts.lx
Class LXDeviceComponent
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.LXModulatorComponent
heronarts.lx.LXModelComponent
heronarts.lx.LXLayeredComponent
heronarts.lx.LXDeviceComponent
- All Implemented Interfaces:
LXLoopTask
,LXPath
,LXPresetComponent
,LXSerializable
,LXMidiListener
,LXModulationContainer
,LXOscComponent
,LXParameterListener
public abstract class LXDeviceComponent
extends LXLayeredComponent
implements LXPresetComponent, LXModulationContainer, LXOscComponent, LXMidiListener
A component which may have its own scoped user-level modulators. The concrete subclasses
of this are Patterns and Effects.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Marker interface that indicates this device implements MIDI functionalityNested classes/interfaces inherited from class heronarts.lx.LXModulatorComponent
LXModulatorComponent.Profiler
Nested classes/interfaces inherited from class heronarts.lx.LXComponent
LXComponent.Hidden, LXComponent.Placeholder, LXComponent.Renamable
Nested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils
-
Field Summary
Modifier and TypeFieldDescriptionfinal BooleanParameter
final BooleanParameter
final BooleanParameter
final MutableParameter
A semaphore used to keep count of how many remote control surfaces may be controlling this component.final BooleanParameter
static final Comparator<Class<? extends LXDeviceComponent>>
protected static final int
protected static final String
final MidiFilterParameter
final LXModulationEngine
final BooleanParameter
final LXViewEngine.Selector
View selector for this devicefinal LXViewEngine.Selector
Fields inherited from class heronarts.lx.LXLayeredComponent
colors, layers, palette
Fields inherited from class heronarts.lx.LXModelComponent
model
Fields inherited from class heronarts.lx.LXModulatorComponent
modulators, profiler
Fields inherited from class heronarts.lx.LXComponent
children, internalParameters, KEY_CHILDREN, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_INTERNAL, KEY_PARAMETER_PATH, KEY_PARAMETERS, KEY_PATH, KEY_RESET, label, legacyInternalParameters, legacyParameters, lx, modulationColor, modulationControlsExpanded, modulationsExpanded, parameters, presetFile
Fields inherited from interface heronarts.lx.LXPath
ROOT, ROOT_PREFIX, ROOT_SLASH
-
Constructor Summary
ModifierConstructorDescriptionprotected
LXDeviceComponent
(LX lx) protected
LXDeviceComponent
(LX lx, String label) -
Method Summary
Modifier and TypeMethodDescriptionaddControlSurface
(LXMidiSurface surface) void
void
dispose()
Invoked when a component is being removed from the system and will no longer be used at all.getCrash()
int
Subclasses may override this and provide a version identifier.final LXListenableNormalizedParameter[]
Subclasses may override this.boolean
isHiddenControl
(LXParameter parameter) Returns whether this parameter is visible in default remote control or device control UIsboolean
isSnapshotControl
(LXParameter parameter) Returns whether this parameter is stored along with snapshotsvoid
load
(LX lx, JsonObject obj) Loads the LX component.void
loop
(double deltaMs) void
midiDispatch
(LXShortMessage message) Dispatch a MIDI message to this device, and any of its modulators which should receive thatremoveControlSurface
(LXMidiSurface surface) protected LXComponent
removeCustomRemoteControl
(LXParameter parameter) protected LXDeviceComponent
void
save
(LX lx, JsonObject obj) Serializes the LX component.void
setCustomRemoteControls
(LXListenableNormalizedParameter... remoteControls) protected void
setRemoteControls
(LXListenableNormalizedParameter... remoteControls) Methods inherited from class heronarts.lx.LXLayeredComponent
addColor, addColor, addLayer, afterLayers, blendColor, blendColor, clearColors, getBuffer, getColor, getColor, getColors, getLayers, onLoop, removeLayer, setBuffer, setBuffer, setColor, setColor, setColor, setColors, subtractColor
Methods inherited from class heronarts.lx.LXModelComponent
getModel, onModelChanged, setModel
Methods inherited from class heronarts.lx.LXModulatorComponent
addModulator, addModulator, addModulator, addModulator, addModulator, constructProfiler, getModulator, getModulators, moveModulator, removeModulator, startModulator
Methods inherited from class heronarts.lx.LXComponent
addArray, addChild, addInternalParameter, addLegacyInternalParameter, addLegacyParameter, addParameter, addParameter, addParameters, contains, copyParameters, getCategory, getChild, getComponentName, getComponentName, getComponentName, getDescription, getId, getLabel, getLX, getOscAddress, getOscLabel, getOscPath, getParameter, getParameters, getParent, getPath, handleOscMessage, hasParameter, isValidOscParameter, loadParameters, loadPreset, onParameterChanged, removeParameter, removeParameter, removeParameter, removeParameter, savePreset, setDescription, setParent, toOscQuery, toOscQuery, toOscQuery, toString, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface heronarts.lx.midi.LXMidiListener
aftertouchReceived, controlChangeReceived, noteOffReceived, noteOnReceived, pitchBendReceived, programChangeReceived
Methods inherited from interface heronarts.lx.osc.LXOscComponent
getOscAddress, handleOscMessage
Methods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
Methods inherited from interface heronarts.lx.LXPresetComponent
getPresetClass, postProcessPreset
-
Field Details
-
DEVICE_CATEGORY_NAME_SORT
-
DEVICE_VERSION_UNSPECIFIED
protected static final int DEVICE_VERSION_UNSPECIFIED- See Also:
-
modulation
-
remoteControlsChanged
-
crashed
-
controlsExpanded
-
controlsExpandedCue
-
controlsExpandedAux
-
modulationExpanded
-
midiFilter
-
view
View selector for this device -
viewPriority
-
controlSurfaceSemaphore
A semaphore used to keep count of how many remote control surfaces may be controlling this component. This may be used by UI implementations to indicate to the user that this component is under remote control. -
KEY_DEVICE_VERSION
- See Also:
-
-
Constructor Details
-
LXDeviceComponent
-
LXDeviceComponent
-
-
Method Details
-
getModelView
-
setRemoteControls
-
clearCustomRemoteControls
public void clearCustomRemoteControls() -
setCustomRemoteControls
-
removeCustomRemoteControl
-
getCustomRemoteControls
-
isSnapshotControl
Returns whether this parameter is stored along with snapshots- Parameters:
parameter
- Parameter- Returns:
- true if this can be included in snapshots
-
isHiddenControl
Returns whether this parameter is visible in default remote control or device control UIs- Parameters:
parameter
- Parameter to check- Returns:
- true if this should be hidden by default
-
resetRemoteControls
-
getRemoteControls
Subclasses may override this. The method returns an array of parameters in order that can be addressed by a remote control surface- Returns:
- Array of parameters for a remote control surface to address
-
addControlSurface
-
removeControlSurface
-
getControlSurfaces
-
getDeviceVersion
public int getDeviceVersion()Subclasses may override this and provide a version identifier. This will be written to project files when this device is saved. The version should be incremented when change to the code makes old parameter values incompatible, and the implementation should handle loading old values if possible.- Returns:
- Version number of this device
-
loop
public void loop(double deltaMs) - Specified by:
loop
in interfaceLXLoopTask
- Overrides:
loop
in classLXLayeredComponent
-
getCrash
-
getCrashStackTrace
-
getModulationEngine
- Specified by:
getModulationEngine
in interfaceLXModulationContainer
-
midiDispatch
Dispatch a MIDI message to this device, and any of its modulators which should receive that- Parameters:
message
- Message
-
dispose
public void dispose()Description copied from class:LXComponent
Invoked when a component is being removed from the system and will no longer be used at all. This unregisters the component and should free up any resources and parameter listeners. Ideally after this method is called the object should be eligible for garbage collection. Subclasses are generally expected to override this method to handle their particular cleanup work. They should also generally callsuper.dispose()
at the appropriate time to perform the basic cleanup, which may need to happen either before or after cleaning up other objects.- Overrides:
dispose
in classLXLayeredComponent
-
save
Description copied from class:LXComponent
Serializes the LX component. By default, all internal and user-facing parameters are serialized, as well as any explicitly registered child components. Note that child arrays are not serialized, or any other dynamic components. Subclasses may override to perform more saving, and are expected to callsuper.save(lx, obj)
at the appropriate time.- Specified by:
save
in interfaceLXSerializable
- Overrides:
save
in classLXComponent
- Parameters:
lx
- LX instanceobj
- Object to serialize into
-
load
Description copied from class:LXComponent
Loads the LX component. Restores the ID of the component, as well as its internal and user-facing parameters. Any explicitly registered children will be automatically loaded, so long as they are direct descendants. Dynamic arrays will not be automatically loaded, this is left to subclasses to implement.- Specified by:
load
in interfaceLXSerializable
- Overrides:
load
in classLXComponent
- Parameters:
lx
- LX instanceobj
- Object to deserialize
-