Package heronarts.lx.mixer
Class LXChannel
- All Implemented Interfaces:
LXComponent.Renamable
,LXLoopTask
,LXPath
,LXPresetComponent
,LXSerializable
,LXOscComponent
,LXParameterListener
A channel is a single component of the engine that has a set of patterns from
which it plays and rotates. It also has a fader to control how this channel
is blended with the channels before it.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
static interface
Listener interface for objects which want to be notified when the internal channel state is modified.Nested classes/interfaces inherited from class heronarts.lx.mixer.LXAbstractChannel
LXAbstractChannel.CrossfadeGroup, LXAbstractChannel.MidiListener, LXAbstractChannel.Profiler
Nested classes/interfaces inherited from class heronarts.lx.mixer.LXBus
LXBus.ClipListener
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
Whether auto pattern transition is enabled on this channelAuto-cycle to a random pattern, not the next onefinal BoundedParameter
Time in seconds after which transition thru the pattern set is automatically initiated.final BooleanParameter
Whether damping is enabled on pattern composite blendingfinal CompoundParameter
Damping time when a pattern is enabled or disabled in blending modeAuto-cycle to a random pattern, not the next onefinal BooleanParameter
Whether the channel control UI is expandedfinal MutableParameter
final MutableParameter
final DiscreteParameter
Which pattern is focused in the channelprotected static final String
static final int
static final String
static final String
static final String
static final String
protected final ModelBuffer
This is a local buffer used to render a secondary patternfinal ObjectParameter<LXBlend>
final BooleanParameter
final BoundedParameter
final TriggerParameter
final BooleanParameter
Fields inherited from class heronarts.lx.mixer.LXAbstractChannel
auxActive, blendBuffer, blendMode, colors, crossfadeGroup, cueActive, enabled, index, midiFilter, performanceWarning, view
Fields inherited from class heronarts.lx.mixer.LXBus
arm, clips, controlsExpandedAux, controlsExpandedCue, effects, fader, mutableEffects, PATH_EFFECT, selected
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
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
addListener
(LXChannel.Listener listener) final LXChannel
addPattern
(LXPattern pattern) final LXChannel
addPattern
(LXPattern pattern, int index) protected LXClip
constructClip
(int index) void
dispose()
Invoked when a component is being removed from the system and will no longer be used at all.enableAutoCycle
(double autoCycleThreshold) Enable automatic transition from pattern to pattern on this channelfinal LXPattern
final int
Returns the index of the currently active pattern, if anydouble
Return progress towards making a cyclefinal LXPattern
Returns the pattern that currently has focus in this channel's pattern list.final int
getGroup()
Returns the group that this channel belongs tofinal LXPattern
final int
final LXPattern
getPattern
(int index) final LXPattern
getPattern
(String label) final LXPattern
getPatternByClassName
(String className) Class<?>
final LXPattern
double
Return progress through a transitionfinal LXChannel
Activates the next pattern in this channel's pattern listfinal LXChannel
Activates the given pattern, which must belong to this channel.final LXChannel
goPatternIndex
(int index) Activates the pattern at the given index, if it is within the bounds of this channel's pattern list.final LXChannel
Activates the previous pattern in this channel's pattern listfinal LXChannel
Activates a randomly seleted pattern on the channel, from the set of patterns that have auto cycle enabled.boolean
handleOscMessage
(OscMessage message, String[] parts, int index) Handles an OSC message sent to this component.void
load
(LX lx, JsonObject obj) Loads the LX component.void
loop
(double deltaMs) void
midiDispatch
(LXShortMessage message) Dispatch a MIDI message to all the active devices on this channel, without notifying listeners.movePattern
(LXPattern pattern, int index) void
Subclasses are free to override this if desired.void
onPatternEnabled
(LXPattern pattern) void
postProcessPreset
(LX lx, JsonObject obj) Presets by default contain the results of a normal save() call, but we may not always want all of the information contained.reloadPattern
(LXPattern pattern) final void
removeListener
(LXChannel.Listener listener) final LXChannel
removePattern
(LXPattern pattern) void
save
(LX lx, JsonObject obj) Serializes the LX component.final LXChannel
setPatterns
(LXPattern[] patterns) Methods inherited from class heronarts.lx.mixer.LXAbstractChannel
addListener, addMidiListener, constructProfiler, getIndex, getPath, midiMessage, removeListener, removeMidiListener
Methods inherited from class heronarts.lx.mixer.LXBus
addClip, addClip, addClip, addClipListener, addEffect, addEffect, addListener, disposeClips, getClip, getClip, getEffect, getEffect, getEffects, isChannel, isEmptyGroup, isGroup, isInGroup, loop, moveEffect, reloadEffect, removeClip, removeClip, removeClipListener, removeEffect, removeListener, setMixer, stopClips
Methods inherited from class heronarts.lx.LXModelComponent
getModel, onModelChanged, setModel
Methods inherited from class heronarts.lx.LXModulatorComponent
addModulator, addModulator, addModulator, addModulator, addModulator, 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, 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
Methods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
-
Field Details
-
NO_PATTERN_INDEX
public static final int NO_PATTERN_INDEX- See Also:
-
focusedPattern
Which pattern is focused in the channel -
controlsExpanded
Whether the channel control UI is expanded -
compositeMode
Auto-cycle to a random pattern, not the next one -
compositeDampingEnabled
Whether damping is enabled on pattern composite blending -
compositeDampingTimeSecs
Damping time when a pattern is enabled or disabled in blending mode -
autoCycleEnabled
Whether auto pattern transition is enabled on this channel -
autoCycleMode
Auto-cycle to a random pattern, not the next one -
autoCycleTimeSecs
Time in seconds after which transition thru the pattern set is automatically initiated. -
transitionTimeSecs
-
transitionEnabled
-
transitionBlendMode
-
patterns
-
controlSurfaceFocusIndex
-
controlSurfaceFocusLength
-
triggerPatternCycle
-
viewPatternLabel
-
renderBuffer
This is a local buffer used to render a secondary pattern -
PATH_PATTERN
- See Also:
-
PATH_ACTIVE
- See Also:
-
PATH_ACTIVE_PATTERN
- See Also:
-
PATH_NEXT_PATTERN
- See Also:
-
KEY_IS_GROUP
- See Also:
-
-
Constructor Details
-
LXChannel
-
-
Method Details
-
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 classLXAbstractChannel
- Parameters:
p
- Parameter that has a value change
-
onPatternEnabled
-
getModelView
- Overrides:
getModelView
in classLXAbstractChannel
-
addListener
-
removeListener
-
handleOscMessage
Description copied from class:LXComponent
Handles 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:
handleOscMessage
in interfaceLXOscComponent
- Overrides:
handleOscMessage
in classLXBus
- 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:
true
if the OSC message was handled and should be considered consumed,false
otherwise
-
midiDispatch
Description copied from class:LXAbstractChannel
Dispatch a MIDI message to all the active devices on this channel, without notifying listeners.- Overrides:
midiDispatch
in classLXAbstractChannel
- Parameters:
message
- Message
-
getGroup
Description copied from class:LXBus
Returns the group that this channel belongs to -
constructClip
- Specified by:
constructClip
in classLXBus
-
getPatterns
-
getPattern
-
getPattern
-
getPatternByClassName
-
setPatterns
-
addPattern
-
addPattern
-
removePattern
-
movePattern
-
reloadPattern
-
getFocusedPatternIndex
public final int getFocusedPatternIndex() -
getFocusedPattern
Returns the pattern that currently has focus in this channel's pattern list.- Returns:
- Pattern focused in the list
-
getClipLabel
- Overrides:
getClipLabel
in classLXBus
-
getActivePatternIndex
public final int getActivePatternIndex()Returns the index of the currently active pattern, if any- Returns:
- Index of the currently active pattern
-
getActivePattern
-
getTargetPattern
-
getNextPatternIndex
public final int getNextPatternIndex() -
getNextPattern
-
goPreviousPattern
Activates the previous pattern in this channel's pattern list- Returns:
- this
-
goNextPattern
Activates the next pattern in this channel's pattern list- Returns:
- this
-
goPattern
Activates the given pattern, which must belong to this channel.- Parameters:
pattern
- Pattern to acivate- Returns:
- this
-
goRandomPattern
Activates a randomly seleted pattern on the channel, from the set of patterns that have auto cycle enabled.- Returns:
- this
-
goPatternIndex
Activates the pattern at the given index, if it is within the bounds of this channel's pattern list.- Parameters:
index
- Pattern index- Returns:
- this
-
disableAutoCycle
-
enableAutoCycle
Enable automatic transition from pattern to pattern on this channel- Parameters:
autoCycleThreshold
- time in seconds- Returns:
- this
-
getAutoCycleProgress
public double getAutoCycleProgress()Return progress towards making a cycle- Returns:
- amount of progress towards the next cycle
-
getTransitionProgress
public double getTransitionProgress()Return progress through a transition- Returns:
- amount of progress thru current transition
-
loop
public void loop(double deltaMs) - Specified by:
loop
in interfaceLXLoopTask
- Overrides:
loop
in classLXAbstractChannel
-
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 classLXAbstractChannel
-
getPresetClass
- Specified by:
getPresetClass
in interfaceLXPresetComponent
- Overrides:
getPresetClass
in classLXBus
-
postProcessPreset
Description copied from interface:LXPresetComponent
Presets by default contain the results of a normal save() call, but we may not always want all of the information contained. This method post-processes the JSON object before writing to disk.- Specified by:
postProcessPreset
in interfaceLXPresetComponent
- Overrides:
postProcessPreset
in classLXAbstractChannel
-
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 classLXBus
- 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 classLXAbstractChannel
- Parameters:
lx
- LX instanceobj
- Object to deserialize
-