api

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DrawText

func DrawText(currentImage image.Image, text string, fontSize int, fontAlignment string) (image.Image, error)

func ResizeImage

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

Types

type Config

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

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) GetConfig

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

func (*Connection) GetInfo

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

func (*Connection) GetModules

func (c *Connection) GetModules() ([]*Module, 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) 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"`
	Profiles []Profile `json:"profiles"`
}

type DepracatedConfig

type DepracatedConfig struct {
	Modules []string `json:"modules,omitempty"`
	Pages   []Page   `json:"pages"`
}

type DepracatedConfig_v2

type DepracatedConfig_v2 struct {
	Modules []string         `json:"modules,omitempty"`
	Decks   []DeprecatedDeck `json:"decks"`
}

type DeprecatedDeck

type DeprecatedDeck struct {
	Serial string `json:"serial"`
	Pages  []Page `json:"pages"`
}

type Field

type Field struct {
	Title     string
	Name      string
	Type      string
	FileTypes []string
	Values    []string
}

type Handler

type Handler interface {
}

type IconHandler

type IconHandler interface {
	Handler
	Start(key Key, info StreamDeckInfo, callback func(image image.Image))
	IsRunning() bool
	SetRunning(running bool)
	Stop()
}

type Key

type Key struct {
	Icon              string            `json:"icon,omitempty"`
	SwitchPage        int               `json:"switch_page,omitempty"`
	Text              string            `json:"text,omitempty"`
	TextSize          int               `json:"text_size,omitempty"`
	TextAlignment     string            `json:"text_alignment,omitempty"`
	Keybind           string            `json:"keybind,omitempty"`
	Command           string            `json:"command,omitempty"`
	Brightness        int               `json:"brightness,omitempty"`
	Url               string            `json:"url,omitempty"`
	IconHandler       string            `json:"icon_handler,omitempty"`
	KeyHandler        string            `json:"key_handler,omitempty"`
	IconHandlerFields map[string]string `json:"icon_handler_fields,omitempty"`
	KeyHandlerFields  map[string]string `json:"key_handler_fields,omitempty"`
	Buff              image.Image       `json:"-"`
	IconHandlerStruct IconHandler       `json:"-"`
	KeyHandlerStruct  KeyHandler        `json:"-"`
}

type KeyHandler

type KeyHandler interface {
	Handler
	Key(key Key, info StreamDeckInfo)
}

type Module

type Module struct {
	Name       string
	IconFields []Field
	KeyFields  []Field
	IsIcon     bool
	IsKey      bool
}

type Page

type Page []Key

type Profile

type Profile struct {
	Name  string `json:"name"`
	Pages []Page `json:"pages"`
}

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"`
	Profile  string `json:"profile"`
	Serial   string `json:"serial,omitempty"`
}

Jump to

Keyboard shortcuts

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