Package heronarts.lx.snapshot
Class LXSnapshot
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.snapshot.LXSnapshot
- All Implemented Interfaces:
LXPath,LXSerializable,LXParameterListener
- Direct Known Subclasses:
LXClipSnapshot,LXGlobalSnapshot
A snapshot holds a memory of the state of the program at a point in time.
The snapshot contains a collection of "views" which are memories of a piece
of state in the program at some time. Typically this is a parameter value,
but some special cases exist, like the active pattern on a channel.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassView for which pattern is active on a channelclassclassClass for the recall of a simple parameter valueclassA view is a component of a snapshot, it's a single piece of the snapshot that is "looking at" one piece of state.static enumstatic enumType of snapshot viewNested 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 BoundedParameterfinal List<LXSnapshot.View> Public immutable list of all the views this snapshot comtains.Fields 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 TypeMethodDescriptionprotected voidaddDeviceChildView(LXSnapshot.ViewScope scope, LXComponent component) protected voidaddDeviceView(LXSnapshot.ViewScope scope, LXDeviceComponent device) protected voidaddEffectView(LXEffect effect) protected voidaddLayeredView(LXSnapshot.ViewScope scope, LXLayeredComponent component) protected voidaddParameterView(LXSnapshot.ViewScope scope, LXParameter p) protected voidaddPatternView(LXPattern pattern) addView(JsonObject viewObj) Adds a view to this snapshot from prior saved statevoidaddView(LXSnapshot.View view) Add a view to this snapshotvoiddispose()Invoked when a component is being removed from the system and will no longer be used at all.final voidprotected voidinitializeClipBus(LXBus bus) protected voidinitializeGlobalBus(LXBus bus) protected abstract voidbooleanbooleanvoidload(LX lx, JsonObject obj) Loads the LX component.voidremoveView(LXSnapshot.View view) Remove a view from this snapshotvoidsave(LX lx, JsonObject obj) Serializes the LX component.voidupdate()Update this snapshot to reflect the current program stateMethods 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.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
-
Field Details
-
views
Public immutable list of all the views this snapshot comtains. -
transitionTimeSecs
-
-
Constructor Details
-
LXSnapshot
-
-
Method Details
-
isGlobalSnapshot
public boolean isGlobalSnapshot() -
isClipSnapshot
public boolean isClipSnapshot() -
getClipChannel
-
initialize
public final void initialize() -
update
public void update()Update this snapshot to reflect the current program state -
initializeViews
protected abstract void initializeViews() -
initializeGlobalBus
-
initializeClipBus
-
addEffectView
-
addPatternView
-
addDeviceView
-
addLayeredView
-
addDeviceChildView
-
addParameterView
-
addView
Adds a view to this snapshot from prior saved state- Parameters:
viewObj- JSON serialized view- Returns:
- The new view object
-
addView
Add a view to this snapshot- Parameters:
view- View
-
removeView
Remove a view from this snapshot- Parameters:
view- View to remove
-
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 classLXComponent
-
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
-