Module |
|
Header |
/Engine/Plugins/VirtualProduction/DMX/DMXProtocol/Source/DMXProtocol/Public/IO/DMXPortManager.h |
Include |
#include "IO/DMXPortManager.h" |
class FDMXPortManager
Manager for all DMX ports. Exposes available input and output ports anywhere.
A) Overview of the IO System - for developers that want to send and receive DMX
Definition of Ports in Project Settings:
DMX Protocol Settings (the DMX Project Settings) holds arrays of DMX 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.
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.)2. 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.
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.
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.4. Send DMX from your object:
Use the DMXOutputPort's SendDMX method to output DMX
Name | Description | ||
---|---|---|---|
|
FDMXOnIOsAvaila... |
OnIOsAvailable |
Broadcast when Input and Output Ports are available |
|
FDMXOnPortsChan... |
OnPortsChanged |
Broadcast when port arrays or data changed |
Name | Description | |
---|---|---|
|
FDMXPortManager() |
Initialization. |
|
FDMXPortManager ( |
Non-copyable. |
Name | Description | |
---|---|---|
|
~FDMXPortManager() |
Name | Description | ||
---|---|---|---|
|
AreIOsAvailable() |
Returns true once Input and Output Ports are available |
|
|
AreProtocolsSuspended() |
Returns true if protocols are suspended |
|
|
FDMXInputPor... |
FindInputPortByGuid ( |
Returns the input port matching the port guid. Returns nullptr if the port doesn't exist. |
|
FDMXInputPor... |
FindInputPortByGuidChecked ( |
Returns the input port matching the port guid, checkedversion. |
|
FDMXOutputPo... |
FindOutputPortByGuid ( |
Returns the output port matching the port guid. Returns nullptr if the port doesn't exist. |
|
FDMXOutputPo... |
FindOutputPortByGuidChecked ( |
Returns the output port matching the port guid, checked version. |
|
FDMXPortShar... |
FindPortByGuid ( |
Returns the port matching the port guid. Returns nullptr if the port doesn't exist. |
|
FDMXPortShar... |
FindPortByGuidChecked ( |
Returns the port matching the port guid, checked version. |
|
FDMXPortMana... |
Get() |
|
|
FDMXInputPor... |
GetInputPortFromConfigChecked ( |
Gets the input port that corresponds to the input port config. |
|
const TArray... |
GetInputPorts() |
|
|
FDMXOutputPo... |
GetOutputPortFromConfigChecked ( |
Gets the output port that corresponds to the input port config. |
|
const TArray... |
GetOutputPorts() |
|
|
ShutdownManager() |
Destroys the manager. |
|
|
StartupManager() |
Initializes the manager |
|
|
SuspendProtocols() |
Thread-safe: Suspends the protocols irrevocably, and with it all sending and receiving of DMX via the protocols. |
|
|
UpdateFromProtocolSettings() |
Updates ports from protocol settings. Useful when project settings were modified in some way |
Name | Description | ||
---|---|---|---|
|
operator= ( |
Name |
Description |
---|---|
FDMXOnIOsAvailableDelegate |
|
FDMXOnPortsChangedDelegate |
Name |
Description |
---|---|
CurrentManager |