Package heronarts.lx.clip
Class LXClipLane<T extends LXClipEvent<?>>
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.clip.LXClipLane<T>
- All Implemented Interfaces:
LXPath,LXSerializable,LXParameterListener
- Direct Known Subclasses:
MidiNoteClipLane,ParameterClipLane,PatternClipLane
-
Nested Class Summary
Nested 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 LXClipprotected static final Stringprotected final LXEngineThreadArrayList<T> final MutableParameterprotected booleanfinal BooleanParameterfinal MutableParameterfinal BooleanParameterprotected static final Stringprotected static final Stringprotected static final StringFields 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 TypeMethodDescriptionprotected void_insertEvent(T event) protected voidbeginLoadEvents(List<T> loadEvents) protected intcursorInsertIndex(Cursor cursor) protected intcursorInsertIndex(List<T> events, Cursor cursor) protected Cursor.OperatorCursorOp()protected intcursorPlayIndex(Cursor cursor) protected intcursorPlayIndex(List<T> events, Cursor cursor) protected voidendLoadEvents(List<T> loadEvents) inteventIndex(List<T> events, Cursor fromCursor, boolean inclusive) inteventIndex(List<T> events, Cursor fromCursor, boolean inclusive, int offset) eventIterator(Cursor fromCursor) Gets an iterator over this clip lane's events, starting from the position specified by the cursor.eventIterator(Cursor fromCursor, int offset) Gets an iterator over this clip lane's events, starting from the position specified by the cursor.eventIterator(List<T> events, Cursor fromCursor, boolean inclusive) Gets an iterator over the the events beginning at a given cursor positioneventIterator(List<T> events, Cursor fromCursor, int offset) Gets an iterator over this clip lane's events, starting from the position specified by the cursor.intgetIndex()abstract StringgetLabel()Accessor for the user-facing label of this component.protected TGets the last event in the lane occurring at or before the time value of the current cursor position.protected TgetPreviousEvent(Cursor cursor) Gets the last event occurring before this cursor insert position, if any.protected TgetPreviousEvent(List<T> events, Cursor cursor) Gets the last event occurring before this cursor insert position, if any.insertEvent(T event) voidload(LX lx, JsonObject obj) Loads the LX component.protected abstract TloadEvent(LX lx, JsonObject eventObj) protected final LXClipLane<T> recordEvent(T event) removeEvent(T event) Remove the given event from this clip laneremoveEvents(List<Integer> eventIndices) Remove events at the given indices, which must be sorted ascendingbooleanremoveRange(Cursor from, Cursor to) protected booleanremoveRange(Cursor from, Cursor to, boolean notify) protected voidreverseEvents(List<T> events) voidsave(LX lx, JsonObject obj) Serializes the LX component.protected voidsetEventNormalized(T event, double value) voidsetEventsCursors(ArrayList<T> originalEvents, Cursor fromSelectionMin, Cursor fromSelectionMax, Cursor toSelectionMin, Cursor toSelectionMax, Map<T, Double> fromValues, Map<T, Cursor> fromCursors, Map<T, Cursor> toCursors, LXCommand.Clip.Event.SetCursors.Operation operation) Set the cursors for a set of events in a range.protected TstitchInner(List<T> events, Cursor cursor, int rightIndex, boolean isMin, boolean force) protected intstitchInsertIfNeeded(List<T> events, T stitch, boolean after) protected TstitchOuter(List<T> events, Cursor cursor, int rightIndex) protected booleanstitchRemoveIfRedundant(List<T> events, T stitch, int index) protected TstitchSelectionMax(List<T> originalEvents, List<T> modifiedEvents, Cursor selectionMax, int stitchIndex, boolean force) protected TstitchSelectionMin(List<T> originalEvents, List<T> modifiedEvents, Cursor selectionMin, int stitchIndex, boolean force) Methods inherited from class heronarts.lx.LXComponent
addArray, addChild, addInternalParameter, addLegacyInternalParameter, addLegacyParameter, addParameter, addParameter, addParameters, assertDisposed, contains, copyParameters, dispose, getCategory, getChild, getComponentDescription, getComponentName, getComponentName, getComponentName, getDescription, getId, getLX, getOscAddress, getOscLabel, getOscPath, getParameter, getParameters, getParent, getPath, handleOscMessage, hasParameter, isValidOscParameter, loadParameters, loadPreset, onParameterChanged, 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.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
-
Field Details
-
uiHeight
-
uiExpanded
-
uiMaximized
-
onChange
-
clip
-
overdubActive
protected boolean overdubActive -
mutableEvents
-
events
-
KEY_LANE_TYPE
- See Also:
-
VALUE_LANE_TYPE_PARAMETER
- See Also:
-
VALUE_LANE_TYPE_PATTERN
- See Also:
-
VALUE_LANE_TYPE_MIDI_NOTE
- See Also:
-
-
Constructor Details
-
LXClipLane
-
-
Method Details
-
CursorOp
-
getIndex
public int getIndex() -
recordEvent
-
getUIThreadEvents
-
eventIterator
Gets an iterator over this clip lane's events, starting from the position specified by the cursor. The iterator will start at the first event with time equal to or after that cursor.- Parameters:
fromCursor- Cursor to begin iteration from (inclusive)- Returns:
- Iterator over events equal to or after the cursor
-
eventIterator
Gets an iterator over this clip lane's events, starting from the position specified by the cursor. The iterator will start at the first event with time equal to or after that cursor, with an offset specified in # of events- Parameters:
fromCursor- Cursor to begin iteration from (inclusive)offset- Offset the iterator by a number of events from the cursor- Returns:
- Iterator over events equal to or after the cursor, plus offset
-
eventIterator
Gets an iterator over this clip lane's events, starting from the position specified by the cursor. The iterator will start at the first event with time equal to or after that cursor, with an offset specified in # of events- Parameters:
events- Event listfromCursor- Cursor to begin iteration from (inclusive)offset- Offset the iterator by a number of events from the cursor- Returns:
- Iterator over events equal to or after the cursor, plus offset
-
eventIterator
Gets an iterator over the the events beginning at a given cursor position- Parameters:
events- Events to get an iterator forfromCursor- Cursor to iterate frominclusive- Whether to include events strictly at fromCursor- Returns:
- Iterator beginning at fromCursor
-
eventIndex
-
eventIndex
-
cursorPlayIndex
-
cursorInsertIndex
-
cursorPlayIndex
-
cursorInsertIndex
-
_insertEvent
-
insertEvent
-
moveEvent
-
getPreviousEvent
Gets the last event occurring before this cursor insert position, if any. Events already in the array with a cursor exactly equal to this cursor are considered to all be previous.- Parameters:
events- List of eventscursor- Cursor position- Returns:
- Last event with time equal to or less than this cursor
-
getPreviousEvent
Gets the last event occurring before this cursor insert position, if any. Events already in the array with a cursor exactly equal to this cursor are considered to all be previous.- Parameters:
cursor- Cursor position- Returns:
- Last event with time equal to or less than this cursor
-
getPreviousEvent
Gets the last event in the lane occurring at or before the time value of the current cursor position.- Returns:
- Last event equal to or before this cursor position
-
setEventsCursors
public void setEventsCursors(ArrayList<T> originalEvents, Cursor fromSelectionMin, Cursor fromSelectionMax, Cursor toSelectionMin, Cursor toSelectionMax, Map<T, Double> fromValues, Map<T, Cursor> fromCursors, Map<T, Cursor> toCursors, LXCommand.Clip.Event.SetCursors.Operation operation) Set the cursors for a set of events in a range. This event will also destructively clobber any events that the new stretched selection range overlaps with (other than those strictly contained in the set of modified cursors).- Parameters:
originalEvents- The original reference event list to modifyfromSelectionMin- Original lower bound on selection rangefromSelectionMax- Original upper bound on selection rangetoSelectionMin- New lower bound on selection rangetoSelectionMax- New upper bound on selection rangefromValues- Ordered map of original event values, pre-modificationfromCursors- Ordered map of original position of events pre-modificationtoCursors- Ordered map of events to re-position from within the original rangeoperation- What kind of modification operation this is
-
reverseEvents
-
setEventNormalized
-
stitchSelectionMin
-
stitchSelectionMax
-
stitchInner
-
stitchOuter
-
stitchInsertIfNeeded
-
stitchRemoveIfRedundant
-
getLabel
Description copied from class:LXComponentAccessor for the user-facing label of this component. Objects that implement theLXComponent.Renamableinterface may allow the user to change this value.- Specified by:
getLabelin interfaceLXPath- Overrides:
getLabelin classLXComponent- Returns:
- Label for this component
-
removeRange
-
removeRange
-
removeEvent
Remove the given event from this clip lane- Parameters:
event- Event to remove- Returns:
- this
-
removeEvents
Remove events at the given indices, which must be sorted ascending- Parameters:
eventIndices- List of event indices to remove, sorted ascending- Returns:
- this
-
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 classLXComponent- Parameters:
lx- LX instanceobj- Object to deserialize
-
beginLoadEvents
-
endLoadEvents
-
loadEvent
-
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 classLXComponent- Parameters:
lx- LX instanceobj- Object to serialize into
-