Package heronarts.lx.mixer
Class LXBus
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.LXModulatorComponent
heronarts.lx.LXModelComponent
heronarts.lx.mixer.LXBus
- All Implemented Interfaces:
LXEffect.Container
,LXLoopTask
,LXPath
,LXPresetComponent
,LXSerializable
,LXModulationContainer
,LXOscComponent
,LXParameterListener
- Direct Known Subclasses:
LXAbstractChannel
,LXMasterBus
public abstract class LXBus
extends LXModelComponent
implements LXPresetComponent, LXOscComponent, LXModulationContainer, LXEffect.Container
Abstract representation of a channel, which could be a normal channel with patterns
or the master channel.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
static interface
Listener interface for objects which want to be notified when the internal channel state is modified.class
Nested classes/interfaces inherited from class heronarts.lx.LXComponent
LXComponent.Description, LXComponent.Hidden, LXComponent.Name, LXComponent.Placeholder, LXComponent.PluginRequired, LXComponent.Renamable
Nested classes/interfaces inherited from interface heronarts.lx.LXSerializable
LXSerializable.Utils
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal BooleanParameter
Arms the channel for clip recording.final BooleanParameter
final BooleanParameter
final CompoundParameter
Level fader for this busfinal BooleanParameter
final LXModulationEngine
final BooleanParameter
static final String
final BooleanParameter
Whether channel is selected in the UIFields inherited from class heronarts.lx.LXModelComponent
model
Fields inherited from class heronarts.lx.LXModulatorComponent
modulators, profiler
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, presetFile
Fields inherited from interface heronarts.lx.LXPath
DEFAULT_SEPARATOR, ROOT, ROOT_PREFIX, ROOT_SLASH
-
Method Summary
Modifier and TypeMethodDescriptionaddClip()
addClip
(int index) addClip
(int index, boolean enableSnapshot) addClip
(JsonObject clipObj, int index) addClipListener
(LXBus.ClipListener listener) final LXBus
final void
addListener
(LXBus.Listener listener) void
clear()
protected abstract LXClip
constructClip
(int index) protected LXModulatorComponent.Profiler
void
dispose()
Invoked when a component is being removed from the system and will no longer be used at all.protected void
getClip
(int index) protected String
getGroup()
Returns the group that this channel belongs toabstract int
getIndex()
Get the modulation engine associated with this busReturn the parameter used to toggle whether the modulation engine is expanded in the UI.Class
<?> boolean
handleOscMessage
(OscMessage message, String[] parts, int index) Handles an OSC message sent to this component.boolean
Returns true if this is a basic channelboolean
Returns true if this is an empty group with no channelsboolean
isGroup()
Returns true if this is a group channelboolean
Returns true if this channel belongs to a groupvoid
load
(LX lx, JsonObject obj) Loads the LX component.void
loop
(double deltaMs) protected void
loop
(double deltaMs, boolean runComponents) moveEffect
(LXEffect effect, int index) void
onClipStart
(LXClip clip) NOT A PUBLIC API! DO NOT CALL THIS! Used by LXClip internalsvoid
onClipStop
(LXClip clip) NOT A PUBLIC API! DO NOT CALL THIS! Used by LXClip internalsvoid
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.void
removeClip
(int index) void
removeClip
(LXClip clip) removeClipListener
(LXBus.ClipListener listener) final LXBus
removeEffect
(LXEffect effect) final void
removeListener
(LXBus.Listener listener) void
save
(LX lx, JsonObject obj) Serializes the LX component.protected void
setMixer
(LXMixerEngine mixer) Stops all clipsMethods 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, assertDisposed, contains, copyParameters, getCategory, getChild, getComponentDescription, getComponentName, getComponentName, getComponentName, getDescription, getId, getLabel, getLX, getOscAddress, getOscLabel, getOscPath, getParameter, getParameters, getParent, getPath, hasParameter, isValidOscParameter, loadParameters, loadPreset, onParameterChanged, 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.effect.LXEffect.Container
addEffect, getEffect, getEffect, loadEffect
Methods inherited from interface heronarts.lx.osc.LXOscComponent
getOscAddress
Methods inherited from interface heronarts.lx.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
-
Field Details
-
modulation
-
fader
Level fader for this bus -
arm
Arms the channel for clip recording. -
selected
Whether channel is selected in the UI -
stopClips
-
controlsExpandedCue
-
controlsExpandedAux
-
modulationExpanded
-
mutableEffects
-
effects
-
clips
-
hasRunningClip
-
PATH_EFFECT
- See Also:
-
-
Method Details
-
constructProfiler
- Overrides:
constructProfiler
in classLXModulatorComponent
-
getIndex
public abstract int getIndex() -
setMixer
-
addListener
-
removeListener
-
addClipListener
-
removeClipListener
-
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 classLXComponent
- 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
-
getModulationEngine
Get the modulation engine associated with this bus- Specified by:
getModulationEngine
in interfaceLXModulationContainer
- Returns:
- Modulation engine
-
getModulationExpanded
Description copied from interface:LXModulationContainer
Return the parameter used to toggle whether the modulation engine is expanded in the UI.- Specified by:
getModulationExpanded
in interfaceLXModulationContainer
- Returns:
- Parameter that toggles modulation visibility, or null
-
getGroup
Returns the group that this channel belongs to- Returns:
- Group that this channel belongs to, or null
-
isGroup
public boolean isGroup()Returns true if this is a group channel- Returns:
- True if this is a group channel
-
isEmptyGroup
public boolean isEmptyGroup()Returns true if this is an empty group with no channels- Returns:
- true if this is a group with no subchannels
-
isChannel
public boolean isChannel()Returns true if this is a basic channel- Returns:
- True if this is a basic channel
-
isInGroup
public boolean isInGroup()Returns true if this channel belongs to a group- Returns:
- True if this channel is part of a group
-
addEffect
- Specified by:
addEffect
in interfaceLXEffect.Container
-
removeEffect
- Specified by:
removeEffect
in interfaceLXEffect.Container
-
moveEffect
- Specified by:
moveEffect
in interfaceLXEffect.Container
-
getEffects
- Specified by:
getEffects
in interfaceLXEffect.Container
-
getClip
-
addClip
-
addClip
-
addClip
-
addClip
-
onClipStart
NOT A PUBLIC API! DO NOT CALL THIS! Used by LXClip internals- Parameters:
clip
- Clip that started running on this bus
-
onClipStop
NOT A PUBLIC API! DO NOT CALL THIS! Used by LXClip internals- Parameters:
clip
- Clip that stopped running on this bus
-
getRunningClip
-
getClipLabel
-
stopClips
Stops all clips- Returns:
- this
-
constructClip
-
removeClip
-
removeClip
public void removeClip(int index) -
loop
public void loop(double deltaMs) - Specified by:
loop
in interfaceLXLoopTask
- Overrides:
loop
in classLXModelComponent
-
loop
protected void loop(double deltaMs, boolean runComponents) -
disposeClips
protected void disposeClips() -
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 classLXModulatorComponent
-
getPresetClass
- Specified by:
getPresetClass
in interfaceLXPresetComponent
-
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
-
clear
public void clear() -
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
-
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
-