Documentation ¶
Index ¶
- Variables
- type MuteMe
- func (mm *MuteMe) Cycle(ctx *base.Context) *base.OperatorIO
- func (mm *MuteMe) GetColor() *base.OperatorIO
- func (mm *MuteMe) GetDefaultConfig() interface{}
- func (mm *MuteMe) GraphIDSuggestions() map[string]string
- func (mm *MuteMe) InitCopyOfOperator(ctx *base.Context, config interface{}, name string) (base.FreepsOperatorWithConfig, error)
- func (mm *MuteMe) SetColor(ctx *base.Context, input *base.OperatorIO, args SetColorArgs) *base.OperatorIO
- func (mm *MuteMe) SetLongTouchTrigger(ctx *base.Context, mainInput *base.OperatorIO, args TouchTrigger) *base.OperatorIO
- func (mm *MuteMe) SetMultiTouchTrigger(ctx *base.Context, mainInput *base.OperatorIO, args TouchTrigger) *base.OperatorIO
- func (mm *MuteMe) SetTouchTrigger(ctx *base.Context, mainInput *base.OperatorIO, args TouchTrigger) *base.OperatorIO
- func (mm *MuteMe) Shutdown(ctx *base.Context)
- func (mm *MuteMe) StartListening(ctx *base.Context)
- func (mm *MuteMe) TurnOff(ctx *base.Context) *base.OperatorIO
- type MuteMeConfig
- type SetColorArgs
- type TouchTrigger
Constants ¶
This section is empty.
Variables ¶
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 ¶
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) StartListening ¶
StartListening starts the main loop of the muteme listener
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
}