Coder Social home page Coder Social logo

trinitynazarene / atem-connection-camera-control Goto Github PK

View Code? Open in Web Editor NEW

This project forked from julusian/atem-connection-camera-control

0.0 0.0 0.0 358 KB

ATEM Camera control support for `atem-connection`

License: MIT License

JavaScript 1.79% TypeScript 98.21%

atem-connection-camera-control's Introduction

ATEM connection camera control - @atem-connection/camera-control

Node CI npm

Usage

This library can be used with atem-connection NPM Github, to provide a friendly interface for camera control.

Example:

import { Atem } from 'atem-connection'
import { AtemCameraControlDirectCommandSender, AtemCameraControlStateBuilder } from '@atem-connection/camera-control'

// Create the class which tracks the current state from the atem
const cameraControlState = new AtemCameraControlStateBuilder(4)

const atem = new Atem({})
atem.connect('10.0.0.1')

// Create the command sender. Alternatively `AtemCameraControlBatchCommandSender` can be used to be able to batch multiple commands to be sent once
const cameraControlSender = new AtemCameraControlDirectCommandSender(atem)

atem.on('connected', () => {
	console.log('connected')

	// Perform an autofocus of camera 1 after a short timeout
	setTimeout(() => {
		cameraControlSender.triggerAutoFocus(1)
	}, 1000)
})
atem.on('disconnected', () => {
	cameraControlState.reset()
})

atem.on('receivedCommands', (commands) => {
	const cameraCommands = []
	for (const command of commands) {
		if (command instanceof Commands.CameraControlUpdateCommand) cameraCommands.push(command)
	}

	const changes = cameraControlState.applyCommands(cameraCommands)

	// Do something based on the reported changes
	console.log('camera changes', changes)
})

Development

Setting up

  • Clone the repository
  • Install a compatible version of nodejs and yarn
  • Build the project with yarn build

Modifying the code

You can run yarn build:main --watch to rebuild the typescript code, which will re-run upon saving a file.

There are some unit tests, which can be run with yarn unit. This command calls into jest, so any jest arguments can also be used

atem-connection-camera-control's People

Contributors

julusian avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.