Skip to content
This repository was archived by the owner on Dec 17, 2022. It is now read-only.

Commit a4f422d

Browse files
committed
Formatting - now using pure xo with custom config.
1 parent 527b838 commit a4f422d

12 files changed

+2111
-2116
lines changed

ControlThemAll.js

Lines changed: 1131 additions & 1136 deletions
Large diffs are not rendered by default.

ControllerAtem.js

Lines changed: 101 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,134 +1,134 @@
1-
import debug from 'debug';
2-
import {Atem} from 'atem-connection';
3-
import {EventEmitter} from 'inf-ee';
1+
import debug from 'debug'
2+
import { Atem } from 'atem-connection'
3+
import { EventEmitter } from 'inf-ee'
44

5-
const log = debug('sio:atem');
5+
const log = debug('sio:atem')
66

7-
const ATEM_DEFAULT_ADDRESS = '192.168.10.240';
7+
const ATEM_DEFAULT_ADDRESS = '192.168.10.240'
88

99
export class ControllerAtem extends EventEmitter {
10-
constructor(options = {}) {
11-
super();
12-
console.log('Constructing ATEM Controller');
10+
constructor(options = {}) {
11+
super()
12+
console.log('Constructing ATEM Controller')
1313

14-
this.componentName = 'ATEM Controller';
14+
this.componentName = 'ATEM Controller'
1515

16-
this.sessionId = -1;
16+
this.sessionId = -1
1717

18-
this._address = options.address || ATEM_DEFAULT_ADDRESS;
19-
this._atem = undefined;
20-
}
18+
this._address = options.address || ATEM_DEFAULT_ADDRESS
19+
this._atem = undefined
20+
}
2121

22-
connect(options = {}) {
23-
this._address = options.address || ATEM_DEFAULT_ADDRESS;
22+
connect(options = {}) {
23+
this._address = options.address || ATEM_DEFAULT_ADDRESS
2424

25-
this._atem = new Atem();
25+
this._atem = new Atem()
2626

27-
// This._atem.on('debug', (msg) => this.log('debug', msg))
28-
this._atem.on('info', message => this.log('info', message));
29-
this._atem.on('error', message => this.log('error', message));
27+
// This._atem.on('debug', (msg) => this.log('debug', msg))
28+
this._atem.on('info', (message) => this.log('info', message))
29+
this._atem.on('error', (message) => this.log('error', message))
3030

31-
this._atem.on('disconnected', () => {
32-
this.log('info', 'Disconnected');
33-
this.emit('disconnect', {sessionId: this.sessionId});
34-
});
31+
this._atem.on('disconnected', () => {
32+
this.log('info', 'Disconnected')
33+
this.emit('disconnect', { sessionId: this.sessionId })
34+
})
3535

36-
this._atem.on('connected', () => {
37-
this.log('info', 'Connected');
38-
this.sessionId += 1;
39-
this.emit('connected', {isReconnect: (this.sessionId > 0), sessionId: this.sessionId});
40-
});
36+
this._atem.on('connected', () => {
37+
this.log('info', 'Connected')
38+
this.sessionId += 1
39+
this.emit('connected', { isReconnect: this.sessionId > 0, sessionId: this.sessionId })
40+
})
4141

42-
this._atem.on('stateChanged', (state, pathToChange) => this.emit('stateChanged', {state, pathToChange}));
43-
this._atem.on('receivedCommand', command => this.emit('receivedCommand', {command}));
42+
this._atem.on('stateChanged', (state, pathToChange) => this.emit('stateChanged', { state, pathToChange }))
43+
this._atem.on('receivedCommand', (command) => this.emit('receivedCommand', { command }))
4444

45-
this._atem.connect(this._address).catch(error => {
46-
this.log('error', error);
47-
});
48-
}
45+
this._atem.connect(this._address).catch((error) => {
46+
this.log('error', error)
47+
})
48+
}
4949

50-
disconnect() {
51-
if (this._atem) {
52-
this._atem.disconnect();
53-
}
54-
}
50+
disconnect() {
51+
if (this._atem) {
52+
this._atem.disconnect()
53+
}
54+
}
5555

56-
getState() {
57-
return this._atem.state;
58-
}
56+
getState() {
57+
return this._atem.state
58+
}
5959

60-
getProgramInput(me = 0) {
61-
return this._atem.state.video.mixEffects[me].programInput;
62-
}
60+
getProgramInput(me = 0) {
61+
return this._atem.state.video.mixEffects[me].programInput
62+
}
6363

64-
getPreviewInput(me = 0) {
65-
return this._atem.state.video.mixEffects[me].previewInput;
66-
}
64+
getPreviewInput(me = 0) {
65+
return this._atem.state.video.mixEffects[me].previewInput
66+
}
6767

68-
isUpstreamKeyerActive(me = 0, usk = 0) {
69-
return this._atem.state.video.mixEffects[me].upstreamKeyers[usk].onAir;
70-
}
68+
isUpstreamKeyerActive(me = 0, usk = 0) {
69+
return this._atem.state.video.mixEffects[me].upstreamKeyers[usk].onAir
70+
}
7171

72-
getUpstreamKeyerFillSource(me = 0, usk = 0) {
73-
return this._atem.state.video.mixEffects[me].upstreamKeyers[usk].fillSource;
74-
}
72+
getUpstreamKeyerFillSource(me = 0, usk = 0) {
73+
return this._atem.state.video.mixEffects[me].upstreamKeyers[usk].fillSource
74+
}
7575

76-
getUpstreamKeyerType(me = 0, usk = 0) {
77-
return this._atem.state.video.mixEffects[me].upstreamKeyers[usk].mixEffectKeyType;
78-
}
76+
getUpstreamKeyerType(me = 0, usk = 0) {
77+
return this._atem.state.video.mixEffects[me].upstreamKeyers[usk].mixEffectKeyType
78+
}
7979

80-
getTransitionDuration(me = 0) {
81-
return this._atem.state.video.mixEffects[me].transitionSettings.mix.rate;
82-
}
80+
getTransitionDuration(me = 0) {
81+
return this._atem.state.video.mixEffects[me].transitionSettings.mix.rate
82+
}
8383

84-
setUpstreamKeyerType(...args) {
85-
return this._atem.setUpstreamKeyerType(...args);
86-
}
84+
setUpstreamKeyerType(...args) {
85+
return this._atem.setUpstreamKeyerType(...args)
86+
}
8787

88-
setUpstreamKeyerDVESettings(...args) {
89-
return this._atem.setUpstreamKeyerDVESettings(...args);
90-
}
88+
setUpstreamKeyerDVESettings(...args) {
89+
return this._atem.setUpstreamKeyerDVESettings(...args)
90+
}
9191

92-
changePreviewInput(...args) {
93-
return this._atem.changePreviewInput(...args);
94-
}
92+
changePreviewInput(...args) {
93+
return this._atem.changePreviewInput(...args)
94+
}
9595

96-
setTransitionStyle(...args) {
97-
return this._atem.setTransitionStyle(...args);
98-
}
96+
setTransitionStyle(...args) {
97+
return this._atem.setTransitionStyle(...args)
98+
}
9999

100-
setUpstreamKeyerFillSource(...args) {
101-
return this._atem.setUpstreamKeyerFillSource(...args);
102-
}
100+
setUpstreamKeyerFillSource(...args) {
101+
return this._atem.setUpstreamKeyerFillSource(...args)
102+
}
103103

104-
autoTransition(...args) {
105-
return this._atem.autoTransition(...args);
106-
}
104+
autoTransition(...args) {
105+
return this._atem.autoTransition(...args)
106+
}
107107

108-
cut(...args) {
109-
return this._atem.cut(...args);
110-
}
108+
cut(...args) {
109+
return this._atem.cut(...args)
110+
}
111111

112-
setFairlightAudioMixerSourceProps(...args) {
113-
return this._atem.setFairlightAudioMixerSourceProps(...args);
114-
}
112+
setFairlightAudioMixerSourceProps(...args) {
113+
return this._atem.setFairlightAudioMixerSourceProps(...args)
114+
}
115115

116-
fadeToBlack(...args) {
117-
return this._atem.fadeToBlack(...args);
118-
}
119-
120-
setUpstreamKeyerFlyKeyKeyframe(...args) {
121-
return this._atem.setUpstreamKeyerFlyKeyKeyframe(...args);
122-
}
123-
124-
runUpstreamKeyerFlyKeyTo(...args) {
125-
return this._atem.runUpstreamKeyerFlyKeyTo(...args);
126-
}
127-
128-
log(level, ...args) {
129-
this.emit('log', {component: this.componentName, level: level.toLowerCase(), message: args});
130-
log(`${level.toLowerCase()}: ${args}`);
131-
}
116+
fadeToBlack(...args) {
117+
return this._atem.fadeToBlack(...args)
118+
}
119+
120+
setUpstreamKeyerFlyKeyKeyframe(...args) {
121+
return this._atem.setUpstreamKeyerFlyKeyKeyframe(...args)
122+
}
123+
124+
runUpstreamKeyerFlyKeyTo(...args) {
125+
return this._atem.runUpstreamKeyerFlyKeyTo(...args)
126+
}
127+
128+
log(level, ...args) {
129+
this.emit('log', { component: this.componentName, level: level.toLowerCase(), message: args })
130+
log(`${level.toLowerCase()}: ${args}`)
131+
}
132132
}
133133

134-
export default ControllerAtem;
134+
export default ControllerAtem

ControllerConfig.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
import fs from 'node:fs';
2-
import merge from 'deepmerge';
3-
import YAML from 'yaml';
1+
import fs from 'node:fs'
2+
import merge from 'deepmerge'
3+
import YAML from 'yaml'
44

55
export class ControllerConfig {
6-
constructor() {
7-
this.config = undefined;
8-
}
6+
constructor() {
7+
this.config = undefined
8+
}
99

10-
async getConfig() {
11-
if (this.config) {
12-
console.log('Config already loaded and just returning!');
13-
return this.config;
14-
}
10+
async getConfig() {
11+
if (this.config) {
12+
console.log('Config already loaded and just returning!')
13+
return this.config
14+
}
1515

16-
console.log('Loading the configuration from the YAML files');
16+
console.log('Loading the configuration from the YAML files')
1717

18-
const configDefault = YAML.parse(fs.readFileSync('./config.default.yaml', 'utf8'));
19-
const configUser = YAML.parse(fs.readFileSync('./config.user.yaml', 'utf8'));
18+
const configDefault = YAML.parse(fs.readFileSync('./config.default.yaml', 'utf8'))
19+
const configUser = YAML.parse(fs.readFileSync('./config.user.yaml', 'utf8'))
2020

21-
this.config = merge(configDefault, configUser);
21+
this.config = merge(configDefault, configUser)
2222

23-
// Console.log(`config:`, config)
23+
// Console.log(`config:`, config)
2424

25-
this.config.dve.stateMain = {...this.config.dve.stateDefault};
26-
this.config.dve.stateCurrent = {...this.config.dve.stateDefault};
25+
this.config.dve.stateMain = { ...this.config.dve.stateDefault }
26+
this.config.dve.stateCurrent = { ...this.config.dve.stateDefault }
2727

28-
return this.config;
29-
}
28+
return this.config
29+
}
3030
}
3131

32-
export default ControllerConfig;
32+
export default ControllerConfig

0 commit comments

Comments
 (0)