Controller
public class Controller
An interface to
- send commands to an ATEM Switcher
- react upon incomming state change messages from the ATEM Switcher
To make an anology with real world devices: this class can be compared to a BlackMagicDesign Control Panel. It is used to control a production switcher.
-
Declaration
Swift
public var channel: EventLoopFuture<Channel>? -
Start a new Controller that connects to an ATEM Switcher specified by its IP address.
When a connection to a switcher is being initialized it will receive
Messages from the switcher to describe its initial state. If you are interested in these messages use thesetupparameter to set up handlers for them (seeControllerConnection.when(...)). When the connection initiation process is finished theConnectionInitiationEndmessage will be sent. From that moment on you know that a connection is succesfully established.Declaration
Swift
public init(socket: SocketAddress, eventLoopGroup: EventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount), setup: (ControllerConnection) -> Void = {_ in})Parameters
socketthe network socket for the switcher.
eventLoopGroupthe underlying
EventLoopGroupthat will be used for the network connection.setupa closure that will be called before establishing the connection to the switcher. Use the provided
ControllerConnectionto register callbacks for incoming messages from the switcher. -
Start a new Controller that connects to an ATEM Switcher specified by its IP address.
When a connection to a switcher is being initialized it will receive
Messages from the switcher to describe its initial state. If you are interested in these messages use thesetupparameter to set up handlers for them (seeControllerConnection.when(...)). When the connection initiation process is finished theConnectionInitiationEndmessage will be sent. From that moment on you know that a connection is succesfully established.Declaration
Swift
public convenience init(ipAddress: String, eventLoopGroup: EventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: System.coreCount), setup: (ControllerConnection) -> Void = {_ in}) throwsParameters
ipAddressthe IPv4 address of the switcher.
eventLoopGroupthe underlying
EventLoopGroupthat will be used for the network connection.setupa closure that will be called before establishing the connection to the switcher. Use the provided
ControllerConnectionto register callbacks for incoming messages from the switcher. -
Undocumented
Declaration
Swift
public var address: SocketAddress { get } -
Sends a message to the connected switcher.
Declaration
Swift
public func send(message: SerializableMessage)Parameters
messagethe message that will be sent to the switcher
-
Upload an image to the Media Pool
Declaration
Swift
public func uploadStill(slot: UInt16, data: Data, uncompressedSize: UInt32)Parameters
slotThe number of the still in the media pool the image will be uploaded to
dataRaw YUV data. Use
Media.encodeRunLength(data: Data)to convert an RGBA image to the required YUV format.uncompressedSizeThe size of the image before run length encoding
-
Undocumented
Declaration
Swift
public func uploadLabel(source: VideoSource, labelImage: Data, longName: String? = nil, shortName: String? = nil)
View on GitHub
Controller Class Reference