Package heronarts.lx.output
Class LXDatagram
java.lang.Object
heronarts.lx.LXComponent
heronarts.lx.output.LXOutput
heronarts.lx.output.LXBufferOutput
heronarts.lx.output.LXDatagram
- All Implemented Interfaces:
LXPath
,LXSerializable
,LXOutput.InetOutput
,LXParameterListener
- Direct Known Subclasses:
ArtNetDatagram
,ArtSyncDatagram
,DDPDatagram
,KinetDatagram
,OPCDatagram
,StreamingACNDatagram
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
protected static class
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 TypeFieldDescriptionprotected final byte[]
final BooleanParameter
Whether this datagram is in an error stateFields 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
ModifierConstructorDescriptionprotected
LXDatagram
(LX lx, IndexBuffer indexBuffer, int datagramSize) -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Invoked when the datagram is no longer needed.Gets the address this datagram sends tobyte[]
Returns the data bufferprotected LXDatagram.ErrorState
int
getPort()
Gets the destination port number this datagram is sent toprotected void
onSend
(int[] colors, LXOutput.GammaTable glut, double brightness) Invoked by engine to send this packet when new color data is available.setAddress
(InetAddress address) Sets the destination address of this datagramsetPort
(int port) Sets the destination port number to send this datagram tosetSocket
(DatagramSocket socket) protected void
Subclasses may override to update a sequence number in the packet when appropriate as part of the protocol.protected void
Methods inherited from class heronarts.lx.output.LXBufferOutput
getDataBufferOffset, 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
-
buffer
protected final byte[] buffer -
error
Whether this datagram is in an error state
-
-
Constructor Details
-
LXDatagram
-
-
Method Details
-
validateBufferSize
protected void validateBufferSize() -
setSocket
-
getErrorState
-
setAddress
Sets the destination address of this datagram- Specified by:
setAddress
in interfaceLXOutput.InetOutput
- Parameters:
address
- Destination address- Returns:
- this
-
getAddress
Gets the address this datagram sends to- Specified by:
getAddress
in interfaceLXOutput.InetOutput
- Returns:
- Destination address
-
setPort
Sets the destination port number to send this datagram to- Specified by:
setPort
in interfaceLXOutput.InetOutput
- Parameters:
port
- Port number- Returns:
- this
-
getPort
public int getPort()Gets the destination port number this datagram is sent to- Specified by:
getPort
in interfaceLXOutput.InetOutput
- Returns:
- Destination port number
-
getDataBuffer
public byte[] getDataBuffer()Returns the data buffer- Specified by:
getDataBuffer
in classLXBufferOutput
- Returns:
- Raw byte buffer for output data
-
updateSequenceNumber
protected void updateSequenceNumber()Subclasses may override to update a sequence number in the packet when appropriate as part of the protocol. -
onSend
Invoked by engine to send this packet when new color data is available. The LXDatagram should update the packet object accordingly to contain the appropriate buffer. -
dispose
public void dispose()Invoked when the datagram is no longer needed. Typically a no-op, but subclasses may override if cleanup work is necessary.- Overrides:
dispose
in classLXComponent
-