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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceMarker interface that indicates this device implements MIDI functionalityNested classes/interfaces inherited from class heronarts.lx.LXModulatorComponent
LXModulatorComponent.ProfilerNested classes/interfaces inherited from class heronarts.lx.LXComponent
LXComponent.Description, LXComponent.Hidden, LXComponent.Name, LXComponent.Placeholder, LXComponent.PluginRequired, LXComponent.RenamableNested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Map<String, LXComponent> An immutable view of the map of child components.final BooleanParameterfinal BooleanParameterfinal BooleanParameterfinal MutableParameterA semaphore used to keep count of how many remote control surfaces may be controlling this component.final BooleanParameterstatic final Comparator<Class<? extends LXDeviceComponent>> protected static final intprotected static final Stringfinal MidiFilterParameterfinal LXModulationEnginefinal BooleanParameterfinal LXViewEngine.SelectorView selector for this devicefinal LXViewEngine.SelectorFields inherited from class heronarts.lx.LXLayeredComponent
colors, layers, paletteFields inherited from class heronarts.lx.LXModelComponent
modelFields inherited from class heronarts.lx.LXModulatorComponent
modulators, profilerFields inherited from class heronarts.lx.LXComponent
childArrays, 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, presetFileFields inherited from interface heronarts.lx.LXPath
DEFAULT_SEPARATOR, ROOT, ROOT_PREFIX, ROOT_SLASH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLXDeviceComponent(LX lx) protectedLXDeviceComponent(LX lx, String label) -
Method Summary
Modifier and TypeMethodDescriptionprotected LXDeviceComponentaddAutomationChild(String path, LXComponent child) Adds a child to this device which can receive automation coming from snapshots or clip lanesaddControlSurface(LXMidiSurface surface) voidvoiddispose()Invoked when a component is being removed from the system and will no longer be used at all.getCrash()static StringgetDeviceDescription(Class<? extends LXDeviceComponent> cls) intSubclasses may override this and provide a version identifier.Get the modulation engine implementation for this componentReturn the parameter used to toggle whether the modulation engine is expanded in the UI.final LXListenableNormalizedParameter[]Subclasses may override this.booleanisHiddenControl(LXParameter parameter) Returns whether this parameter is visible in default remote control or device control UIsbooleanisSnapshotControl(LXParameter parameter) Returns whether this parameter is stored along with snapshotsvoidload(LX lx, JsonObject obj) Loads the LX component.voidloop(double deltaMs) voidmidiDispatch(LXShortMessage message) Dispatch a MIDI message to this device, and any of its modulators which should receive thatremoveControlSurface(LXMidiSurface surface) protected LXComponentremoveCustomRemoteControl(LXParameter parameter) protected LXDeviceComponentvoidsave(LX lx, JsonObject obj) Serializes the LX component.voidsetCustomRemoteControls(LXListenableNormalizedParameter... remoteControls) protected voidsetRemoteControls(LXListenableNormalizedParameter... remoteControls) Methods inherited from class heronarts.lx.LXLayeredComponent
addColor, addColor, addLayer, afterLayers, applyEffects, blendColor, blendColor, clearColors, getBuffer, getColor, getColor, getColors, getLayers, onLoop, removeLayer, setBuffer, setBuffer, setColor, setColor, setColor, setColors, subtractColorMethods inherited from class heronarts.lx.LXModelComponent
getModel, onModelChanged, setModelMethods inherited from class heronarts.lx.LXModulatorComponent
addModulator, addModulator, addModulator, addModulator, addModulator, constructProfiler, getModulator, getModulators, moveModulator, removeModulator, startModulatorMethods inherited from class heronarts.lx.LXComponent
addArray, addChild, addInternalParameter, addLegacyInternalParameter, addLegacyParameter, addParameter, addParameter, addParameters, assertDisposed, contains, copyParameters, getCategory, getChild, getComponentDescription, 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, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface heronarts.lx.midi.LXMidiListener
aftertouchReceived, controlChangeReceived, midiPanicReceived, noteOffReceived, noteOnReceived, pitchBendReceived, programChangeReceived, sysexReceivedMethods inherited from interface heronarts.lx.osc.LXOscComponent
getOscAddress, handleOscMessageMethods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendantMethods 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
-
automationChildren
An immutable view of the map of child components. -
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
-
addAutomationChild
Adds a child to this device which can receive automation coming from snapshots or clip lanes- Parameters:
path- Component pathchild- Component- Returns:
- this
-
getDeviceDescription
-
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:
loopin interfaceLXLoopTask- Overrides:
loopin classLXLayeredComponent
-
getCrash
-
getCrashStackTrace
-
getModulationEngine
Description copied from interface:LXModulationContainerGet the modulation engine implementation for this component- Specified by:
getModulationEnginein interfaceLXModulationContainer- Returns:
- Modulation engine
-
getModulationExpanded
Description copied from interface:LXModulationContainerReturn the parameter used to toggle whether the modulation engine is expanded in the UI.- Specified by:
getModulationExpandedin interfaceLXModulationContainer- Returns:
- Parameter that toggles modulation visibility, or null
-
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:LXComponentInvoked 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:
disposein classLXLayeredComponent
-
save
Description copied from class:LXComponentSerializes 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:
savein interfaceLXSerializable- Overrides:
savein classLXComponent- Parameters:
lx- LX instanceobj- Object to serialize into
-
load
Description copied from class:LXComponentLoads 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:
loadin interfaceLXSerializable- Overrides:
loadin classLXComponent- Parameters:
lx- LX instanceobj- Object to deserialize
-