sACN
2.0.2
Implementation of ANSI E1.31 (Streaming ACN)
|
View other versions:
|
An instance of sACN DMX Merger functionality; see Using the sACN DMX Merger API. More...
#include <dmx_merger.h>
Data Structures | |
struct | Settings |
A set of configuration settings that a merger needs to initialize. More... | |
Public Types | |
using | Handle = etcpal::OpaqueId<detail::DmxMergerHandleType, sacn_dmx_merger_t, SACN_DMX_MERGER_INVALID> |
Public Member Functions | |
DmxMerger (const DmxMerger &other)=delete | |
DmxMerger & | operator= (const DmxMerger &other)=delete |
DmxMerger (DmxMerger &&other)=default | |
DmxMerger & | operator= (DmxMerger &&other)=default |
etcpal::Error | Startup (const Settings &settings) |
Create a new merger instance. | |
void | Shutdown () |
Destroy a merger instance. | |
etcpal::Expected< sacn_dmx_merger_source_t > | AddSource () |
Adds a new source to the merger. | |
etcpal::Error | RemoveSource (sacn_dmx_merger_source_t source) |
Removes a source from the merger. | |
const SacnDmxMergerSource * | GetSourceInfo (sacn_dmx_merger_source_t source) const |
Gets a read-only view of the source data. | |
etcpal::Error | UpdateLevels (sacn_dmx_merger_source_t source, const uint8_t *new_levels, size_t new_levels_count) |
Updates a source's levels and recalculates outputs. | |
etcpal::Error | UpdatePap (sacn_dmx_merger_source_t source, const uint8_t *pap, size_t pap_count) |
Updates a source's per-address priorities (PAP) and recalculates outputs. | |
etcpal::Error | UpdateUniversePriority (sacn_dmx_merger_source_t source, uint8_t universe_priority) |
Updates a source's universe priority and recalculates outputs. | |
etcpal::Error | RemovePap (sacn_dmx_merger_source_t source) |
Removes the per-address priority (PAP) data from the source and recalculate outputs. | |
constexpr Handle | handle () const |
Get the current handle to the underlying C DMX merger. | |
An instance of sACN DMX Merger functionality; see Using the sACN DMX Merger API.
This class instantiates software mergers for buffers containing DMX512-A start code 0 packets. It also uses buffers containing DMX512-A start code 0xdd packets to support per-address priority.
When asked to calculate the merge, the merger will evaluate the current source buffers and update two result buffers:
See Using the sACN DMX Merger API for a detailed description of how to use this API.
using Handle = etcpal::OpaqueId<detail::DmxMergerHandleType, sacn_dmx_merger_t, SACN_DMX_MERGER_INVALID> |
A handle type used by the sACN library to identify merger instances.
|
inline |
Adds a new source to the merger.
Adds a new source to the merger, if the maximum number of sources hasn't been reached. The returned source id is used for two purposes:
|
inline |
Gets a read-only view of the source data.
Looks up the source data and returns a pointer to the data or nullptr if it doesn't exist. This pointer is owned by the library, and must not be modified by the application. The pointer will only be valid until the source or merger is removed.
[in] | source | The id of the source. |
|
inlineconstexpr |
Get the current handle to the underlying C DMX merger.
|
inline |
Removes the per-address priority (PAP) data from the source and recalculate outputs.
Per-address priority data can time out in sACN just like levels. This is a convenience function to immediately turn off the per-address priority data for a source and recalculate the outputs.
[in] | source | The id of the source to modify. |
|
inline |
Removes a source from the merger.
Removes the source from the merger. This causes the merger to recalculate the outputs.
[in] | source | The id of the source to remove. |
|
inline |
Destroy a merger instance.
Tears down the merger and cleans up its resources.
|
inline |
Create a new merger instance.
Creates a new merger that uses the passed in config data. The application owns all buffers in the config, so be sure to call Shutdown() before destroying the buffers.
[in] | settings | Configuration parameters for the DMX merger to be created. |
|
inline |
Updates a source's levels and recalculates outputs.
This function updates the levels of the specified source, and then triggers the recalculation of each slot. For each slot, the source will only be included in the merge if it has a priority at that slot. Otherwise the level will be saved for when a priority is eventually inputted.
[in] | source | The id of the source to modify. |
[in] | new_levels | The new DMX levels to be copied in, starting from the first slot. |
[in] | new_levels_count | The length of new_levels. If this is less than DMX_ADDRESS_COUNT, the levels for all remaining levels will be set to 0. |
|
inline |
Updates a source's per-address priorities (PAP) and recalculates outputs.
This function updates the per-address priorities (PAP) of the specified source, and then triggers the recalculation of each slot. For each slot, the source will only be included in the merge if it has a priority at that slot.
If PAP is not specified for all levels, then the remaining levels will default to a PAP of 0. To remove PAP for this source and revert to the universe priority, call DmxMerger::RemovePap.
[in] | source | The id of the source to modify. |
[in] | pap | The per-address priorities to be copied in, starting from the first slot. |
[in] | pap_count | The length of pap. |
|
inline |
Updates a source's universe priority and recalculates outputs.
This function updates the universe priority of the specified source, and then triggers the recalculation of each slot. For each slot, the source will only be included in the merge if it has a priority at that slot.
If this source currently has per-address priorities (PAP) via DmxMerger::UpdatePap, then the universe priority can have no effect on the merge results until the application calls DmxMerger::RemovePap, at which point the priorities of each slot will revert to the universe priority passed in here.
If this source doesn't have PAP, then the universe priority is converted into PAP for each slot. These are the priorities used for the merge. This means a universe priority of 0 will be converted to a PAP of 1.
[in] | source | The id of the source to modify. |
[in] | universe_priority | The universe-level priority of the source. |