Documentation ¶
Index ¶
- Constants
- type BtnEvent
- type BtnState
- type Page
- type ReadErrorCb
- type StreamDeck
- func (sd *StreamDeck) ClearAllBtns()
- func (sd *StreamDeck) ClearBtn(btnIndex int) error
- func (sd *StreamDeck) Close() error
- func (sd *StreamDeck) FillColor(btnIndex, r, g, b int) error
- func (sd *StreamDeck) FillImage(btnIndex int, img image.Image) error
- func (sd *StreamDeck) FillImageFromFile(keyIndex int, path string) error
- func (sd *StreamDeck) FillPanel(img image.Image) error
- func (sd *StreamDeck) FillPanelFromFile(path string) error
- func (sd *StreamDeck) GetFirmwareVersion() (string, error)
- func (sd *StreamDeck) GetSerialNumber() (string, error)
- func (sd *StreamDeck) Reset() error
- func (sd *StreamDeck) SetBrightness(pc uint8) error
- func (sd *StreamDeck) SetBtnEventCb(ev BtnEvent)
- func (sd *StreamDeck) WriteText(btnIndex int, textBtn TextButton) error
- type StreamdeckDevice
- type TextButton
- type TextLine
Constants ¶
const VendorID = 0x0fd9
VendorID is the USB VendorID assigned to Elgato (0x0fd9)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BtnEvent ¶
BtnEvent is a callback which gets executed when the state of a button changes, so whenever it gets pressed or released.
type Page ¶
Page contains the configuration of one particular page of buttons. Pages can be nested to an arbitrary depth.
type ReadErrorCb ¶
type ReadErrorCb func(err error)
ReadErrorCb is a callback which gets executed in case reading from the Stream Deck fails (e.g. the cable get's disconnected).
type StreamDeck ¶
type StreamDeck struct { sync.Mutex Info *StreamdeckDevice // contains filtered or unexported fields }
StreamDeck is the object representing the Elgato Stream Deck.
func NewStreamDeck ¶
func NewStreamDeck(serial ...string) (*StreamDeck, error)
NewStreamDeck is the constructor of the StreamDeck object. If several StreamDecks are connected to this PC, the Streamdeck can be selected by supplying the optional serial number of the Device. In the examples folder there is a small program which enumerates all available Stream Decks. If no serial number is supplied, the first StreamDeck found will be selected.
func (*StreamDeck) ClearAllBtns ¶
func (sd *StreamDeck) ClearAllBtns()
ClearAllBtns fills all keys with the color black
func (*StreamDeck) ClearBtn ¶
func (sd *StreamDeck) ClearBtn(btnIndex int) error
ClearBtn fills a particular key with the color black
func (*StreamDeck) Close ¶
func (sd *StreamDeck) Close() error
Close the connection to the Elgato Stream Deck
func (*StreamDeck) FillColor ¶
func (sd *StreamDeck) FillColor(btnIndex, r, g, b int) error
FillColor fills the given button with a solid color.
func (*StreamDeck) FillImage ¶
func (sd *StreamDeck) FillImage(btnIndex int, img image.Image) error
FillImage fills the given key with an image. For best performance, provide the image in the size of ?x? pixels. Otherwise it will be automatically resized.
func (*StreamDeck) FillImageFromFile ¶
func (sd *StreamDeck) FillImageFromFile(keyIndex int, path string) error
FillImageFromFile fills the given key with an image from a file.
func (*StreamDeck) FillPanel ¶
func (sd *StreamDeck) FillPanel(img image.Image) error
FillPanel fills the whole panel witn an image. The image is scaled to fit and then center-cropped (if necessary). The native picture size is 360px x 216px.
func (*StreamDeck) FillPanelFromFile ¶
func (sd *StreamDeck) FillPanelFromFile(path string) error
FillPanelFromFile fills the entire panel with an image from a file.
func (*StreamDeck) GetFirmwareVersion ¶
func (sd *StreamDeck) GetFirmwareVersion() (string, error)
func (*StreamDeck) GetSerialNumber ¶
func (sd *StreamDeck) GetSerialNumber() (string, error)
func (*StreamDeck) Reset ¶
func (sd *StreamDeck) Reset() error
func (*StreamDeck) SetBrightness ¶
func (sd *StreamDeck) SetBrightness(pc uint8) error
func (*StreamDeck) SetBtnEventCb ¶
func (sd *StreamDeck) SetBtnEventCb(ev BtnEvent)
SetBtnEventCb sets the BtnEvent callback which get's executed whenever a Button event (pressed/released) occures.
func (*StreamDeck) WriteText ¶
func (sd *StreamDeck) WriteText(btnIndex int, textBtn TextButton) error
WriteText can write several lines of Text to a button. It is up to the user to ensure that the lines fit properly on the button.
type StreamdeckDevice ¶
type StreamdeckDevice struct { ProductID uint16 Name string NumButtons int ButtonSize int StreamBuffer int Spacer int NumButtonColumns int NumButtonRows int }
func (*StreamdeckDevice) PanelHeight ¶
func (dev *StreamdeckDevice) PanelHeight() int
func (*StreamdeckDevice) PanelWidth ¶
func (dev *StreamdeckDevice) PanelWidth() int
type TextButton ¶
TextButton holds the lines to be written to a button and the desired Background color.