clj-artnet.impl.protocol.dmx
Pure DMX merge and processing logic (Art-Net 4).
any-port-merging?
(any-port-merging? state)Returns true if any port is merging multiple sources.
at-source-limit?
(at-source-limit? sources source-key)Returns true if adding new source exceeds limit (2).
merge-htp
(merge-htp old new)Returns new byte array with max value at each position (HTP).
merge-sources
(merge-sources mode sources)Returns merged source data using specified mode (:htp/:ltp).
merge-sources-htp
(merge-sources-htp sources)Returns {:data bytes :length N} merged via HTP.
merge-sources-ltp
(merge-sources-ltp sources)Returns {:data bytes :length N} from most recent source (LTP).
port-merge-mode
(port-merge-mode state port-index)Returns merge mode for port index. Default :htp.
process-artdmx-merge
(process-artdmx-merge state packet sender timestamp)Processes ArtDmx packet with multi-source merge tracking.
Returns map: :state - updated state :output-data - bytes :output-length - int :emit? - boolean :merging? - boolean :source-rejected? - boolean
prune-by-age
(prune-by-age m now cutoff-ns)(prune-by-age m now cutoff-ns timestamp-key)Returns map with entries older than cutoff-ns removed.
prune-merge-sources
(prune-merge-sources sources timestamp)Returns sources map with stale entries removed.
sync-sender-matches?
(sync-sender-matches? state sync-sender)Returns true if ArtSync sender matches recent ArtDmx sender.