Package heronarts.lx.mixer
Class LXChannel
- All Implemented Interfaces:
LXEffect.Container,LXComponent.Renamable,LXLoopTask,LXPath,LXPresetComponent,LXSerializable,LXModulationContainer,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
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic interfaceListener 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.ProfilerNested classes/interfaces inherited from class heronarts.lx.mixer.LXBus
LXBus.ClipListenerNested 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 BooleanParameterWhether auto pattern transition is enabled on this channelAuto-cycle to a random pattern, not the next onefinal BoundedParameterTime in seconds after which transition thru the pattern set is automatically initiated.final BooleanParameterWhether damping is enabled on pattern composite blendingfinal CompoundParameterDamping time when a pattern is enabled or disabled in blending modeAuto-cycle to a random pattern, not the next onefinal BooleanParameterWhether the channel control UI is expandedfinal MutableParameterA semaphore used to keep count of how many remote control surfaces may be controlling this channel's patterns.final DiscreteParameterWhich pattern is focused in the channelprotected static final Stringstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected final ModelBufferThis is a local buffer used to render a secondary patternfinal ObjectParameter<LXBlend> final BooleanParameterfinal BoundedParameterfinal TriggerParameterfinal BooleanParameterFields inherited from class heronarts.lx.mixer.LXAbstractChannel
autoMute, auxActive, blendBuffer, blendMode, colors, crossfadeGroup, cueActive, enabled, index, isAutoMuted, midiFilter, midiSource, performanceWarning, viewFields inherited from class heronarts.lx.mixer.LXBus
arm, clips, controlsExpandedAux, controlsExpandedCue, effects, fader, hasRunningClip, modulation, modulationExpanded, mutableEffects, PATH_EFFECT, selected, stopClipsFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddListener(LXChannel.Listener listener) final LXChanneladdPattern(LXPattern pattern) final LXChanneladdPattern(LXPattern pattern, int index) protected LXClipconstructClip(int index) voiddispose()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 LXPatternfinal intReturns the index of the currently active pattern, if anydoubleReturn progress towards making a cyclefinal LXPatternReturns the pattern that currently has focus in this channel's pattern list.final intgetGroup()Returns the group that this channel belongs tofinal LXPatternfinal intfinal LXPatterngetPattern(int index) final LXPatterngetPattern(String label) final LXPatterngetPatternByClassName(String className) Class<?> final LXPatterndoubleReturn progress through a transitionfinal LXChannelActivates the next pattern in this channel's pattern listfinal LXChannelActivates the given pattern, which must belong to this channel.final LXChannelActivates the given pattern, which must belong to this channel.final LXChannelgoPatternIndex(int index) Activates the pattern at the given index, if it is within the bounds of this channel's pattern list.final LXChannelActivates the previous pattern in this channel's pattern listfinal LXChannelActivates a randomly selected pattern on the channel, from the set of patterns that have auto cycle enabled.booleanhandleOscMessage(OscMessage message, String[] parts, int index) Handles an OSC message sent to this component.booleanbooleanbooleanvoidload(LX lx, JsonObject obj) Loads the LX component.loadPattern(JsonObject patternObj, int index) voidloop(double deltaMs) voidmidiDispatch(LXShortMessage message) Dispatch a MIDI message to all the active devices on this channel, without notifying listeners.movePattern(LXPattern pattern, int index) voidSubclasses are free to override this if desired.voidonPatternEnabled(LXPattern pattern) voidpostProcessPreset(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.final voidremoveListener(LXChannel.Listener listener) final LXChannelremovePattern(LXPattern pattern) voidsave(LX lx, JsonObject obj) Serializes the LX component.final LXChannelsetPatterns(LXPattern[] patterns) Methods inherited from class heronarts.lx.mixer.LXAbstractChannel
addListener, addMidiListener, constructProfiler, getIndex, getPath, midiMessage, removeListener, removeMidiListenerMethods inherited from class heronarts.lx.mixer.LXBus
addClip, addClip, addClip, addClip, addClipListener, addEffect, addListener, clear, disposeClips, getClip, getEffects, getModulationEngine, getModulationExpanded, getRunningClip, isChannel, isEmptyGroup, isGroup, isInGroup, loop, moveEffect, onClipStart, onClipStop, removeClip, removeClip, removeClipListener, removeEffect, removeListener, setMixer, stopClipsMethods inherited from class heronarts.lx.LXModelComponent
getModel, onModelChanged, setModelMethods inherited from class heronarts.lx.LXModulatorComponent
addModulator, addModulator, addModulator, addModulator, addModulator, 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, hasParameter, isValidOscParameter, loadParameters, loadPreset, 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.effect.LXEffect.Container
addEffect, getEffect, getEffect, loadEffectMethods inherited from interface heronarts.lx.osc.LXOscComponent
getOscAddressMethods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, 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
-
controlSurfaceSemaphore
A semaphore used to keep count of how many remote control surfaces may be controlling this channel's patterns. This may be used by UI implementations to indicate to the user that this component is under remote control. -
triggerPatternCycle
-
launchPatternCycle
-
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
-
isPlaylist
public boolean isPlaylist()- Overrides:
isPlaylistin classLXAbstractChannel
-
isComposite
public boolean isComposite()- Overrides:
isCompositein classLXAbstractChannel
-
onParameterChanged
Description copied from class:LXComponentSubclasses are free to override this if desired. It will automatically fire for any listenable parameter that is registered with this component.- Specified by:
onParameterChangedin interfaceLXParameterListener- Overrides:
onParameterChangedin classLXAbstractChannel- Parameters:
p- Parameter that has a value change
-
onPatternEnabled
-
getModelView
- Overrides:
getModelViewin classLXAbstractChannel
-
addListener
-
removeListener
-
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 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:
trueif the OSC message was handled and should be considered consumed,falseotherwise
-
midiDispatch
Description copied from class:LXAbstractChannelDispatch a MIDI message to all the active devices on this channel, without notifying listeners.- Overrides:
midiDispatchin classLXAbstractChannel- Parameters:
message- Message
-
getGroup
Description copied from class:LXBusReturns the group that this channel belongs to -
constructClip
- Specified by:
constructClipin classLXBus
-
getPatterns
-
getPattern
-
getPattern
-
getPatternByClassName
-
setPatterns
-
addPattern
-
addPattern
-
removePattern
-
movePattern
-
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:
getClipLabelin 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
-
isInTransition
public boolean isInTransition() -
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 activate- Returns:
- this
-
goPattern
Activates the given pattern, which must belong to this channel. Transition can be optionally skipped- Parameters:
pattern- Pattern to activateskipTransition- Skip over a transition- Returns:
- this
-
goRandomPattern
Activates a randomly selected 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:
loopin interfaceLXLoopTask- Overrides:
loopin classLXAbstractChannel
-
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 classLXAbstractChannel
-
getPresetClass
- Specified by:
getPresetClassin interfaceLXPresetComponent- Overrides:
getPresetClassin classLXBus
-
postProcessPreset
Description copied from interface:LXPresetComponentPresets 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:
postProcessPresetin interfaceLXPresetComponent- Overrides:
postProcessPresetin classLXAbstractChannel
-
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 classLXBus- 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 classLXAbstractChannel- Parameters:
lx- LX instanceobj- Object to deserialize
-
loadPattern
-