api

package module
v3.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2026 License: BSD-3-Clause Imports: 32 Imported by: 0

README

StreamDeck API for Unix

This is a Go library for the streamdeckd daemon, not a standalone application. It provides interfaces for connecting to the daemon, accessing configuration objects, and creating custom handlers or GUI config editors for Elgato StreamDeck devices on Unix systems.

The library exposes an API for creating custom plugins to handle Stream Deck inputs (buttons, knobs, touch), managing icons and images, and also for communicating with the streamdeckd daemon via DBus.

Installation

go get github.com/unix-streamdeck/api

Usage

Connecting to the Stream Deck daemon
import (
    "fmt"
    "github.com/unix-streamdeck/api"
)

// Connect to the Stream Deck daemon
conn, err := api.Connect()
if err != nil {
    // Handle error
}
defer conn.Close()

// Get information about connected Stream Deck devices
devices, err := conn.GetInfo()
if err != nil {
    // Handle error
}

// Listen for page changes
err = conn.RegisterPageListener(func(serial string, page int32) {
    fmt.Printf("Device %s changed to page %d\n", serial, page)
})
Working with images
import (
    "github.com/unix-streamdeck/api"
    "image"
    _ "image/png"
    "os"
)

// Load an image
file, _ := os.Open("icon.png")
img, _, _ := image.Decode(file)

// Resize image to fit a Stream Deck key, ideally pass the `IconSize` field from `StreamDeckInfoV1` rather than magic num,ber
resizedImg := api.ResizeImage(img, 72) // 72x72 pixels

// Resize image with specific width and height (e.g., for LCD display) (`LcdWidth` and `LcdHeight` in `StreamDeckInfoV1`)
resizedLcdImg := api.ResizeImageWH(img, 800, 100)

// Add text to an image
imgWithText, _ := api.DrawText(resizedImg, "Hello", 0, "CENTER")
Implementing handlers
// Implement a handler
type MyHandler struct{
	running bool
}

func (h *MyHandler) Input(fields map[string]any, handlerType HandlerType, info StreamDeckInfo, event InputEvent, host IHost) {
    switch event.EventType {
    case api.KNOB_CW:
        // Handle clockwise rotation
    case api.KNOB_CCW:
        // Handle counter-clockwise rotation
    case api.KNOB_PRESS:
        // Handle knob press
    case api.KEY_PRESS:
		// Handle key press
    }
}

func (h *MyHandler) Start(fields map[string]any, handlerType HandlerType, info StreamDeckInfo, callback func(image image.Image)) {
	// Generate image and send it back via callback
}

func (h *MyHandler) IsRunning() bool {
    return h.running
}

func (h *MyHandler) SetRunning(running bool) {
    h.running = running
}

func (h *MyHandler) Stop() {
    h.running = false
    // Clean up resources and stop calling callback
}

API Documentation

The API provides several interfaces for handling Stream Deck interactions:

  • Handler: Base interface for all handlers
  • ForegroundHandler: For handling dynamic icons/images
  • InputHandler: For handling input events
  • BackgroundHandler: For handling dynamic backgrounds for individual displays, or whole deck
  • CombinedHandler: For handlers that can do foregrounds and handle input, if this handler is applied to the foreground and input of a specific key/lcd segment, the same instance of the struct will be used, so resources can be shared

Key components:

  • Connection: Manages DBus communication with the Stream Deck daemon
  • Image utilities: Functions for drawing text and resizing images
  • Configuration management: Functions for getting and setting device configurations
Configuration Objects

The library exposes configuration objects that can be used to interact with the streamdeckd daemon:

// Get the current configuration
config, err := conn.GetConfig()
if err != nil {
    // Handle error
}

// Modify configuration
// ...

// Set the updated configuration
err = conn.SetConfig(config)
if err != nil {
    // Handle error
}


// Commit configuration changes to disk
err = conn.CommitConfig()

// Or Reload configuration from disk if the changes weren't correct
err = conn.ReloadConfig()

License

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.

Documentation

Index

Constants

View Source
const BorderClearance = 10

Variables

This section is empty.

Functions

func DrawProgressBar

func DrawProgressBar(img image.Image, label string, x, y, h, w, progress float64) (image.Image, error)

func DrawProgressBarWithAccent

func DrawProgressBarWithAccent(img image.Image, label string, x, y, h, w, progress float64, hex string) (image.Image, error)

func DrawText

func DrawText(img image.Image, text string, options DrawTextOptions) (image.Image, error)

func FindXDoToolKeybindString

func FindXDoToolKeybindString(code int) string

func HexColor

func HexColor(hex string) color.RGBA

func LayerImages

func LayerImages(x, y int, images ...image.Image) (image.Image, error)

func ParseXDoToolKeybindString

func ParseXDoToolKeybindString(keybind string) ([]int, error)

func ResizeImage

func ResizeImage(img image.Image, keySize int) image.Image

func ResizeImageWH

func ResizeImageWH(img image.Image, width int, height int) image.Image

func SubImage

func SubImage(img image.Image, x0, y0, x1, y1 int) image.Image

Types

type AvailableModules added in v3.0.1

type AvailableModules struct {
	GroupModules      []ModuleGroup `json:"group_modules"`
	IndividualModules []Module      `json:"individual_modules"`
}

type BackgroundHandler

type BackgroundHandler interface {
	ForegroundHandler
	StartGrid(fields map[string]any, handlerType HandlerType, info StreamDeckInfo, callback func(images []image.Image))
}

type CombinedHandler

type CombinedHandler interface {
	ForegroundHandler
	InputHandler
}

type Config

type Config struct {
	Modules           []string          `json:"modules,omitempty"`
	Decks             []Deck            `json:"decks"`
	ObsConnectionInfo ObsConnectionInfo `json:"obs_connection_info"`
}

type Connection

type Connection struct {
	// contains filtered or unexported fields
}

func Connect

func Connect() (*Connection, error)

func (*Connection) Close

func (c *Connection) Close()

func (*Connection) CommitConfig

func (c *Connection) CommitConfig() error

func (*Connection) GetBackgroundExample added in v3.0.1

func (c *Connection) GetBackgroundExample(serial string, handler string, fields map[string]any, handlerType HandlerType, grid bool) ([]image.Image, error)

func (*Connection) GetConfig

func (c *Connection) GetConfig() (*Config, error)

func (*Connection) GetInfo

func (c *Connection) GetInfo() ([]*StreamDeckInfo, error)

func (*Connection) GetLayersExample

func (c *Connection) GetLayersExample(serial string, layers []*Layer, handlerType HandlerType) (image.Image, error)

func (*Connection) GetModules

func (c *Connection) GetModules() (*AvailableModules, error)

func (*Connection) GetObsFields

func (c *Connection) GetObsFields() ([]*Field, error)

func (*Connection) PressButton

func (c *Connection) PressButton(serial string, keyIndex int) error

func (*Connection) RegisterPageListener

func (c *Connection) RegisterPageListener(cback func(string, int32)) error

func (*Connection) ReloadConfig

func (c *Connection) ReloadConfig() error

func (*Connection) SendKnobEvent added in v3.0.1

func (c *Connection) SendKnobEvent(serial string, knobIndex int, event InputEventType) error

func (*Connection) SetConfig

func (c *Connection) SetConfig(config *Config) error

func (*Connection) SetPage

func (c *Connection) SetPage(serial string, page int) error

type Deck

type Deck struct {
	Serial                            string            `json:"serial"`
	Pages                             []Page            `json:"pages"`
	TouchPanelBackground              string            `json:"touch_panel_background"`
	TouchPanelBackgroundBuff          []image.Image     `json:"-"`
	TouchPanelBackgroundHandler       BackgroundHandler `json:"-"`
	TouchPanelBackgroundHandlerFields map[string]any    `json:"touch_panel_background_handler_fields"`
	KeyGridBackground                 string            `json:"key_grid_background"`
	KeyGridBackgroundBuff             []image.Image     `json:"-"`
	KeyGridBackgroundHandler          BackgroundHandler `json:"-"`
	KeyGridBackgroundHandlerFields    map[string]any    `json:"key_grid_background_handler_fields"`
}

func (*Deck) GetKeyGridBackground

func (d *Deck) GetKeyGridBackground() string

func (*Deck) GetKeyGridBackgroundBuff

func (d *Deck) GetKeyGridBackgroundBuff() []image.Image

func (*Deck) GetKeyGridBackgroundHandler

func (d *Deck) GetKeyGridBackgroundHandler() BackgroundHandler

func (*Deck) GetKeyGridBackgroundHandlerFields

func (d *Deck) GetKeyGridBackgroundHandlerFields() map[string]any

func (*Deck) GetTouchPanelBackground

func (d *Deck) GetTouchPanelBackground() string

func (*Deck) GetTouchPanelBackgroundBuff

func (d *Deck) GetTouchPanelBackgroundBuff() []image.Image

func (*Deck) GetTouchPanelBackgroundHandler

func (d *Deck) GetTouchPanelBackgroundHandler() BackgroundHandler

func (*Deck) GetTouchPanelBackgroundHandlerFields

func (d *Deck) GetTouchPanelBackgroundHandlerFields() map[string]any

func (*Deck) SetKeyGridBackgroundBuff

func (d *Deck) SetKeyGridBackgroundBuff(img []image.Image)

func (*Deck) SetKeyGridBackgroundHandler

func (d *Deck) SetKeyGridBackgroundHandler(handler BackgroundHandler)

func (*Deck) SetTouchPanelBackgroundBuff

func (d *Deck) SetTouchPanelBackgroundBuff(img []image.Image)

func (*Deck) SetTouchPanelBackgroundHandler

func (d *Deck) SetTouchPanelBackgroundHandler(handler BackgroundHandler)

type DrawTextOptions

type DrawTextOptions struct {
	FontSize                 int64
	MaxFontSize, MinFontSize int64
	VerticalAlignment        VerticalAlignment
	HorizontalAlignment      HorizontalAlignment
	FontFace                 string
	Colour                   string
	Overflow                 Overflow
	// With anchor set, the alignments indicate the position of the text the anchor will be in, e.g BOTTOM & RIGHT will put the anchor in the bottom right of the text, so all text will be up and left of it
	Anchor *image.Point
}

type Field

type Field struct {
	Title     string    `json:"title,omitempty"`
	Name      string    `json:"name,omitempty"`
	Type      FieldType `json:"type,omitempty"`
	FileTypes []string  `json:"file_types,omitempty"`
	ListItems []string  `json:"list_items,omitempty"`
}

type FieldType

type FieldType string
const (
	File          FieldType = "File"
	Text          FieldType = "Text"
	Number        FieldType = "Number"
	TextAlignment FieldType = "TextAlignment"
	FontFace      FieldType = "FontFace"
	Select        FieldType = "Select"
	Colour        FieldType = "Colour"
)

type ForegroundHandler

type ForegroundHandler interface {
	VisualHandler
	Start(fields map[string]any, handlerType HandlerType, info StreamDeckInfo, callback func(image image.Image))
}

type Handler

type Handler interface {
}

type HandlerType

type HandlerType uint8
const (
	LCD HandlerType = iota
	KEY
)

type HorizontalAlignment

type HorizontalAlignment string
const (
	Left   HorizontalAlignment = "LEFT"
	Middle HorizontalAlignment = "MIDDLE"
	Right  HorizontalAlignment = "RIGHT"
)

type IConn

type IConn interface {
	Close() error
	AddMatchSignal(options ...dbus.MatchOption) error
	Signal(ch chan<- *dbus.Signal)
	Object(dest string, path dbus.ObjectPath) dbus.BusObject
}

type IContext

type IContext interface {
	SetRGB(r, g, b float64)
	SetHexColor(color string)
	SetFontFace(font font.Face)
	WordWrap(text string, width float64) []string
	DrawStringWrapped(s string, x, y, ax, ay, width, lineSpacing float64, align gg.Align)
	Image() image.Image
	MeasureMultilineString(text string, lineSpacing float64) (float64, float64)
	Width() int
	Height() int
}

type IHost

type IHost interface {
	SetPage(page int)
	SetBrightness(brightness uint8) error
	RunCommand(command string)
	ExecuteKeybind(keybind string) error
	KeyDown(keycode int) error
	KeyUp(keycode int) error
}

type InputEvent

type InputEvent struct {
	EventType              InputEventType
	RotateNotches          uint8
	ScreenTapX, ScreenTapY uint16
}

type InputEventType

type InputEventType int8
const (
	KNOB_CCW InputEventType = iota
	KNOB_CW
	KNOB_PRESS
	SCREEN_SHORT_TAP
	SCREEN_LONG_TAP
	SCREEN_SWIPE
	KEY_PRESS
	KEY_RELEASE
)

type InputHandler

type InputHandler interface {
	Handler
	Input(fields map[string]any, handlerType HandlerType, info StreamDeckInfo, event InputEvent, host IHost)
}

type Key

type Key struct {
	Application                map[string]*KeyConfig `json:"application,omitempty"`
	ActiveBuff                 image.Image           `json:"-"`
	ActiveApplication          string                `json:"-"`
	KeyBackground              string                `json:"background"`
	KeyBackgroundBuff          image.Image           `json:"-"`
	KeyBackgroundHandler       BackgroundHandler     `json:"-"`
	KeyBackgroundHandlerFields map[string]any        `json:"key_background_handler_fields"`
	Layers                     []*Layer              `json:"layers"`
}

func (*Key) GetKeyBackground

func (k *Key) GetKeyBackground() string

func (*Key) GetKeyBackgroundBuff

func (k *Key) GetKeyBackgroundBuff() image.Image

func (*Key) GetKeyBackgroundHandler

func (k *Key) GetKeyBackgroundHandler() BackgroundHandler

func (*Key) GetKeyBackgroundHandlerFields

func (k *Key) GetKeyBackgroundHandlerFields() map[string]any

func (*Key) GetLayers

func (k *Key) GetLayers() []*Layer

func (*Key) SetKeyBackgroundBuff

func (k *Key) SetKeyBackgroundBuff(img image.Image)

func (*Key) SetKeyBackgroundHandler

func (k *Key) SetKeyBackgroundHandler(handler BackgroundHandler)

type KeyBackgrounder

type KeyBackgrounder interface {
	GetKeyBackground() string
	GetKeyBackgroundBuff() image.Image
	SetKeyBackgroundBuff(img image.Image)
	GetKeyBackgroundHandler() BackgroundHandler
	SetKeyBackgroundHandler(handler BackgroundHandler)
	GetKeyBackgroundHandlerFields() map[string]any
}

type KeyConfig

type KeyConfig struct {
	Layers                     []*Layer          `json:"layers"`
	KeyBackground              string            `json:"background"`
	KeyBackgroundBuff          image.Image       `json:"-"`
	KeyBackgroundHandler       BackgroundHandler `json:"-"`
	KeyBackgroundHandlerFields map[string]any    `json:"key_background_handler_fields"`
}

func (*KeyConfig) GetKeyBackground

func (kc *KeyConfig) GetKeyBackground() string

func (*KeyConfig) GetKeyBackgroundBuff

func (kc *KeyConfig) GetKeyBackgroundBuff() image.Image

func (*KeyConfig) GetKeyBackgroundHandler

func (kc *KeyConfig) GetKeyBackgroundHandler() BackgroundHandler

func (*KeyConfig) GetKeyBackgroundHandlerFields

func (kc *KeyConfig) GetKeyBackgroundHandlerFields() map[string]any

func (*KeyConfig) GetLayers

func (kc *KeyConfig) GetLayers() []*Layer

func (*KeyConfig) SetKeyBackgroundBuff

func (kc *KeyConfig) SetKeyBackgroundBuff(img image.Image)

func (*KeyConfig) SetKeyBackgroundHandler

func (kc *KeyConfig) SetKeyBackgroundHandler(handler BackgroundHandler)

type KeyGridBackgrounder

type KeyGridBackgrounder interface {
	GetKeyGridBackground() string
	GetKeyGridBackgroundBuff() []image.Image
	SetKeyGridBackgroundBuff(img []image.Image)
	GetKeyGridBackgroundHandler() BackgroundHandler
	SetKeyGridBackgroundHandler(handler BackgroundHandler)
	GetKeyGridBackgroundHandlerFields() map[string]any
}

type Knob

type Knob struct {
	Application                       map[string]*KnobConfig `json:"application,omitempty"`
	ActiveBuff                        image.Image            `json:"-"`
	ActiveApplication                 string                 `json:"-"`
	Layers                            []*Layer               `json:"layers"`
	TouchPanelBackground              string                 `json:"touch_panel_background"`
	TouchPanelBackgroundBuff          image.Image            `json:"-"`
	TouchPanelBackgroundHandler       ForegroundHandler      `json:"-"`
	TouchPanelBackgroundHandlerFields map[string]any         `json:"touch_panel_background_handler_fields"`
}

func (*Knob) GetLayers

func (k *Knob) GetLayers() []*Layer

func (*Knob) GetTouchPanelBackground

func (k *Knob) GetTouchPanelBackground() string

func (*Knob) GetTouchPanelBackgroundBuff

func (k *Knob) GetTouchPanelBackgroundBuff() image.Image

func (*Knob) GetTouchPanelBackgroundHandler

func (k *Knob) GetTouchPanelBackgroundHandler() ForegroundHandler

func (*Knob) GetTouchPanelBackgroundHandlerFields

func (k *Knob) GetTouchPanelBackgroundHandlerFields() map[string]any

func (*Knob) SetTouchPanelBackgroundBuff

func (k *Knob) SetTouchPanelBackgroundBuff(img image.Image)

func (*Knob) SetTouchPanelBackgroundHandler

func (k *Knob) SetTouchPanelBackgroundHandler(handler ForegroundHandler)

type KnobConfig

type KnobConfig struct {
	Layers                            []*Layer          `json:"layers"`
	TouchPanelBackground              string            `json:"touch_panel_background"`
	TouchPanelBackgroundBuff          image.Image       `json:"-"`
	TouchPanelBackgroundHandler       ForegroundHandler `json:"-"`
	TouchPanelBackgroundHandlerFields map[string]any    `json:"touch_panel_background_handler_fields"`
}

func (*KnobConfig) GetLayers

func (kc *KnobConfig) GetLayers() []*Layer

func (*KnobConfig) GetTouchPanelBackground

func (kc *KnobConfig) GetTouchPanelBackground() string

func (*KnobConfig) GetTouchPanelBackgroundBuff

func (kc *KnobConfig) GetTouchPanelBackgroundBuff() image.Image

func (*KnobConfig) GetTouchPanelBackgroundHandler

func (kc *KnobConfig) GetTouchPanelBackgroundHandler() ForegroundHandler

func (*KnobConfig) GetTouchPanelBackgroundHandlerFields

func (kc *KnobConfig) GetTouchPanelBackgroundHandlerFields() map[string]any

func (*KnobConfig) SetTouchPanelBackgroundBuff

func (kc *KnobConfig) SetTouchPanelBackgroundBuff(img image.Image)

func (*KnobConfig) SetTouchPanelBackgroundHandler

func (kc *KnobConfig) SetTouchPanelBackgroundHandler(handler ForegroundHandler)

type Layer

type Layer struct {
	Handler     string           `json:"handler,omitempty"`
	Fields      map[string]any   `json:"fields,omitempty"`
	Visual      bool             `json:"visual,omitempty"`
	Input       bool             `json:"input,omitempty"`
	InputEvents []InputEventType `json:"input_events"`
	Global      bool             `json:"global,omitempty"`
	Label       string           `json:"label,omitempty"`

	HandlerStruct Handler     `json:"-"`
	Buff          image.Image `json:"-"`
}

type Layerable

type Layerable interface {
	GetLayers() []*Layer
}

type LcdBackgrounder

type LcdBackgrounder interface {
	GetTouchPanelBackground() string
	GetTouchPanelBackgroundBuff() []image.Image
	SetTouchPanelBackgroundBuff(img []image.Image)
	GetTouchPanelBackgroundHandler() BackgroundHandler
	SetTouchPanelBackgroundHandler(handler BackgroundHandler)
	GetTouchPanelBackgroundHandlerFields() map[string]any
}

type LcdSegmentBackgrounder

type LcdSegmentBackgrounder interface {
	GetTouchPanelBackground() string
	GetTouchPanelBackgroundBuff() image.Image
	SetTouchPanelBackgroundBuff(img image.Image)
	GetTouchPanelBackgroundHandler() ForegroundHandler
	SetTouchPanelBackgroundHandler(handler ForegroundHandler)
	GetTouchPanelBackgroundHandlerFields() map[string]any
}

type Module

type Module struct {
	Name        string `json:"name,omitempty"`
	DisplayName string `json:"display_name"`
	Description string `json:"description"`

	NewCombined   func() Handler           `json:"-"`
	NewBackground func() BackgroundHandler `json:"-"`

	CombinedFields   []Field `json:"combined_fields,omitempty"`
	BackgroundFields []Field `json:"lcd_fields,omitempty"`

	IsForeground bool `json:"is_foreground,omitempty"`
	IsInput      bool `json:"is_input,omitempty"`
	IsBackground bool `json:"is_background,omitempty"`
}

type ModuleGroup added in v3.0.1

type ModuleGroup struct {
	Name        string   `json:"name"`
	DisplayName string   `json:"display_name"`
	Description string   `json:"description"`
	Modules     []Module `json:"modules"`
}

type ObsConnectionInfo

type ObsConnectionInfo struct {
	Host string `json:"host,omitempty"`
	Port int    `json:"port,omitempty"`
}

type Overflow

type Overflow string
const (
	Wrap Overflow = "WRAP"
	Fade Overflow = "FADE"
)

type Page

type Page struct {
	Keys                              []Key             `json:"keys"`
	Knobs                             []Knob            `json:"knobs"`
	TouchPanelBackground              string            `json:"touch_panel_background"`
	TouchPanelBackgroundBuff          []image.Image     `json:"-"`
	TouchPanelBackgroundHandler       BackgroundHandler `json:"-"`
	TouchPanelBackgroundHandlerFields map[string]any    `json:"touch_panel_background_handler_fields"`
	KeyGridBackground                 string            `json:"key_grid_background"`
	KeyGridBackgroundBuff             []image.Image     `json:"-"`
	KeyGridBackgroundHandler          BackgroundHandler `json:"-"`
	KeyGridBackgroundHandlerFields    map[string]any    `json:"key_grid_background_handler_fields"`
}

func (*Page) GetKeyGridBackground

func (p *Page) GetKeyGridBackground() string

func (*Page) GetKeyGridBackgroundBuff

func (p *Page) GetKeyGridBackgroundBuff() []image.Image

func (*Page) GetKeyGridBackgroundHandler

func (p *Page) GetKeyGridBackgroundHandler() BackgroundHandler

func (*Page) GetKeyGridBackgroundHandlerFields

func (p *Page) GetKeyGridBackgroundHandlerFields() map[string]any

func (*Page) GetTouchPanelBackground

func (p *Page) GetTouchPanelBackground() string

func (*Page) GetTouchPanelBackgroundBuff

func (p *Page) GetTouchPanelBackgroundBuff() []image.Image

func (*Page) GetTouchPanelBackgroundHandler

func (p *Page) GetTouchPanelBackgroundHandler() BackgroundHandler

func (*Page) GetTouchPanelBackgroundHandlerFields

func (p *Page) GetTouchPanelBackgroundHandlerFields() map[string]any

func (*Page) SetKeyGridBackgroundBuff

func (p *Page) SetKeyGridBackgroundBuff(img []image.Image)

func (*Page) SetKeyGridBackgroundHandler

func (p *Page) SetKeyGridBackgroundHandler(handler BackgroundHandler)

func (*Page) SetTouchPanelBackgroundBuff

func (p *Page) SetTouchPanelBackgroundBuff(img []image.Image)

func (*Page) SetTouchPanelBackgroundHandler

func (p *Page) SetTouchPanelBackgroundHandler(handler BackgroundHandler)

type StreamDeckInfo

type StreamDeckInfo struct {
	Cols                    int       `json:"cols,omitempty"`
	Rows                    int       `json:"rows,omitempty"`
	IconSize                int       `json:"icon_size,omitempty"`
	Page                    int       `json:"page"`
	Serial                  string    `json:"serial,omitempty"`
	Name                    string    `json:"name,omitempty"`
	Connected               bool      `json:"connected"`
	LastConnected           time.Time `json:"last_connected"`
	LastDisconnected        time.Time `json:"last_disconnected"`
	LcdWidth                int       `json:"lcd_width,omitempty"`
	LcdHeight               int       `json:"lcd_height,omitempty"`
	LcdCols                 int       `json:"lcd_cols,omitempty"`
	KnobCols                int       `json:"knob_cols,omitempty"`
	PaddingX                int       `json:"padding_x"`
	PaddingY                int       `json:"padding_y"`
	KeyGridBackgroundWidth  int       `json:"key_grid_background_width"`
	KeyGridBackgroundHeight int       `json:"key_grid_background_height"`
	LcdBackgroundWidth      int       `json:"lcd_background_width"`
	LcdBackgroundHeight     int       `json:"lcd_background_height"`
}

func (StreamDeckInfo) GetDimensions

func (info StreamDeckInfo) GetDimensions(handlerType HandlerType) (int, int)

func (StreamDeckInfo) GetGridDimensions

func (info StreamDeckInfo) GetGridDimensions(handlerType HandlerType) (int, int)

func (StreamDeckInfo) SplitBackgroundImage

func (info StreamDeckInfo) SplitBackgroundImage(background image.Image, handlerType HandlerType) []image.Image

type VerticalAlignment

type VerticalAlignment string
const (
	Top    VerticalAlignment = "TOP"
	Center VerticalAlignment = "CENTER"
	Bottom VerticalAlignment = "BOTTOM"
)

type VisualHandler

type VisualHandler interface {
	Handler
	IsRunning() bool
	SetRunning(running bool)
	Stop()
}

Directories

Path Synopsis
mocks
mock_api
Package mock_api is a generated GoMock package.
Package mock_api is a generated GoMock package.
mock_dbus
Package mock_dbus is a generated GoMock package.
Package mock_dbus is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL