action

package
v0.0.0-...-3045c56 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	New() Action

	// When ApplyConfig is called, apply config
	// Your struct is expected to declare exported fields with YAML annotation
	// for config values
	ApplyConfig(config *yaml.Node, imageHelper controller.ImageHelper, ctrl controller.Controller) error

	Run(pressed bool) error
	Name() string

	// In Render, you can return a nil image to indicate the image hasn't changed since the last call
	// This will indicate to the renderer to not change the image
	//
	// If force is true, you must always return an image if the action has one available
	// Otherwsie, a blank image will be set
	Render(force bool) (*streamdeck.ImageData, error)
}

type ActionBase

type ActionBase struct {
	ImageHelper controller.ImageHelper
	Controller  controller.Controller
}

func (*ActionBase) ApplyConfig

func (a *ActionBase) ApplyConfig(config *yaml.Node, imageHelper controller.ImageHelper, ctrl controller.Controller) error

type ActionWithIcon

type ActionWithIcon struct {
	ActionBase
	Icon string `yaml:"icon"`
}

func (*ActionWithIcon) ApplyConfig

func (a *ActionWithIcon) ApplyConfig(config *yaml.Node, imageHelper controller.ImageHelper, ctrl controller.Controller) error

func (*ActionWithIcon) Render

func (a *ActionWithIcon) Render(force bool) (*streamdeck.ImageData, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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