Documentation ¶
Overview ¶
Package deej provides a machine-side client that pairs with an Arduino chip to form a tactile, physical volume control system/
Index ¶
Constants ¶
const ( // Windows Code for WM_APPCOMMAND WM_APPCOMMAND uint32 = 0x0319 FAPPCOMMAND_KEY uint32 = 0x0 // APPCOMMAND_MEDIA_PLAY_PAUSE uint16 = 14 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CanonicalConfig ¶
type CanonicalConfig struct { SliderMapping *sliderMap ConnectionInfo struct { COMPort string BaudRate int } InvertSliders bool NoiseReductionLevel string // contains filtered or unexported fields }
CanonicalConfig provides application-wide access to configuration fields, as well as loading/file watching logic for deej's configuration file
func NewConfig ¶
func NewConfig(logger *zap.SugaredLogger, notifier Notifier) (*CanonicalConfig, error)
NewConfig creates a config instance for the deej object and sets up viper instances for deej's config files
func (*CanonicalConfig) Load ¶
func (cc *CanonicalConfig) Load() error
Load reads deej's config files from disk and tries to parse them
func (*CanonicalConfig) StopWatchingConfigFile ¶
func (cc *CanonicalConfig) StopWatchingConfigFile()
StopWatchingConfigFile signals our filesystem watcher to stop
func (*CanonicalConfig) SubscribeToChanges ¶
func (cc *CanonicalConfig) SubscribeToChanges() chan bool
SubscribeToChanges allows external components to receive updates when the config is reloaded
func (*CanonicalConfig) WatchConfigFileChanges ¶
func (cc *CanonicalConfig) WatchConfigFileChanges()
WatchConfigFileChanges starts watching for configuration file changes and attempts reloading the config when they happen
type Deej ¶
type Deej struct {
// contains filtered or unexported fields
}
Deej is the main entity managing access to all sub-components
func NewDeej ¶
func NewDeej(logger *zap.SugaredLogger, verbose bool) (*Deej, error)
NewDeej creates a Deej instance
func (*Deej) Initialize ¶
Initialize sets up components and starts to run in the background
func (*Deej) SetVersion ¶
SetVersion causes deej to add a version string to its tray menu if called before Initialize
type LightingChangeEvent ¶
type SerialIO ¶
type SerialIO struct {
// contains filtered or unexported fields
}
SerialIO provides a deej-aware abstraction layer to managing serial I/O
func NewSerialIO ¶
func NewSerialIO(deej *Deej, logger *zap.SugaredLogger) (*SerialIO, error)
NewSerialIO creates a SerialIO instance that uses the provided deej instance's connection info to establish communications with the arduino chip
func (*SerialIO) SendLightChange ¶
func (sio *SerialIO) SendLightChange(light LightingChangeEvent)
func (*SerialIO) Stop ¶
func (sio *SerialIO) Stop()
Stop signals us to shut down our serial connection, if one is active
func (*SerialIO) SubscribeToSliderMoveEvents ¶
func (sio *SerialIO) SubscribeToSliderMoveEvents() chan SliderMoveEvent
SubscribeToSliderMoveEvents returns an unbuffered channel that receives a sliderMoveEvent struct every time a slider moves
type Session ¶
type Session interface { GetVolume() float32 SetVolume(v float32) error GetMute() bool SetMute(m bool) error Key() string Release() }
Session represents a single addressable audio session
type SessionFinder ¶
SessionFinder represents an entity that can find all current audio sessions
type SliderMoveEvent ¶
SliderMoveEvent represents a single slider move captured by deej
type ToastNotifier ¶
type ToastNotifier struct {
// contains filtered or unexported fields
}
ToastNotifier provides toast notifications for Windows
func NewToastNotifier ¶
func NewToastNotifier(logger *zap.SugaredLogger) (*ToastNotifier, error)
NewToastNotifier creates a new ToastNotifier
func (*ToastNotifier) Notify ¶
func (tn *ToastNotifier) Notify(title string, message string)
Notify sends a toast notification (or falls back to other types of notification for older Windows versions)