button

package
v0.0.0-...-6586ce7 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Animated

type Animated interface {
	// Animate is called when the Button should start animating.
	//
	// It is expected that this function only exits if an error occurs or if the
	// context is cancelled.
	//
	// The closure passed should be called with an image processed by
	// StreamDeck#ProcessImage which should be done ahead of time before Animate
	// is called.
	Animate(context.Context, func(context.Context, []byte) error) error
}

Animated represents a Button that is animated.

type Button

type Button interface {
	Image() []byte
}

Button represents a button that can be displayed on a StreamDeck using a View.

type GIF

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

GIF represents an animated Button displaying a GIF

func NewGIF

func NewGIF(sd *streamdeck.StreamDeck, gif *gif.GIF) *GIF

NewGIF returns a new animated Button that displays a GIF.

func (*GIF) Animate

func (g *GIF) Animate(ctx context.Context, fn func(context.Context, []byte) error) error

Animate satisfies the Animated interface.

func (*GIF) Image

func (*GIF) Image() []byte

Image satisfies the Button interface.

type Image

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

Image represents a static Button displaying an image.

func NewImage

func NewImage(v []byte) *Image

NewImage returns a new static Button displaying an image.

func (*Image) Image

func (i *Image) Image() []byte

Image satisfies the Button interface.

Jump to

Keyboard shortcuts

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