Navigation
API > API/Plugins > API/Plugins/DMXProtocol > API/Plugins/DMXProtocol/IO
References
| Module | DMXProtocol |
| Header | /Engine/Plugins/VirtualProduction/DMX/DMXProtocol/Source/DMXProtocol/Public/IO/DMXPortManager.h |
| Include | #include "IO/DMXPortManager.h" |
Syntax
class FDMXPortManager
Remarks
Manager for all DMX ports. Exposes available input and output ports anywhere.
A) Overview of the IO System
- Definition of Ports in Project Settings:
DMX Protocol Settings (the DMX Project Settings) holds two arrays of DMX Input Port Configs resp. DMX Output Port Configs. This is where ports are defined.
Port Manager automatically creates DMXInputPortS and DMXOutputPortS that match these settings. Generally this is self-contained and does not need any user code.
Note: Applications that want to offer dynamic ports should specify a fixed number of ports in project settings, e.g. 8, 16 ports and work with these at runtime. (While it is possible to mutate the protocol settings at runtime and create ports from that via FDMXPortManager.Get()::UpdateFromProtocolSettings(), ports created alike are not available in blueprints as port references, hence this approach is disfavored in most situations.)
- Acquire a DMXInputPort or DMXOutputPort:
Get all input ports or all output ports available via the Port Manager's GetInputPorts and GetOutputPorts methods. Alternatively use the Editor-Only SDMXPortSelector widget to select a port from available ports.
- Receive DMX in an object:
a) Latest (frame time relevant) data on the Game-Thread:
- Call the port's GameThreadGetDMXSignal method to get a DMX Signal of a local universe.
b) All data on any thread:
- Create an instance of DMXRawListener. Use its constructor to specify which port it should use.
- Use DequeueSignal to receive DMX.
Note: This applies for both input and output ports. This is to provide loopback functionality for outputs. Generally you want to listen to input and output ports, not just the inputs.
Note: GameThreadGetDMXSignal is the right method to use for almost any use-case. DMXRawListener is only useful where the latest data isn't sufficient, e.g. to record all incoming data in Sequencer. DMXRawListener is thread-safe, but may stall the engine when used in the game-thread due to the possibly infinite work load it leaves to the user.
- Send DMX from your object:
Use the DMXOutputPort's SendDMX method to send DMX.
Variables
| Type | Name | Description | |
|---|---|---|---|
| FDMXOnPortsChangedDelegate | OnPortsChanged | Broadcast when port arrays or data changed |
Constructors
| Type | Name | Description | |
|---|---|---|---|
| Initialization. | |||
FDMXPortManager
(
FDMXPortManager const& |
Non-copyable. |
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| bool | Returns true if protocols are suspended | ||
| FDMXInputPortSharedPtr | FindInputPortByGuid
(
const FGuid& PortGuid |
Returns the input port matching the port guid. Returns nullptr if the port doesn't exist. | |
| FDMXInputPortSharedRef | FindInputPortByGuidChecked
(
const FGuid& PortGuid |
Returns the input port matching the port guid, checkedversion. | |
| FDMXOutputPortSharedPtr | FindOutputPortByGuid
(
const FGuid& PortGuid |
Returns the output port matching the port guid. Returns nullptr if the port doesn't exist. | |
| FDMXOutputPortSharedRef | FindOutputPortByGuidChecked
(
const FGuid& PortGuid |
Returns the output port matching the port guid, checked version. | |
| FDMXPortSharedPtr | FindPortByGuid
(
const FGuid& PortGuid |
Returns the port matching the port guid. Returns nullptr if the port doesn't exist. | |
| FDMXPortSharedRef | FindPortByGuidChecked
(
const FGuid& PortGuid |
Returns the port matching the port guid, checked version. | |
| FDMXPortManager & | Get () |
||
| FDMXInputPortSharedRef | GetInputPortFromConfigChecked
(
const FDMXInputPortConfig& InputPortConfig |
Gets the input port that corresponds to the input port config. | |
| const TArray< FDMXInputPortSharedRef > & | |||
| FDMXOutputPortSharedRef | GetOutputPortFromConfigChecked
(
const FDMXOutputPortConfig& OutputPortConfig |
Gets the output port that corresponds to the input port config. | |
| const TArray< FDMXOutputPortSharedRef > & | |||
| void | Destroys the manager. | ||
| void | Initializes the manager | ||
| void | Thread-safe: Suspends the protocols irrevocably, and with it all sending and receiving of DMX via the protocols. | ||
| void | UpdateFromProtocolSettings
(
bool bForceUpdateRegistrationWithProtocol |
Updates ports from protocol settings. |
Operators
| Type | Name | Description | |
|---|---|---|---|
| void | operator=
(
FDMXPortManager const& x |
Constants
| Name | Description |
|---|---|
| CurrentManager |