forked from dh1tw/streamdeck
/
devices.go
53 lines (49 loc) · 1.36 KB
/
devices.go
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
package streamdeck
type StreamdeckDevice struct {
ProductID uint16
Name string
NumButtons int
ButtonSize int
StreamBuffer int
Spacer int
NumButtonColumns int
NumButtonRows int
}
var streamdeckDevices = []*StreamdeckDevice{
&StreamdeckDevice{
ProductID: 0x0060, // legacy
Name: "Legacy Stream Deck",
NumButtons: 15, // 5x3
ButtonSize: 72,
StreamBuffer: 8192, // ??? test me
Spacer: 19,
NumButtonColumns: 5,
NumButtonRows: 3,
},
&StreamdeckDevice{
ProductID: 0x0063, // mini
Name: "Stream Deck Mini",
NumButtons: 6, // 3x2
ButtonSize: 80,
StreamBuffer: 1024,
Spacer: 19, // ?? is this value event relevant?
NumButtonColumns: 3,
NumButtonRows: 2,
},
&StreamdeckDevice{
ProductID: 0x0090, // mini mk2
Name: "Stream Deck Mini",
NumButtons: 6, // 3x2
ButtonSize: 80,
StreamBuffer: 1024,
Spacer: 19, // ?? is this value event relevant?
NumButtonColumns: 3,
NumButtonRows: 2,
},
}
func (dev *StreamdeckDevice) PanelWidth() int {
return dev.NumButtonColumns*dev.ButtonSize + dev.Spacer*(dev.NumButtonColumns-1)
}
func (dev *StreamdeckDevice) PanelHeight() int {
return dev.NumButtonRows*dev.ButtonSize + dev.Spacer*(dev.NumButtonRows-1)
}