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
Message
s from the switcher to describe its initial state. If you are interested in these messages use thesetup
parameter to set up handlers for them (seeControllerConnection.when(...)
). When the connection initiation process is finished theConnectionInitiationEnd
message 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
socket
the network socket for the switcher.
eventLoopGroup
the underlying
EventLoopGroup
that will be used for the network connection.setup
a closure that will be called before establishing the connection to the switcher. Use the provided
ControllerConnection
to 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
Message
s from the switcher to describe its initial state. If you are interested in these messages use thesetup
parameter to set up handlers for them (seeControllerConnection.when(...)
). When the connection initiation process is finished theConnectionInitiationEnd
message 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}) throws
Parameters
ipAddress
the IPv4 address of the switcher.
eventLoopGroup
the underlying
EventLoopGroup
that will be used for the network connection.setup
a closure that will be called before establishing the connection to the switcher. Use the provided
ControllerConnection
to 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
message
the 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
slot
The number of the still in the media pool the image will be uploaded to
data
Raw YUV data. Use
Media.encodeRunLength(data: Data)
to convert an RGBA image to the required YUV format.uncompressedSize
The size of the image before run length encoding
-
Undocumented
Declaration
Swift
public func uploadLabel(source: VideoSource, labelImage: Data, longName: String? = nil, shortName: String? = nil)