-
Notifications
You must be signed in to change notification settings - Fork 2
/
feedbacks.js
52 lines (47 loc) · 1.18 KB
/
feedbacks.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { combineRgb } from '@companion-module/base'
export function getFeedbacks() {
const feedbacks = {}
const ColorWhite = combineRgb(255, 255, 255)
const ColorBlack = combineRgb(0, 0, 0)
const ColorRed = combineRgb(200, 0, 0)
const ColorGreen = combineRgb(0, 200, 0)
const ColorOrange = combineRgb(255, 102, 0)
feedbacks['decodeSourceName'] = {
type: 'boolean',
name: 'Change style based on current decode source name',
description: 'Change style if current source name matches selected source',
defaultStyle: {
bgcolor: ColorGreen,
},
options: [
{
type: 'dropdown',
label: 'Source',
id: 'source',
choices: this.device.list,
default: 'None',
allowCustom: true,
},
],
callback: (feedback) => {
if (this.device.decodeSource === feedback.options.source) {
return true
}
},
}
feedbacks['decodeSourceStatus'] = {
type: 'boolean',
name: 'Change style if current decode source connected',
description: 'Change style if current source is connected',
defaultStyle: {
bgcolor: ColorGreen,
},
options: [],
callback: () => {
if (this.device.sourceStatus == 'Connected') {
return true
}
},
}
return feedbacks
}