{"id":13872283,"url":"https://github.com/Dev1an/Swift-Atem","last_synced_at":"2025-07-16T02:30:39.338Z","repository":{"id":45398602,"uuid":"134415984","full_name":"Dev1an/Swift-Atem","owner":"Dev1an","description":"Blackmagic Design Atem network protocol implementation in swift 5.1 using NIO 2","archived":false,"fork":false,"pushed_at":"2023-10-25T15:08:19.000Z","size":8961,"stargazers_count":55,"open_issues_count":8,"forks_count":27,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-14T12:07:29.000Z","etag":null,"topics":["atem","communication","implementation","networking","nio","protocol","sdk","swift","swift-nio","swift5"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dev1an.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-05-22T13:03:26.000Z","updated_at":"2024-03-26T23:17:25.000Z","dependencies_parsed_at":"2024-01-16T10:09:29.833Z","dependency_job_id":null,"html_url":"https://github.com/Dev1an/Swift-Atem","commit_stats":{"total_commits":170,"total_committers":3,"mean_commits":"56.666666666666664","dds":0.02352941176470591,"last_synced_commit":"b1ab46e3e59353cf18a9093b8fc9ed53917f6e47"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dev1an%2FSwift-Atem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dev1an%2FSwift-Atem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dev1an%2FSwift-Atem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dev1an%2FSwift-Atem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dev1an","download_url":"https://codeload.github.com/Dev1an/Swift-Atem/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226095663,"owners_count":17572970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["atem","communication","implementation","networking","nio","protocol","sdk","swift","swift-nio","swift5"],"created_at":"2024-08-05T23:00:38.651Z","updated_at":"2024-11-23T20:30:53.998Z","avatar_url":"https://github.com/Dev1an.png","language":"Swift","readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/swift-5.1-orange.svg\" alt=\"Swift 5.1\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Platform-macOS%20%7C%20Linux-brightgreen.svg\" alt=\"Platforms: macOS \u0026 Linux\"\u003e\n\u003c/p\u003e\n\n# Atem network protocol implementation\n\nImplementation of BlackMagicDesign's ATEM communication protocol in Swift. It is written on top of Apple's  networking library [NIO](https://github.com/apple/swift-nio) and implements both sides of the protocol: the control panel and the switcher side. This means that you can not only use it to control atem switchers but also to connect to your control panels without the need for a switcher. Opening a whole new world of applications for the Atem control panels. An example can be found at [Atem-Simulator](https://github.com/Dev1an/Atem-Simulator)\n\nStarting from version 1.0.0 this package uses Swift 5 and NIO2.\n\n### Tested platforms\n\n- macOS 10.14.6 on a MacBook Pro retina 15\" late 2013\n- macOS 10.15.3 on a MacBook Pro retina 15\" late 2013\n- Raspbian GNU/Linux 9 stretch on a Raspberry Pi model 3 B\n- Raspbian GNU/Linux 10 Buster on a Raspberry Pi 4 model B Rev 1.2\n\n## Installation\n\nWhen starting a new project: create a Swift package via [SPM](https://swift.org/package-manager/)\n\n```shell\n# Shell\n\u003e swift package init # --type empty|library|executable|system-module\n```\n\nThen add this library to the [package description](https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageDescriptionV4.md#dependencies)'s dependencies\n\n```swift\n.package(url: \"https://github.com/Dev1an/Swift-Atem\", from: \"1.0.0\")\n```\n\nAnd resolve this new dependency\n\n```sh\n# Shell\n\u003e swift package resolve\n```\n\nFinally import the `Atem` module in your code\n\n```swift\nimport Atem\n```\n\nYou are now ready to create atem controllers and switchers 😎 !\n\n## Usage\n\nAfter looking at the following examples, study the [API reference](https://dev1an.github.io/Swift-Atem/) for more details.\n\n### Controller\n\nThis example shows how to create a controller that connects to a swicther at ip address 10.1.0.67 and print a message whenever the preview bus changes.\n\n```swift\ntry Controller(ipAddress: \"10.1.0.67\") { connection in\n  connection.when{ (change: PreviewBusChanged) in\n    print(change) // prints: 'Preview bus changed to input(x)'\n  }\n}\n```\n\n**Sending messages**\n\nTo send a message to the switcher use the `send(...)` method like this:\n\n```swift\ncontroller.send(message: ChangeTransitionPosition(to: 5000))\n```\n\n### Switcher\n\nThe following example shows how to emulate the basic functionality of an atem switcher. It will forward incoming messages containing transition and preview \u0026 program bus changes to all connected controllers.\n\nThis snippet is also included in a seperate SPM target \"Simulator\" (./Sources/Simulator) and can be run by simply executing `swift run Simulator` in the terminal.\n\n```swift\nlet switcher = Switcher { controllers in\n  controllers.when { (change: ChangePreviewBus, _) in\n    controllers.send(\n      PreviewBusChanged(\n        to: change.previewBus,\n        mixEffect: change.mixEffect\n      )\n    )\n  }\n  controllers.when{ (change: ChangeProgramBus, _) in\n    controllers.send(\n      ProgramBusChanged(\n        to: change.programBus,\n        mixEffect: change.mixEffect\n      )\n    )\n  }\n  controllers.when { (change: ChangeTransitionPosition, _) in\n    controllers.send(\n      TransitionPositionChanged(\n        to: change.position,\n        remainingFrames: 250 - UInt8(change.position/40),\n        mixEffect: change.mixEffect\n      )\n    )\n  }\n  controllers.when { (change: ChangeAuxiliaryOutput, _) in\n    controllers.send(\n      AuxiliaryOutputChanged(\n        source: change.source,\n        output: change.output\n      )\n    )\n  }\n}\n```\n","funding_links":[],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDev1an%2FSwift-Atem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDev1an%2FSwift-Atem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDev1an%2FSwift-Atem/lists"}