Skip to content

Commit fd76152

Browse files
committed
Update to latest version of unix-streamdeck/api
1 parent 3f3bcae commit fd76152

File tree

45 files changed

+113117
-4184
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+113117
-4184
lines changed

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/godbus/dbus/v5 v5.2.2
99
github.com/linuxdeepin/go-x11-client v0.0.0-20240415051504-c8e43d028ff9
1010
github.com/shirou/gopsutil/v3 v3.24.5
11-
github.com/unix-streamdeck/api/v2 v2.0.7
11+
github.com/unix-streamdeck/api/v2 v2.0.10
1212
github.com/unix-streamdeck/driver v0.0.0-20260218200545-edb2f975e560
1313
golang.org/x/sync v0.19.0
1414
golang.org/x/sys v0.41.0
@@ -19,11 +19,9 @@ require (
1919
github.com/fogleman/gg v1.3.0 // indirect
2020
github.com/go-ole/go-ole v1.3.0 // indirect
2121
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
22-
github.com/golang/mock v1.6.0 // indirect
2322
github.com/gorilla/websocket v1.5.3 // indirect
2423
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
2524
github.com/mitchellh/mapstructure v1.5.0 // indirect
26-
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 // indirect
2725
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
2826
github.com/shoenig/go-m1cpu v0.1.6 // indirect
2927
github.com/tklauser/go-sysconf v0.3.16 // indirect

go.sum

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ github.com/godbus/dbus/v5 v5.2.2 h1:TUR3TgtSVDmjiXOgAAyaZbYmIeP3DPkld3jgKGV8mXQ=
1616
github.com/godbus/dbus/v5 v5.2.2/go.mod h1:3AAv2+hPq5rdnr5txxxRwiGjPXamgoIHgz9FPBfOp3c=
1717
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
1818
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
19-
github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc=
20-
github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs=
2119
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
2220
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
2321
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
@@ -36,8 +34,6 @@ github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2
3634
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
3735
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
3836
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
39-
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
40-
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
4137
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
4238
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
4339
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c h1:ncq/mPwQF4JjgDlrVEn3C11VoGHZN7m8qihwgMEtzYw=
@@ -48,55 +44,33 @@ github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFt
4844
github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ=
4945
github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU=
5046
github.com/shoenig/test v0.6.4/go.mod h1:byHiCGXqrVaflBLAMq/srcZIHynQPQgeyvkvXnjqq0k=
51-
github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4=
52-
github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0=
5347
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
5448
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
5549
github.com/tklauser/go-sysconf v0.3.16 h1:frioLaCQSsF5Cy1jgRBrzr6t502KIIwQ0MArYICU0nA=
5650
github.com/tklauser/go-sysconf v0.3.16/go.mod h1:/qNL9xxDhc7tx3HSRsLWNnuzbVfh3e7gh/BmM179nYI=
5751
github.com/tklauser/numcpus v0.11.0 h1:nSTwhKH5e1dMNsCdVBukSZrURJRoHbSEQjdEbY+9RXw=
5852
github.com/tklauser/numcpus v0.11.0/go.mod h1:z+LwcLq54uWZTX0u/bGobaV34u6V7KNlTZejzM6/3MQ=
59-
github.com/unix-streamdeck/api/v2 v2.0.7 h1:t5vLPMBRlK82o1iEoSBbilzrEUICVRobJGDnRGFoo10=
60-
github.com/unix-streamdeck/api/v2 v2.0.7/go.mod h1:9tuXdO0s6MnKFc8sClvoRcMJJSoskUw2Tv0XKEKDUdg=
53+
github.com/unix-streamdeck/api/v2 v2.0.10 h1:8tszm1ZK8D1B+tlVSgelVPateIbPDis1cM2VbM7fzmI=
54+
github.com/unix-streamdeck/api/v2 v2.0.10/go.mod h1:2yOlKNII/qcEQtnk1G9x2GsUiOeh/oUfzF6AvoqSp44=
6155
github.com/unix-streamdeck/driver v0.0.0-20260218200545-edb2f975e560 h1:2URWAKL6xEJMivGpa8FjHFtUX//PeHd5d2FtucGYxu4=
6256
github.com/unix-streamdeck/driver v0.0.0-20260218200545-edb2f975e560/go.mod h1:qi7NaUSVogFHAxq+VSK7GRFFTLBpPtvL+La6EDlcsy8=
63-
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
6457
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
6558
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
66-
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
67-
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
59+
go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y=
60+
go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU=
6861
golang.org/x/image v0.0.0-20200119044424-58c23975cae1/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
6962
golang.org/x/image v0.36.0 h1:Iknbfm1afbgtwPTmHnS2gTM/6PPZfH+z2EFuOkSbqwc=
7063
golang.org/x/image v0.36.0/go.mod h1:YsWD2TyyGKiIX1kZlu9QfKIsQ4nAAK9bdgdrIsE7xy4=
71-
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
72-
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
73-
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
74-
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
75-
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
76-
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
7764
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
7865
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
7966
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
80-
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
81-
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
8267
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
83-
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
8468
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
85-
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
86-
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
8769
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
8870
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
8971
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
90-
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
9172
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
92-
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
93-
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
94-
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
95-
golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
96-
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
97-
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
9873
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
99-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
10074
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
10175
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
10276
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

streamdeckd/config.go

Lines changed: 3 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -53,61 +53,9 @@ func readConfig() (*api.ConfigV3, error) {
5353
}
5454
var config api.ConfigV3
5555
err = json.Unmarshal(data, &config)
56-
if err != nil || config.Decks == nil || allKeysEmpty(config) {
57-
var config1 api.ConfigV1
58-
var config2 api.ConfigV2
59-
err = json.Unmarshal(data, &config1)
60-
if err == nil && config1.Pages != nil {
61-
SaveFile(configPath+".v1", config1)
62-
config2 = api.ConfigV2{Modules: config1.Modules, Decks: []api.DeckV2{{Pages: config1.Pages, Serial: ""}}}
63-
migrateConfigFromV1 = true
64-
} else {
65-
err = json.Unmarshal(data, &config2)
66-
if err != nil {
67-
log.Fatalln("Could not parse config, shutting down", err)
68-
return &api.ConfigV3{}, err
69-
}
70-
}
71-
SaveFile(configPath+".v2", config2)
72-
var decksV3 []api.DeckV3
73-
for _, deck := range config2.Decks {
74-
var pagesV3 []api.PageV3
75-
deckV3 := api.DeckV3{Serial: deck.Serial}
76-
for _, page := range deck.Pages {
77-
pageV3 := api.PageV3{}
78-
for _, key := range page {
79-
defaultMap := make(map[string]*api.KeyConfigV3)
80-
defaultMap[""] = &api.KeyConfigV3{
81-
Icon: key.Icon,
82-
SwitchPage: key.SwitchPage,
83-
Text: key.Text,
84-
TextSize: key.TextSize,
85-
TextAlignment: key.TextAlignment,
86-
Keybind: key.Keybind,
87-
Command: key.Command,
88-
Brightness: key.Brightness,
89-
Url: key.Url,
90-
ObsCommand: key.ObsCommand,
91-
ObsCommandParams: key.ObsCommandParams,
92-
IconHandler: key.IconHandler,
93-
KeyHandler: key.KeyHandler,
94-
IconHandlerFields: key.IconHandlerFields,
95-
KeyHandlerFields: key.KeyHandlerFields,
96-
}
97-
pageV3.Keys = append(pageV3.Keys, api.KeyV3{
98-
Application: defaultMap,
99-
})
100-
}
101-
pagesV3 = append(pagesV3, pageV3)
102-
}
103-
deckV3.Pages = pagesV3
104-
decksV3 = append(decksV3, deckV3)
105-
}
106-
config = api.ConfigV3{
107-
Modules: config2.Modules,
108-
Decks: decksV3,
109-
ObsConnectionInfo: config2.ObsConnectionInfo,
110-
}
56+
if err != nil {
57+
log.Fatalln("Could not parse config, shutting down", err)
58+
return &api.ConfigV3{}, err
11159
}
11260
return &config, nil
11361
}
@@ -184,16 +132,3 @@ func SetConfigPath(path string) {
184132
configPath = basePath + string(os.PathSeparator) + ".streamdeck-config.json"
185133
}
186134
}
187-
188-
func allKeysEmpty(config api.ConfigV3) bool {
189-
for _, deck := range config.Decks {
190-
for _, page := range deck.Pages {
191-
for _, key := range page.Keys {
192-
if !api.CompareKeys(key, api.KeyV3{}) {
193-
return false
194-
}
195-
}
196-
}
197-
}
198-
return true
199-
}

streamdeckd/examples/key/counter.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ func (c *CounterIconHandler) Start(k api.KeyConfigV3, info api.StreamDeckInfoV1,
3333
img := image.NewRGBA(image.Rect(0, 0, info.IconSize, info.IconSize))
3434
draw.Draw(img, img.Bounds(), image.Black, image.ZP, draw.Src)
3535
Count := strconv.Itoa(c.Count)
36-
imgParsed, err := api.DrawText(img, Count, k.TextSize, k.TextAlignment)
36+
imgParsed, err := api.DrawText(img, Count, api.DrawTextOptions{
37+
FontSize: int64(k.TextSize),
38+
VerticalAlignment: api.VerticalAlignment(k.TextAlignment),
39+
})
3740
if err != nil {
3841
log.Println(err)
3942
} else {

streamdeckd/examples/key/gif.go

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,20 @@ func (s *GifIconHandler) Start(key api.KeyConfigV3, info api.StreamDeckInfoV1, c
7373
if !ok {
7474
alignment = ""
7575
}
76-
img, err = api.DrawText(img, text.(string), int(size), alignment.(string))
76+
fontFace, ok := key.IconHandlerFields["font_face"]
77+
if !ok {
78+
fontFace = ""
79+
}
80+
textColour, ok := key.IconHandlerFields["text_colour"]
81+
if !ok {
82+
textColour = ""
83+
}
84+
img, err = api.DrawText(img, text.(string), api.DrawTextOptions{
85+
FontSize: size,
86+
VerticalAlignment: api.VerticalAlignment(alignment.(string)),
87+
FontFace: fontFace.(string),
88+
Colour: textColour.(string),
89+
})
7790
if err != nil {
7891
log.Println(err)
7992
}
@@ -178,7 +191,20 @@ func (s *GifLcdHandler) Start(key api.KnobConfigV3, info api.StreamDeckInfoV1, c
178191
if !ok {
179192
alignment = ""
180193
}
181-
img, err = api.DrawText(img, text.(string), int(size), alignment.(string))
194+
fontFace, ok := key.LcdHandlerFields["font_face"]
195+
if !ok {
196+
fontFace = ""
197+
}
198+
textColour, ok := key.LcdHandlerFields["text_colour"]
199+
if !ok {
200+
textColour = ""
201+
}
202+
img, err = api.DrawText(img, text.(string), api.DrawTextOptions{
203+
FontSize: size,
204+
VerticalAlignment: api.VerticalAlignment(alignment.(string)),
205+
FontFace: fontFace.(string),
206+
Colour: textColour.(string),
207+
})
182208
if err != nil {
183209
log.Println(err)
184210
}
@@ -231,10 +257,24 @@ func RegisterGif() api.Module {
231257
NewIcon: func() api.IconHandler {
232258
return &GifIconHandler{Running: true, Lock: semaphore.NewWeighted(1)}
233259
},
234-
IconFields: []api.Field{{Title: "Icon", Name: "icon", Type: "File", FileTypes: []string{".gif"}}, {Title: "Text", Name: "text", Type: "Text"}, {Title: "Text Size", Name: "text_size", Type: "Number"}, {Title: "Text Alignment", Name: "text_alignment", Type: "TextAlignment"}},
260+
IconFields: []api.Field{
261+
{Title: "Icon", Name: "icon", Type: api.File, FileTypes: []string{".gif"}},
262+
{Title: "Text", Name: "text", Type: api.Text},
263+
{Title: "Text Size", Name: "text_size", Type: api.Number},
264+
{Title: "Text Alignment", Name: "text_alignment", Type: api.TextAlignment},
265+
{Title: "Font Face", Name: "font_face", Type: api.FontFace},
266+
{Title: "Text Colour", Name: "text_colour", Type: api.Colour},
267+
},
235268
NewLcd: func() api.LcdHandler {
236269
return &GifLcdHandler{Running: true, Lock: semaphore.NewWeighted(1)}
237270
},
238-
LcdFields: []api.Field{{Title: "Icon", Name: "icon", Type: "File", FileTypes: []string{".gif"}}, {Title: "Text", Name: "text", Type: "Text"}, {Title: "Text Size", Name: "text_size", Type: "Number"}, {Title: "Text Alignment", Name: "text_alignment", Type: "TextAlignment"}},
271+
LcdFields: []api.Field{
272+
{Title: "Icon", Name: "icon", Type: api.File, FileTypes: []string{".gif"}},
273+
{Title: "Text", Name: "text", Type: api.Text},
274+
{Title: "Text Size", Name: "text_size", Type: api.Number},
275+
{Title: "Text Alignment", Name: "text_alignment", Type: api.TextAlignment},
276+
{Title: "Font Face", Name: "font_face", Type: api.FontFace},
277+
{Title: "Text Colour", Name: "text_colour", Type: api.Colour},
278+
},
239279
}
240280
}

streamdeckd/examples/key/time.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ func (t *TimeIconHandler) timeLoop(k api.KeyConfigV3, info api.StreamDeckInfoV1,
4545
draw.Draw(img, img.Bounds(), image.Black, image.ZP, draw.Src)
4646
t := time.Now()
4747
tString := t.Format("15:04:05")
48-
imgParsed, err := api.DrawText(img, tString, k.TextSize, k.TextAlignment)
48+
imgParsed, err := api.DrawText(img, tString, api.DrawTextOptions{
49+
FontSize: int64(k.TextSize),
50+
VerticalAlignment: api.VerticalAlignment(k.TextAlignment),
51+
})
4952
if err != nil {
5053
log.Println(err)
5154
} else {

streamdeckd/interface.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,12 @@ func SetKeyImageHandlerless(dev *VirtualDev, currentKeyConfig *api.KeyConfigV3,
9292
currentKeyConfig.Buff = img
9393
}
9494
if currentKeyConfig.Text != "" {
95-
img, err := api.DrawText(currentKeyConfig.Buff, currentKeyConfig.Text, currentKeyConfig.TextSize, currentKeyConfig.TextAlignment)
95+
img, err := api.DrawText(currentKeyConfig.Buff, currentKeyConfig.Text, api.DrawTextOptions{
96+
FontSize: int64(currentKeyConfig.TextSize),
97+
VerticalAlignment: api.VerticalAlignment(currentKeyConfig.TextAlignment),
98+
FontFace: currentKeyConfig.FontFace,
99+
Colour: currentKeyConfig.TextColour,
100+
})
96101
if err != nil {
97102
log.Println(err)
98103
} else {
@@ -130,7 +135,12 @@ func SetKnobHandlerless(dev *VirtualDev, currentKnobConfig *api.KnobConfigV3, kn
130135
currentKnobConfig.Buff = img
131136
}
132137
if currentKnobConfig.Text != "" {
133-
img, err := api.DrawText(currentKnobConfig.Buff, currentKnobConfig.Text, currentKnobConfig.TextSize, currentKnobConfig.TextAlignment)
138+
img, err := api.DrawText(currentKnobConfig.Buff, currentKnobConfig.Text, api.DrawTextOptions{
139+
FontSize: int64(currentKnobConfig.TextSize),
140+
VerticalAlignment: api.VerticalAlignment(currentKnobConfig.TextAlignment),
141+
FontFace: currentKnobConfig.FontFace,
142+
Colour: currentKnobConfig.TextColour,
143+
})
134144
if err != nil {
135145
log.Println(err)
136146
} else {

vendor/github.com/golang/mock/AUTHORS

Lines changed: 0 additions & 12 deletions
This file was deleted.

vendor/github.com/golang/mock/CONTRIBUTORS

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)