muteme

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = MuteMeConfig{
	Enabled:            true,
	MultiTouchDuration: time.Second,
	LongTouchDuration:  3 * time.Second,
	VendorID:           0x20a0,
	ProductID:          0x42da,
	Tag:                "muteme",
	TouchTag:           "Touch",
	MultiTouchTag:      "MultiTouch",
	LongTouchTag:       "LongTouch",
	ProcessColor:       "purple",
	SuccessColor:       "green",
	ErrorColor:         "red",
	LongTouchColor:     "cyan",
}

Functions

This section is empty.

Types

type MuteMe

type MuteMe struct {
	GE *freepsgraph.GraphEngine
	// contains filtered or unexported fields
}

MuteMe implements the FreepsOperator interface to control the MuteMe button

func (*MuteMe) Cycle

func (mm *MuteMe) Cycle(ctx *base.Context) *base.OperatorIO

Cycle cycles through the colors of the MuteMe button

func (*MuteMe) GetColor

func (mm *MuteMe) GetColor() *base.OperatorIO

GetColor returns the current color of the MuteMe button

func (*MuteMe) GetDefaultConfig

func (mm *MuteMe) GetDefaultConfig() interface{}

GetDefaultConfig returns a copy of the default config

func (*MuteMe) GraphIDSuggestions

func (mm *MuteMe) GraphIDSuggestions() map[string]string

GraphIDSuggestions returns suggestions for graph names

func (*MuteMe) InitCopyOfOperator

func (mm *MuteMe) InitCopyOfOperator(ctx *base.Context, config interface{}, name string) (base.FreepsOperatorWithConfig, error)

InitCopyOfOperator creates a copy of the operator and initializes it with the given config

func (*MuteMe) SetColor

func (mm *MuteMe) SetColor(ctx *base.Context, input *base.OperatorIO, args SetColorArgs) *base.OperatorIO

SetColor sets the color of the MuteMe button

func (*MuteMe) SetLongTouchTrigger

func (mm *MuteMe) SetLongTouchTrigger(ctx *base.Context, mainInput *base.OperatorIO, args TouchTrigger) *base.OperatorIO

SetLongTouchTrigger

func (*MuteMe) SetMultiTouchTrigger

func (mm *MuteMe) SetMultiTouchTrigger(ctx *base.Context, mainInput *base.OperatorIO, args TouchTrigger) *base.OperatorIO

SetMultiTouchTrigger

func (*MuteMe) SetTouchTrigger

func (mm *MuteMe) SetTouchTrigger(ctx *base.Context, mainInput *base.OperatorIO, args TouchTrigger) *base.OperatorIO

SetTouchTrigger

func (*MuteMe) Shutdown

func (mm *MuteMe) Shutdown(ctx *base.Context)

Shutdown the muteme listener

func (*MuteMe) StartListening

func (mm *MuteMe) StartListening(ctx *base.Context)

StartListening starts the main loop of the muteme listener

func (*MuteMe) TurnOff

func (mm *MuteMe) TurnOff(ctx *base.Context) *base.OperatorIO

TurnOff turns off the MuteMe button

type MuteMeConfig

type MuteMeConfig struct {
	Enabled            bool          // if false, the muteme button will be ignored
	MultiTouchDuration time.Duration // if touched multiple times within that duration, a separate graph will be called with the TouchCount
	LongTouchDuration  time.Duration // if touched once longer that than this, a separate graph will be called with the TouchDuration
	VendorID           uint16        // USB Vendor ID
	ProductID          uint16        // USB Product ID
	Tag                string        // tag that all graphs must have to be called
	TouchTag           string        // graphs with this tag will be called on a short single touch
	MultiTouchTag      string        // graphs with this tag will be called when button was touched multiple times within MultiTouchDuration
	LongTouchTag       string        // graphs with this tag will be called on a long single touch
	ProcessColor       string        // color to set while graphs are executed (if button is already in that color, turn light off instead)
	LongTouchColor     string        // color to set when the button has been touched longer that LongTouchDuration
	SuccessColor       string        // color to indicate successful graph execution
	ErrorColor         string        // colot to indicate error during graph execution
}

type SetColorArgs

type SetColorArgs struct {
	Color string
}

SetColorArgs are the arguments for the MuteMe-SetColor function

func (*SetColorArgs) ColorSuggestions

func (mma *SetColorArgs) ColorSuggestions() []string

ColorSuggestions returns suggestions for the color

func (*SetColorArgs) GetArgSuggestions

func (mma *SetColorArgs) GetArgSuggestions(op base.FreepsOperator, fn string, arg string, otherArgs map[string]string) map[string]string

GetArgSuggestions returns suggestions for the color

type TouchTrigger

type TouchTrigger struct {
	GraphID string
}

Jump to

Keyboard shortcuts

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