Package heronarts.lx.modulation
Class LXModulationEngine
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.LXModulatorComponent
heronarts.lx.modulation.LXModulationEngine
- All Implemented Interfaces:
LXLoopTask,LXPath,LXSerializable,LXOscComponent,LXParameterListener
-
Nested Class Summary
Nested ClassesNested 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 List<LXCompoundModulation> final List<LXTriggerModulation> Fields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddListener(LXModulationEngine.Listener listener) addModulation(LXCompoundModulation modulation) <T extends LXModulator>
TaddModulator(T modulator, int index, JsonObject modulatorObj) addTrigger(LXTriggerModulation trigger) voidclear()voiddispose()Invoked when a component is being removed from the system and will no longer be used at all.<T extends LXParameterModulation>
List<T> findModulations(LXComponent component, List<T> modulations) Compiles all modulations that act upon any parameter or subcomponent of the given component, whether as source or target.getLabel()Accessor for the user-facing label of this component.intgetModulatorCount(Class<? extends LXModulator> cls) booleanhandleOscMessage(OscMessage message, String[] parts, int index) Handles an OSC message sent to this component.booleanisValidTarget(LXParameter target) voidload(LX lx, JsonObject obj) Loads the LX component.voidloadModulations(LX lx, JsonObject obj) voidmidiDispatch(LXShortMessage message) Dispatch a MIDI message to any modulators on this engine which are running and receive MIDI<T extends LXModulator>
TmoveModulator(T modulator, int index) removeListener(LXModulationEngine.Listener listener) removeModulation(LXCompoundModulation modulation) removeModulations(LXComponent component) <T extends LXModulator>
TremoveModulator(T modulator) removeParameterModulations(LXParameter parameter) removeTrigger(LXTriggerModulation trigger) voidsave(LX lx, JsonObject obj) Serializes the LX component.setFlagLoadModulations(boolean flagLoadModulations) Methods inherited from class heronarts.lx.LXModulatorComponent
addModulator, addModulator, addModulator, addModulator, constructProfiler, getModulator, getModulators, loop, 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, getLX, getOscAddress, getOscLabel, getOscPath, getParameter, getParameters, getParent, getPath, 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.osc.LXOscComponent
getOscAddressMethods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
-
Field Details
-
modulations
-
triggers
-
-
Constructor Details
-
LXModulationEngine
-
-
Method Details
-
setFlagLoadModulations
-
isValidTarget
-
handleOscMessage
Description copied from class:LXComponentHandles an OSC message sent to this component. By default this method handles registered components and parameters, but subclasses may override this method to handle different types of OSC messages.- Specified by:
handleOscMessagein interfaceLXOscComponent- Overrides:
handleOscMessagein classLXComponent- Parameters:
message- Full OSC message objectparts- The OSC address pattern, broken into an array of partsindex- Which index into the parts array corresponds to this component's children- Returns:
trueif the OSC message was handled and should be considered consumed,falseotherwise
-
addListener
-
removeListener
-
addModulation
-
removeModulation
-
addTrigger
-
removeTrigger
-
findModulations
public <T extends LXParameterModulation> List<T> findModulations(LXComponent component, List<T> modulations) Compiles all modulations that act upon any parameter or subcomponent of the given component, whether as source or target.- Type Parameters:
T- type of parameter modulation, could be compound or trigger- Parameters:
component- Componentmodulations- List of modulations that we're checking within- Returns:
- All modulations acting in any way upon this component or its children
-
removeParameterModulations
-
removeModulations
-
addModulator
- Overrides:
addModulatorin classLXModulatorComponent
-
removeModulator
- Overrides:
removeModulatorin classLXModulatorComponent
-
moveModulator
- Overrides:
moveModulatorin classLXModulatorComponent
-
getModulatorCount
-
midiDispatch
Dispatch a MIDI message to any modulators on this engine which are running and receive MIDI- 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 classLXModulatorComponent
-
getLabel
Description copied from class:LXComponentAccessor for the user-facing label of this component. Objects that implement theLXComponent.Renamableinterface may allow the user to change this value.- Specified by:
getLabelin interfaceLXPath- Overrides:
getLabelin classLXComponent- Returns:
- Label for this component
-
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
-
clear
public void clear() -
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
-
loadModulations
-