Package heronarts.lx.output
Class StreamingACNDatagram
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.output.LXOutput
heronarts.lx.output.LXBufferOutput
heronarts.lx.output.LXDatagram
heronarts.lx.output.StreamingACNDatagram
- All Implemented Interfaces:
LXPath
,LXSerializable
,LXOutput.InetOutput
,LXParameterListener
Streaming ACN, also referred to as E1.31, is a standardized protocol for
streaming DMX data over ACN protocol. It's a fairly simple UDP-based wrapper
on 512 bytes of data with a 16-bit universe number.
See: https://tsp.esta.org/tsp/documents/docs/ANSI_E1-31-2018.pdf
-
Nested Class Summary
Nested classes/interfaces inherited from class heronarts.lx.output.LXDatagram
LXDatagram.BufferException, LXDatagram.ErrorState
Nested classes/interfaces inherited from class heronarts.lx.output.LXBufferOutput
LXBufferOutput.ByteEncoder, LXBufferOutput.ByteOrder
Nested classes/interfaces inherited from class heronarts.lx.output.LXOutput
LXOutput.GammaMode, LXOutput.GammaTable, LXOutput.InetOutput
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 TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from class heronarts.lx.output.LXDatagram
buffer, error
Fields inherited from class heronarts.lx.output.LXBufferOutput
indexBuffer
Fields inherited from class heronarts.lx.output.LXOutput
brightness, enabled, framesPerSecond, gamma, gammaMode, MAX_FRAMES_PER_SECOND, whitePointBlue, whitePointGreen, whitePointRed, whitePointWhite
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.output.LXOutput.InetOutput
NO_PORT
Fields inherited from interface heronarts.lx.LXPath
ROOT, ROOT_PREFIX, ROOT_SLASH
-
Constructor Summary
ModifierConstructorDescriptionStreamingACNDatagram
(LX lx, int[] indexBuffer) Constructs a StreamingACNDatagram on default universeStreamingACNDatagram
(LX lx, int[] indexBuffer, int universeNumber) Constructs a datagram, sends the list of point indices on the given universe number.StreamingACNDatagram
(LX lx, int[] indexBuffer, int dataSize, int universeNumber) Creates a StreamingACNDatagram for a given index buffer with fixed data size and universe numberStreamingACNDatagram
(LX lx, int[] indexBuffer, LXBufferOutput.ByteOrder byteOrder, int universeNumber) Creates a StreamingACNDatagrm for given index buffer on universe and byte orderStreamingACNDatagram
(LX lx, int[] indexBuffer, LXBufferOutput.ByteOrder byteOrder, int dataSize, int universeNumber) Creates a StreamingACNDatagram for a given index buffer with fixed data size and universe numberprotected
StreamingACNDatagram
(LX lx, int dataSize, int universeNumber) Subclasses may use this constructor for datagrams with custom DMX data of a fixed length.StreamingACNDatagram
(LX lx, LXModel model) Creates a StreamingACNDatagram for the given modelStreamingACNDatagram
(LX lx, LXModel model, int universeNumber) Creates a StreamingACNDatagram for the model on given universeStreamingACNDatagram
(LX lx, IndexBuffer indexBuffer, int universeNumber) Creates a StreamingACNDatagram for a given index buffer with fixed data size and universe numberStreamingACNDatagram
(LX lx, IndexBuffer indexBuffer, int dataSize, int universeNumber) Creates a StreamingACNDatagram for a given index buffer with fixed data size and universe number -
Method Summary
Modifier and TypeMethodDescriptionprotected int
Offset into raw byte buffer where color data is writtenint
Priority for this sACN datagramint
Universe number for datagram.void
setDmxData
(byte[] data, int channel) void
setDmxData
(byte data, int channel) setPriority
(int priority) Sets the priority for this datagramsetUniverseNumber
(int universeNumber) Sets the universe for this datagramprotected void
Subclasses may override to update a sequence number in the packet when appropriate as part of the protocol.Methods inherited from class heronarts.lx.output.LXDatagram
dispose, getAddress, getDataBuffer, getErrorState, getPort, onSend, setAddress, setPort, setSocket, validateBufferSize
Methods inherited from class heronarts.lx.output.LXBufferOutput
updateDataBuffer
Methods inherited from class heronarts.lx.output.LXOutput
error, error, load, log, onParameterChanged, send, send, setGammaDelegate, setGammaTable, setGammaTable, setGroup
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, getPath, handleOscMessage, hasParameter, isValidOscParameter, loadParameters, loadPreset, removeParameter, removeParameter, removeParameter, removeParameter, save, 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.LXPath
getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, isDescendant
-
Field Details
-
OFFSET_PRIORITY
public static final int OFFSET_PRIORITY- See Also:
-
OFFSET_SEQUENCE_NUMBER
public static final int OFFSET_SEQUENCE_NUMBER- See Also:
-
OFFSET_UNIVERSE_NUMBER
public static final int OFFSET_UNIVERSE_NUMBER- See Also:
-
OFFSET_DMX_DATA
public static final int OFFSET_DMX_DATA- See Also:
-
MAX_DATA_LENGTH
public static final int MAX_DATA_LENGTH- See Also:
-
DEFAULT_PORT
public static final int DEFAULT_PORT- See Also:
-
DEFAULT_PRIORITY
public static final int DEFAULT_PRIORITY- See Also:
-
MAX_PRIORITY
public static final int MAX_PRIORITY- See Also:
-
-
Constructor Details
-
StreamingACNDatagram
Creates a StreamingACNDatagram for the given model- Parameters:
lx
- LX instancemodel
- Model of points
-
StreamingACNDatagram
Constructs a StreamingACNDatagram on default universe- Parameters:
lx
- LX instanceindexBuffer
- Points to send on this universe
-
StreamingACNDatagram
Creates a StreamingACNDatagram for the model on given universe- Parameters:
lx
- LX instancemodel
- Model of pointsuniverseNumber
- Universe number
-
StreamingACNDatagram
Constructs a datagram, sends the list of point indices on the given universe number.- Parameters:
lx
- LX instanceindexBuffer
- List of point indices to encode in packetuniverseNumber
- Universe number
-
StreamingACNDatagram
public StreamingACNDatagram(LX lx, int[] indexBuffer, LXBufferOutput.ByteOrder byteOrder, int universeNumber) Creates a StreamingACNDatagrm for given index buffer on universe and byte order- Parameters:
lx
- LX instanceindexBuffer
- Index bufferuniverseNumber
- Universe numberbyteOrder
- Byte order
-
StreamingACNDatagram
Subclasses may use this constructor for datagrams with custom DMX data of a fixed length.- Parameters:
lx
- LX instancedataSize
- Data sizeuniverseNumber
- Universe number
-
StreamingACNDatagram
Creates a StreamingACNDatagram for a given index buffer with fixed data size and universe number- Parameters:
lx
- LX instanceindexBuffer
- Index bufferdataSize
- Fixed DMX data sizeuniverseNumber
- Universe number
-
StreamingACNDatagram
public StreamingACNDatagram(LX lx, int[] indexBuffer, LXBufferOutput.ByteOrder byteOrder, int dataSize, int universeNumber) Creates a StreamingACNDatagram for a given index buffer with fixed data size and universe number- Parameters:
lx
- LX instanceindexBuffer
- Index bufferbyteOrder
- Byte orderdataSize
- Fixed DMX data sizeuniverseNumber
- Universe number
-
StreamingACNDatagram
Creates a StreamingACNDatagram for a given index buffer with fixed data size and universe number- Parameters:
lx
- LX instanceindexBuffer
- Index bufferuniverseNumber
- Universe number
-
StreamingACNDatagram
Creates a StreamingACNDatagram for a given index buffer with fixed data size and universe number- Parameters:
lx
- LX instanceindexBuffer
- Index bufferdataSize
- Fixed DMX data sizeuniverseNumber
- Universe number
-
-
Method Details
-
setPriority
Sets the priority for this datagram- Parameters:
priority
- sACN priority level, 0-200- Returns:
- this
-
getPriority
public int getPriority()Priority for this sACN datagram- Returns:
- Priority level
-
setUniverseNumber
Sets the universe for this datagram- Parameters:
universeNumber
- DMX universe- Returns:
- this
-
getUniverseNumber
public int getUniverseNumber()Universe number for datagram.- Returns:
- Universe number
-
setDmxData
public void setDmxData(byte data, int channel) -
setDmxData
public void setDmxData(byte[] data, int channel) -
getDataBufferOffset
protected int getDataBufferOffset()Description copied from class:LXBufferOutput
Offset into raw byte buffer where color data is written- Specified by:
getDataBufferOffset
in classLXBufferOutput
- Returns:
- Offset into raw byte buffer for color data
-
updateSequenceNumber
protected void updateSequenceNumber()Description copied from class:LXDatagram
Subclasses may override to update a sequence number in the packet when appropriate as part of the protocol.- Overrides:
updateSequenceNumber
in classLXDatagram
-