Documentation ¶
Index ¶
- Variables
- func AwaitSignal() os.Signal
- func ChangeIntensity(delta int)
- func ChangeVolume(delta int)
- func ConfigChangeListener(handler func())
- func Configure(cfg *Config)
- func EventFire(ev Event)
- func EventListen(listener func(Event))
- func EventLoop()
- func GetIntensity() int
- func GetSpeaker(rate beep.SampleRate, buffersize int, volume int) (int, error)
- func GetVolume() int
- func Play(streamers ...beep.Streamer)
- func SetIntensity(intensity int)
- func SetVolume(volume int)
- type Config
- type Event
- type ProfileSwitcher
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrProfileNotFound = errors.New("light effect could not be found")
View Source
var ErrSpeakerContextReused = errors.New("the speaker was already initialized, the existing context is reused")
Functions ¶
func AwaitSignal ¶
func ChangeIntensity ¶
func ChangeIntensity(delta int)
func ChangeVolume ¶
func ChangeVolume(delta int)
func ConfigChangeListener ¶ added in v1.1.0
func ConfigChangeListener(handler func())
func EventListen ¶
func EventListen(listener func(Event))
func GetIntensity ¶
func GetIntensity() int
func GetSpeaker ¶
func SetIntensity ¶
func SetIntensity(intensity int)
Types ¶
type Config ¶
type Config struct { Meta struct { Version string Build string Name string `env:"NAME" env-default:"Deichwave"` } `env-prefix:"META_"` File string `env:"CONFIG" env-default:"config/default.toml"` Debug bool `env:"DEBUG" env-default:"false"` Audio struct { Rate int `toml:"rate" env:"RATE" env-default:"44100"` Buffer int `toml:"buffer" env:"BUFFER" env-default:"5000"` Quality int `toml:"quality" env:"QUALITY" env-default:"6"` Volume int `toml:"volume" env:"VOLUME" env-default:"10"` } `toml:"audio" env-prefix:"AUDIO_"` Sounds struct { Path string `toml:"path" env:"DIR" env-default:"data/sounds/effects"` Ext string `toml:"ext" env:"EXT" env-default:".ogg"` Randomizer string `toml:"randomizer" env:"RND" env-default:".random"` Volume int `toml:"volume" env:"VOLUME" env-default:"100"` } `toml:"sounds" env-prefix:"SOUNDS_"` Music struct { Path string `toml:"path" env:"DIR" env-default:"data/music/playlists"` Ext string `toml:"ext" env:"EXT" env-default:".ogg"` Volume int `toml:"volume" env:"VOLUME" env-default:"50"` StartRNG []int `toml:"startrng" env:"STARTRNG" env-default:"95,5"` EndRNG []int `toml:"endrng" env:"ENDRNG" env-default:"30,70"` } `toml:"music" env-prefix:"MUSIC_"` Lights struct { Path string `toml:"path" env:"DIR" env-default:"data/lights/effects"` Ext string `toml:"ext" env:"EXT" env-default:".tengo"` } `toml:"lights" env-prefix:"LIGHTS_"` Shell map[string][]string `toml:"shell"` Hooks map[string][]string `toml:"hooks"` REST struct { Port int `toml:"port" env:"PORT" env-default:"3000"` } `toml:"rest" env-prefix:"REST_"` LEDs map[string]struct { Order int `toml:"order"` Count int `toml:"count"` } `toml:"leds"` GPIO map[string]struct { Chip string `toml:"chip"` Pins []int `toml:"pins"` Type string `toml:"type"` Debounce int `toml:"debounce"` Actions []string `toml:"actions"` } `toml:"gpio"` Hardware struct { LEDBrightness int `toml:"led-brightness" env:"LED_BRIGHTNESS" env-default:"100"` LEDPin int `toml:"led-pin" env:"LED_PIN" env-default:"18"` } `toml:"hardware" env-prefix:"HW_"` }
type ProfileSwitcher ¶ added in v1.1.0
type ProfileSwitcher struct {
// contains filtered or unexported fields
}
func NewProfilSwitcher ¶ added in v1.1.0
func NewProfilSwitcher(cfg *Config) (ProfileSwitcher, error)
func (*ProfileSwitcher) ListProfiles ¶ added in v1.1.0
func (p *ProfileSwitcher) ListProfiles() []string
func (*ProfileSwitcher) SetProfile ¶ added in v1.1.0
func (p *ProfileSwitcher) SetProfile(name string) error
Click to show internal directories.
Click to hide internal directories.