2019-11-20 01:31:01 +00:00
|
|
|
package streamdeck
|
|
|
|
|
|
|
|
import (
|
|
|
|
"image"
|
|
|
|
"image/color"
|
|
|
|
|
|
|
|
"github.com/sstallion/go-hid"
|
|
|
|
)
|
|
|
|
|
|
|
|
type keyDirection uint
|
|
|
|
|
|
|
|
const (
|
|
|
|
keyDirectionLTR keyDirection = iota
|
|
|
|
keyDirectionRTL
|
|
|
|
)
|
|
|
|
|
|
|
|
type deckConfig interface {
|
|
|
|
SetDevice(dev *hid.Device)
|
|
|
|
|
|
|
|
NumKeys() int
|
|
|
|
KeyColumns() int
|
|
|
|
KeyRows() int
|
|
|
|
KeyDirection() keyDirection
|
|
|
|
KeyDataOffset() int
|
|
|
|
|
|
|
|
TransformKeyIndex(keyIdx int) int
|
|
|
|
|
|
|
|
IconSize() int
|
|
|
|
IconBytes() int
|
|
|
|
|
|
|
|
Model() uint16
|
|
|
|
|
|
|
|
FillColor(keyIdx int, col color.RGBA) error
|
|
|
|
FillImage(keyIdx int, img image.Image) error
|
|
|
|
FillPanel(img image.RGBA) error
|
|
|
|
|
|
|
|
ClearKey(keyIdx int) error
|
|
|
|
ClearAllKeys() error
|
|
|
|
|
|
|
|
SetBrightness(pct int) error
|
|
|
|
|
|
|
|
ResetToLogo() error
|
|
|
|
|
|
|
|
GetFimwareVersion() (string, error)
|
|
|
|
}
|
|
|
|
|
|
|
|
var decks = map[uint16]deckConfig{
|
|
|
|
StreamDeckOriginalV2: &deckConfigOriginalV2{},
|
2020-06-06 13:12:07 +00:00
|
|
|
StreamDeckXL: &deckConfigXL{},
|
2022-02-05 17:31:10 +00:00
|
|
|
StreamDeckMini: &deckConfigMini{},
|
2022-10-06 16:05:47 +00:00
|
|
|
StreamDeckMiniV2: &deckConfigMini{},
|
2019-11-20 01:31:01 +00:00
|
|
|
}
|