IDMXProtocol

Serves as a higher level abstraction of a specific protocol such as Art-Net or sACN with the purpose to hide its complexity.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

DMXProtocol

Header

/Engine/Plugins/VirtualProduction/DMX/DMXProtocol/Source/DMXProtocol/Public/Interfaces/IDMXProtocol.h

Include

#include "Interfaces/IDMXProtocol.h"

Syntax

class IDMXProtocol : public IDMXProtocolBase

Remarks

Serves as a higher level abstraction of a specific protocol such as Art-Net or sACN with the purpose to hide its complexity.

By that the commonly expected responsability of the implementation is to:

  • Provide a way to send and receive protocol specific DMX from and to the system.

  • Push received DXM as generic DMXSignals to the registered DMXInputPorts.

  • Pull generic DMXSignals from the registered DMXOutputPorts and send it as Protocol specific DMX.

For an overview for DMX and protocol developers, see DMXPortManager (in IO folder) For an exemplary implementation, see DMXProtocolArtNet (in ProtocolArtNetModule)

FOR PROTOCOL DEVELOPERS

Naming Guideline/Terminology

Senders, Receivers Send and Receive Protocol specific DMX. For protocol implementations only, should not be publicly exposed. InputPorts, OutputPorts Send and Receive Protocol agnostic DMX. Listeners Listen to DMX traffic of Ports and input heard DMX into the engine.

DMX Protocol Life-Cycle

Startup:

DMX Protocol Module gets instantiated (Pre-Default).

  • DMX Protocol Manager gets created

  • DMX Protocol Settings CDO gets created

Modules that implement actual protocol (e.g. DMXProtocolArtNet) are instantiated.

  • Each module registeres itself with the Protocol Module via IDMXProtocolModule::RegisterProtocol

  • The module waits for all protocols being registered

  • A check is hit if more protocol modules register itself than expected To add a new protocol you need to increase the counter in DMXProtocolModule.

DMX Port Manager gets started

  • Looks up DMX Protocol Settings instantiates DMX Ports according to the DMX Port Config Arrays

  • Calls FDMXPort::Initialize on each port right after instantiation.

The DMX Ports register themselves with their protocol by calling IDMXProtocol::RegisterInputPort resp. IDMXProtocol::RegisterOutputPort.

  • Pass received DMX by calling DMXInputPort::SingleProducerInputDMXSignal on all Input Ports. The Input Ports do the required filtering for relevant data, you don't need to do it.

  • The protocol needs to return an object that implements IDMXSender for each registered OutputPort.

  • If an Input Port cannot be registered, e.g. because the network interface is not reachable, the protocol needs to return false.

  • If an Output Port cannot be registered, e.g. because the network interface is not reachable, the protocol needs to return nullptr. (see DMXProtocolArtNet for an example)

Functions

Name Description

Public function Static

IDMXProtocol...

 

Get

(
    const FName& ProtocolName
)

If protocol exists return the pointer otherwise it create a new protocol first and then return the pointer.

Public function Static

FName

 

GetFirstProtocolName()

Public function Const

const TArray...

 

GetInputPortCommunicationTypes()

Returns the communication types the protocol supports for its input ports.

Public function Const

int32

 

GetMaxUniverseID()

Get maximum supported universe ID for protocol

Public function Const

int32

 

GetMinUniverseID()

Get minimum supported universe ID for protocol

Public function Const

const TArray...

 

GetOutputPortCommunicationTypes()

Returns the communication types the protocol supports for its input ports.

Public function Static

const TMap< ...

 

GetProtocolFactories()

~End IDMXProtocol Interface definition

Public function Const

const FName ...

 

GetProtocolName()

Get the Protocol Name

Public function Static

const TArray...

 

GetProtocolNames()

Public function Static

const TMap< ...

 

GetProtocols()

Public function

bool

 

IsCausingLoopback

(
    EDMXCommunicationType InCommunicati...
)

Called to deduce if the communication type will be heard by corresponding input ports.

Public function Const

bool

 

IsEnabled()

Whether protocol enabled

Public function Const

bool

 

IsValidUniverseID

(
    int32 UniverseID
)

Returns true if the Universe ID is valid for the protocol

Public function Const

int32

 

MakeValidUniverseID

(
    int32 DesiredUniverseID
)

Returns a valid Universe ID as close as possible to the provided Universe ID

Public function

bool

 

RegisterInputPort

(
    const FDMXInputPortSharedRef& Inpu...
)

Called to register a DMXInputPort with the protocol.

Public function

TSharedPtr< ...

 

RegisterOutputPort

(
    const FDMXOutputPortSharedRef& Out...
)

Called to register a DMXOutputPort with the protocol.

Public function

void

 

UnregisterInputPort

(
    const FDMXInputPortSharedRef& Inpu...
)

Called to unregister a DMXInputPort with the protocol.

Public function

void

 

UnregisterOutputPort

(
    const FDMXOutputPortSharedRef& Out...
)

Called to unregister a DMXOutputPort with the protocol.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss