forked from bitfocus/companion-module-behringer-xair
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupgrades.js
73 lines (66 loc) · 1.54 KB
/
upgrades.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { CreateConvertToBooleanFeedbackUpgradeScript } from '@companion-module/base'
import { combineRgb } from '@companion-module/base'
import { ICON_SOLO } from './icons.js'
export const UpgradeScripts = [
// grab these values for later
function (context, props) {
const result = {
updatedConfig: null,
updatedActions: [],
updatedFeedbacks: [],
}
for (let action of props.actions) {
if (['mute', 'mMute', 'usbMute'].includes(action.actionId)) {
if (action.options.mute === null) {
action.options.mute = '0'
result.updatedActions.push(action)
}
}
if ('mute_grp' == action.action) {
if (action.options.mute === null) {
action.options.mute = '1'
result.updatedActions.push(action)
}
}
}
return result
},
CreateConvertToBooleanFeedbackUpgradeScript({
'solo_mute': true,
'solo_mono': true,
'solo_dim': true,
'rtn': true,
'lr': true,
'fxsend': true,
'dca': true,
'bus': true,
'ch': true,
'solosw_aux': true,
'solosw_bus': true,
'solosw_ch': true,
'solosw_dca': true,
'solosw_fxr': true,
'solosw_fxs': true,
'solosw_lr': true,
'rtn/aux': true,
'config/mute': true,
}),
function (context, props) {
const result = {
updatedConfig: null,
updatedActions: [],
updatedFeedbacks: [],
}
for (let fb of props.feedbacks) {
if (fb.type.match(/^solosw_/) && Object.keys(fb.style).length == 0) {
fb.style = {
color: combineRgb(255, 255, 255),
bgcolor: 0,
png64: ICON_SOLO,
}
result.updatedFeedbacks.push(fb)
}
}
return result
},
]