Package heronarts.lx.clip
Class LXClip
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.LXRunnableComponent
heronarts.lx.clip.LXClip
- All Implemented Interfaces:
LXComponent.Renamable
,LXLoopTask
,LXPath
,LXSerializable
,LXBus.Listener
,LXOscComponent
,LXParameterListener
- Direct Known Subclasses:
LXAbstractChannelClip
,LXMasterClip
public abstract class LXClip
extends LXRunnableComponent
implements LXOscComponent, LXComponent.Renamable, LXBus.Listener
-
Nested Class Summary
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 LXBus
final BooleanParameter
static final String
final List<LXClipLane>
final MutableParameter
final BooleanParameter
protected final List<LXClipLane>
protected final LXParameterListener
final LXClipSnapshot
final BooleanParameter
final BooleanParameter
Fields inherited from class heronarts.lx.LXRunnableComponent
runMs, running, trigger
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
-
Method Summary
Modifier and TypeMethodDescriptionaddListener
(LXClip.Listener listener) void
dispose()
Invoked when a component is being removed from the system and will no longer be used at all.void
effectAdded
(LXBus channel, LXEffect effect) void
effectMoved
(LXBus channel, LXEffect effect) void
effectRemoved
(LXBus channel, LXEffect effect) double
getBasis()
double
int
getIndex()
double
getPath()
Accessor for the path of this object.void
load
(LX lx, JsonObject obj) Loads the LX component.protected void
loadLane
(LX lx, String laneType, JsonObject laneObj) void
Subclasses are free to override this if desired.protected void
void
onStop()
Optional subclass method when stop happens.void
Optional subclass method when trigger is fired, called before onReset and onStartprotected void
registerComponent
(LXComponent component) removeListener
(LXClip.Listener listener) protected void
run
(double deltaMs) void
save
(LX lx, JsonObject obj) Serializes the LX component.setIndex
(int index) protected void
unregisterComponent
(LXComponent component) Methods inherited from class heronarts.lx.LXRunnableComponent
isRunning, loop, onReset, onStart, postRun, reset, start, stop, toggle, trigger
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, handleOscMessage, hasParameter, isValidOscParameter, loadParameters, loadPreset, 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.osc.LXOscComponent
getOscAddress, handleOscMessage
Methods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
-
Field Details
-
length
-
loop
-
mutableLanes
-
lanes
-
snapshotEnabled
-
snapshotTransitionEnabled
-
automationEnabled
-
customSnapshotTransition
-
bus
-
snapshot
-
parameterRecorder
-
KEY_INDEX
- See Also:
-
-
Constructor Details
-
LXClip
-
LXClip
-
-
Method Details
-
getPath
Description copied from class:LXComponent
Accessor for the path of this object. Returns the path this component was registered with. Some subclasses may override this if path structure is dynamic.- Specified by:
getPath
in interfaceLXPath
- Overrides:
getPath
in classLXComponent
- Returns:
- path of this component relative to its parent
-
onTrigger
public void onTrigger()Description copied from class:LXRunnableComponent
Optional subclass method when trigger is fired, called before onReset and onStart- Overrides:
onTrigger
in classLXRunnableComponent
-
onStop
public void onStop()Description copied from class:LXRunnableComponent
Optional subclass method when stop happens.- Overrides:
onStop
in classLXRunnableComponent
-
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 classLXComponent
-
getLength
public double getLength() -
removeParameterLane
-
addListener
-
removeListener
-
getCursor
public double getCursor() -
getBasis
public double getBasis() -
onParameterChanged
Description copied from class:LXComponent
Subclasses are free to override this if desired. It will automatically fire for any listenable parameter that is registered with this component.- Specified by:
onParameterChanged
in interfaceLXParameterListener
- Overrides:
onParameterChanged
in classLXRunnableComponent
- Parameters:
p
- Parameter that has a value change
-
onStartRecording
protected void onStartRecording() -
registerComponent
-
unregisterComponent
-
getIndex
public int getIndex() -
setIndex
-
run
protected void run(double deltaMs) - Specified by:
run
in classLXRunnableComponent
-
effectAdded
- Specified by:
effectAdded
in interfaceLXBus.Listener
-
effectRemoved
- Specified by:
effectRemoved
in interfaceLXBus.Listener
-
effectMoved
- Specified by:
effectMoved
in interfaceLXBus.Listener
-
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
-
loadLane
-
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
-