public class LXChannel extends LXAbstractChannel
Modifier and Type | Class and Description |
---|---|
static class |
LXChannel.AutoCycleMode |
static interface |
LXChannel.Listener
Listener interface for objects which want to be notified when the internal
channel state is modified.
|
LXAbstractChannel.CrossfadeGroup, LXAbstractChannel.MidiListener, LXAbstractChannel.Profiler
LXBus.ClipListener
LXComponent.Placeholder, LXComponent.Renamable
LXSerializable.Utils
Modifier and Type | Field and Description |
---|---|
BooleanParameter |
autoCycleEnabled
Whether auto pattern transition is enabled on this channel
|
EnumParameter<LXChannel.AutoCycleMode> |
autoCycleMode
Auto-cycle to a random pattern, not the next one
|
BoundedParameter |
autoCycleTimeSecs
Time in seconds after which transition thru the pattern set is automatically initiated.
|
BooleanParameter |
controlsExpanded
Whether the channel control UI is expanded
|
MutableParameter |
controlSurfaceFocusIndex |
MutableParameter |
controlSurfaceFocusLength |
DiscreteParameter |
focusedPattern
Which pattern is focused in the channel
|
protected static String |
KEY_IS_GROUP |
static int |
NO_PATTERN_INDEX |
static String |
PATH_ACTIVE |
static String |
PATH_ACTIVE_PATTERN |
static String |
PATH_NEXT_PATTERN |
static String |
PATH_PATTERN |
List<LXPattern> |
patterns |
ObjectParameter<LXBlend> |
transitionBlendMode |
BooleanParameter |
transitionEnabled |
BoundedParameter |
transitionTimeSecs |
BooleanParameter |
triggerPatternCycle |
blendBuffer, blendMode, colors, crossfadeGroup, cueActive, enabled, fader, index, midiChannel, midiMonitor
arm, clips, effects, mutableEffects, PATH_EFFECT, selected
model
modulators, profiler
controlSurfaceSemaphore, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_PARAMETER_PATH, KEY_PATH, label, lx, modulationColor
Constructor and Description |
---|
LXChannel(LX lx,
int index,
LXPattern[] patterns) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(LXChannel.Listener listener) |
LXChannel |
addPattern(LXPattern pattern) |
LXChannel |
addPattern(LXPattern pattern,
int index) |
protected LXClip |
constructClip(int index) |
LXBus |
disableAutoCycle() |
void |
dispose()
Invoked when a component is being removed from the system and will no longer be used at all.
|
LXBus |
enableAutoCycle(double autoCycleThreshold)
Enable automatic transition from pattern to pattern on this channel
|
LXPattern |
getActivePattern() |
int |
getActivePatternIndex()
Returns the index of the currently active pattern, if any
|
double |
getAutoCycleProgress()
Return progress towards making a cycle
|
LXPattern |
getFocusedPattern()
Returns the pattern that currently has focus in this channel's
pattern list.
|
int |
getFocusedPatternIndex() |
LXGroup |
getGroup()
Returns the group that this channel belongs to
|
LXPattern |
getNextPattern() |
int |
getNextPatternIndex() |
LXPattern |
getPattern(int index) |
LXPattern |
getPattern(String label) |
LXPattern |
getPatternByClassName(String className) |
List<LXPattern> |
getPatterns() |
LXPattern |
getTargetPattern() |
double |
getTransitionProgress()
Return progress through a transition
|
LXChannel |
goNextPattern()
Activates the next pattern in this channel's pattern list
|
LXChannel |
goPattern(LXPattern pattern)
Activates the given pattern, which must belong to this channel.
|
LXChannel |
goPatternIndex(int i)
Activates the pattern at the given index, if it is within the
bounds of this channel's pattern list.
|
LXChannel |
goPreviousPattern()
Activates the previous pattern in this channel's pattern list
|
LXChannel |
goRandomPattern()
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.
|
LXChannel |
movePattern(LXPattern pattern,
int index) |
protected void |
onModelChanged(LXModel model)
Subclasses should override to handle changes to which model
they are addressing.
|
void |
onParameterChanged(LXParameter p)
Subclasses are free to override this if desired.
|
LXChannel |
reloadPattern(LXPattern pattern) |
void |
removeListener(LXChannel.Listener listener) |
LXChannel |
removePattern(LXPattern pattern) |
void |
save(LX lx,
JsonObject obj)
Serializes the LX component.
|
LXChannel |
setPatterns(LXPattern[] patterns) |
addListener, addMidiListener, constructProfiler, getIndex, getPath, midiMessage, removeListener, removeMidiListener
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
getModel, setModel
addModulator, addModulator, addModulator, getModulator, getModulators, moveModulator, removeModulator, startModulator
addArray, addChild, addInternalParameter, addParameter, addParameter, contains, copyParameters, getChild, getComponentName, getComponentName, getComponentName, getId, getLabel, getLX, getOscAddress, getOscLabel, getOscPath, getParameter, getParameters, getParent, loadParameters, removeParameter, removeParameter, saveParameters, setParent, toString, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getOscAddress
get, get, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getComponent, getComponent, getParameter, getParameter
public static final int NO_PATTERN_INDEX
public final DiscreteParameter focusedPattern
public final BooleanParameter controlsExpanded
public final BooleanParameter autoCycleEnabled
public final EnumParameter<LXChannel.AutoCycleMode> autoCycleMode
public final BoundedParameter autoCycleTimeSecs
public final BoundedParameter transitionTimeSecs
public final BooleanParameter transitionEnabled
public final ObjectParameter<LXBlend> transitionBlendMode
public final MutableParameter controlSurfaceFocusIndex
public final MutableParameter controlSurfaceFocusLength
public final BooleanParameter triggerPatternCycle
public static final String PATH_PATTERN
public static final String PATH_ACTIVE
public static final String PATH_ACTIVE_PATTERN
public static final String PATH_NEXT_PATTERN
protected static final String KEY_IS_GROUP
public void onParameterChanged(LXParameter p)
LXComponent
onParameterChanged
in interface LXParameterListener
onParameterChanged
in class LXAbstractChannel
p
- Parameter that has a value changeprotected void onModelChanged(LXModel model)
LXModelComponent
onModelChanged
in class LXBus
model
- New modelpublic final void addListener(LXChannel.Listener listener)
public final void removeListener(LXChannel.Listener listener)
public boolean handleOscMessage(OscMessage message, String[] parts, int index)
LXComponent
handleOscMessage
in interface LXOscComponent
handleOscMessage
in class LXBus
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 childrentrue
if the OSC message was handled and should be considered consumed, false
otherwisepublic void midiDispatch(LXShortMessage message)
LXAbstractChannel
midiDispatch
in class LXAbstractChannel
message
- Messagepublic LXGroup getGroup()
LXBus
protected LXClip constructClip(int index)
constructClip
in class LXBus
public final LXPattern getPattern(int index)
public final int getFocusedPatternIndex()
public final LXPattern getFocusedPattern()
public final int getActivePatternIndex()
public final LXPattern getActivePattern()
public final LXPattern getTargetPattern()
public final int getNextPatternIndex()
public final LXPattern getNextPattern()
public final LXChannel goPreviousPattern()
public final LXChannel goNextPattern()
public final LXChannel goPattern(LXPattern pattern)
pattern
- Pattern to acivatepublic final LXChannel goRandomPattern()
public final LXChannel goPatternIndex(int i)
i
- Pattern indexpublic LXBus disableAutoCycle()
public LXBus enableAutoCycle(double autoCycleThreshold)
autoCycleThreshold
- time in secondspublic double getAutoCycleProgress()
public double getTransitionProgress()
public void loop(double deltaMs)
loop
in interface LXLoopTask
loop
in class LXAbstractChannel
public void dispose()
LXComponent
super.dispose()
at the appropriate
time to perform the basic cleanup, which may need to happen either before or after cleaning
up other objects.dispose
in class LXAbstractChannel
public void save(LX lx, JsonObject obj)
LXComponent
super.save(lx, obj)
at the appropriate time.save
in interface LXSerializable
save
in class LXBus
lx
- LX instanceobj
- Object to serialize intopublic void load(LX lx, JsonObject obj)
LXComponent
load
in interface LXSerializable
load
in class LXBus
lx
- LX instanceobj
- Object to deserializeLX library by Mark C. Slee. © 2012-2020