generated from bitfocus/companion-module-template-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
presets.js
executable file
·156 lines (153 loc) · 7.54 KB
/
presets.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import { combineRgb } from '@companion-module/base'
const white = combineRgb(255, 255, 255)
const blue = combineRgb(0, 0, 255)
const black = combineRgb(0, 0, 0)
export function Presets() {
let image_up =
'iVBORw0KGgoAAAANSUhEUgAAAEgAAAA6AQMAAAApyY3OAAABS2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDAgNzkuMTYwNDUxLCAyMDE3LzA1LzA2LTAxOjA4OjIxICAgICAgICAiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIi8+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgo8P3hwYWNrZXQgZW5kPSJyIj8+LUNEtwAAAARnQU1BAACxjwv8YQUAAAABc1JHQgCuzhzpAAAABlBMVEUAAAD///+l2Z/dAAAAAXRST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IyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIi8+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgo8P3hwYWNrZXQgZW5kPSJyIj8+LUNEtwAAAARnQU1BAACxjwv8YQUAAAABc1JHQgCuzhzpAAAABlBMVEUAAAD///+l2Z/dAAAAAXRSTlMAQObYZgAAAHhJREFUKM+10LERgCAMQFE4CktHcBRWcRMYzVEcwdKCI+od+fGksVCq3/AuiXOfvZnaNXzRClVrEKtMLdSqP2RTRQAFMAFGwAlw7MAk0sAzGnhVoerLKg/F5Pv4NoFNZZNGpk9sxJYeLsDdL5T7S8IFOM/R3OZ+fQeQZV9pMy+bVgAAAABJRU5ErkJggg=='
let image_home =
'iVBORw0KGgoAAAANSUhEUgAAAEgAAABIAQAAAAB9lo7qAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAnRSTlMAAHaTzTgAAAACYktHRAAAqo0jMgAAAAd0SU1FB+cKGRU5CLqG5T0AAACxSURBVCjPvdKxDcMgFIRhkAu6MAIrZAPWSgeuspY3yAqMQEmBuJwfD2WB2K/6C/TpJNuYK2/DKoes5XFoBRStiKqV0LTw6TMs3mNxC3TDKui7UTA0kyYY6zNOMJVXmCCO7vvk9uHG4ibohsMuoO/cJ2Bo3CdgrNwnYCrcJyAfQUBygIAnBgE3chBwIwe+ZZEDQRY5EMzGkgNBeuQIPmQfT/ed96v8x6r8DveXlbryj/sCFVTW+nB/xBkAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjMtMTAtMjVUMjE6NTc6MDMrMDA6MDBgfQ2rAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIzLTEwLTI1VDIxOjU3OjAzKzAwOjAwESC1FwAAAABJRU5ErkJggg=='
var result = {
'pan-tilt-left': {
type: 'button',
category: 'Pan/Tilt/Zoom',
name: 'left',
style: { text: '<', color: white, bgcolor: blue },
steps: [
{
down: [{ actionId: 'left_action', options: {} }],
up: [{ actionId: 'stop_action', options: {} }],
},
],
},
'pan-tilt-right': {
type: 'button',
category: 'Pan/Tilt/Zoom',
name: 'right',
style: { text: '>', color: white, bgcolor: blue },
steps: [
{
down: [{ actionId: 'right_action', options: {} }],
up: [{ actionId: 'stop_action', options: {} }],
},
],
},
'pan-tilt-real-left': {
type: 'button',
category: 'Pan/Tilt/Zoom',
name: 'realleft',
style: { text: '', png64: image_left, pngalignment: 'center:center', size: 'auto', color: white, bgcolor: blue },
steps: [
{
down: [{ actionId: 'right_action', options: {} }],
up: [{ actionId: 'stop_action', options: {} }],
},
],
},
'pan-tilt-real-right': {
type: 'button',
category: 'Pan/Tilt/Zoom',
name: 'realright',
style: { text: '', png64: image_right, pngalignment: 'center:center', size: 'auto', color: white, bgcolor: blue },
steps: [
{
down: [{ actionId: 'left_action', options: {} }],
up: [{ actionId: 'stop_action', options: {} }],
},
],
},
'pan-tilt-up': {
type: 'button',
category: 'Pan/Tilt/Zoom',
name: 'up',
style: { text: '', png64: image_up, pngalignment: 'center:center', size: 'auto', color: white, bgcolor: blue },
steps: [
{
down: [{ actionId: 'up_action', options: {} }],
up: [{ actionId: 'stop_action', options: {} }],
},
],
},
'pan-tilt-down': {
type: 'button',
category: 'Pan/Tilt/Zoom',
name: 'down',
style: { text: '', png64: image_down, pngalignment: 'center:center', size: 'auto', color: white, bgcolor: blue },
steps: [
{
down: [{ actionId: 'down_action', options: {} }],
up: [{ actionId: 'stop_action', options: {} }],
},
],
},
'zoom-in': {
type: 'button',
category: 'Pan/Tilt/Zoom',
name: 'in',
style: { text: 'ZOOM IN', size: '18', color: white, bgcolor: black },
steps: [
{
down: [{ actionId: 'zoom_in_action', options: {} }],
up: [{ actionId: 'zoom_stop_action', options: {} }],
},
],
},
'zoom-out': {
type: 'button',
category: 'Pan/Tilt/Zoom',
name: 'out',
style: { text: 'ZOOM OUT', size: '18', color: white, bgcolor: black },
steps: [
{
down: [{ actionId: 'zoom_out_action', options: {} }],
up: [{ actionId: 'zoom_stop_action', options: {} }],
},
],
},
'home': {
type: 'button',
name: 'home',
category: 'Pan/Tilt/Zoom',
style: { text: '', png64: image_home, pngalignment: 'center:center', size: 'auto', color: white, bgcolor: blue },
steps: [
{
down: [{ actionId: 'home_action', options: {} }],
up: [],
},
],
},
}
for (var i = 0; i < 255; i++) {
result[`recall-preset-${i}`] = {
type: 'button',
name: `recall-preset-${i}`,
category: 'Recall Preset',
style: { text: `Recall\nPreset\n${i}`, color: white, bgcolor: combineRgb(0, 128, 0) },
steps: [
{
down: [{ actionId: 'recall_action', options: { preset: i } }],
up: [],
},
],
}
result[`set-preset-${i}`] = {
type: 'button',
name: `set-preset-${i}`,
category: 'Set Preset',
style: { text: `Set\nPreset\n${i}`, color: white, bgcolor: combineRgb(128, 0, 0) },
steps: [
{
down: [{ actionId: 'set_action', options: { preset: i } }],
up: [],
},
],
}
}
return result
}