Documentation ¶
Overview ¶
Package deej provides a machine-side client that pairs with an Arduino chip to form a tactile, physical volume control system/
Index ¶
- func NewLogger(buildType string) (*zap.SugaredLogger, error)
- type CanonicalConfig
- type Deej
- func (d *Deej) AddMenuItem(text string, tooltip string) chan *systray.MenuItem
- func (d *Deej) GetSerial() *SerialIO
- func (d *Deej) GetSessionMap() *SessionMap
- func (d *Deej) GetSliderMap() *SliderMap
- func (d *Deej) Initialize() error
- func (d *Deej) NewNammedLogger(loggername string) *zap.SugaredLogger
- func (d *Deej) SetVersion(version string)
- func (d *Deej) Start() error
- func (d *Deej) SubscribeToChanges() chan bool
- func (d *Deej) SubscribeToSessionReload() chan bool
- func (d *Deej) Verbose() bool
- type Notifier
- type SerialIO
- func (sio *SerialIO) Initialize() error
- func (sio *SerialIO) IsRunning() bool
- func (sio *SerialIO) Pause()
- func (sio *SerialIO) ReadLine(logger *zap.SugaredLogger) chan string
- func (sio *SerialIO) Shutdown()
- func (sio *SerialIO) Start() error
- func (sio *SerialIO) SubscribeToCommands() chan string
- func (sio *SerialIO) SubscribeToSliderMoveEvents() chan SliderMoveEvent
- func (sio *SerialIO) WaitFor(logger *zap.SugaredLogger, cmdKey string) (success bool, value string)
- func (sio *SerialIO) WriteBytes(logger *zap.SugaredLogger, line []byte)
- func (sio *SerialIO) WriteBytesLine(logger *zap.SugaredLogger, line []byte)
- func (sio *SerialIO) WriteStringLine(logger *zap.SugaredLogger, line string)
- type Session
- type SessionFinder
- type SessionMap
- type SliderMap
- type SliderMoveEvent
- type ToastNotifier
Constants ¶
This section is empty.
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) AddMenuItem ¶ added in v0.9.10
AddMenuItem addes a menu item to the tray
func (*Deej) GetSessionMap ¶ added in v0.9.10
func (d *Deej) GetSessionMap() *SessionMap
GetSessionMap returns a pointer to the session Map
func (*Deej) GetSliderMap ¶ added in v0.9.10
GetSliderMap returns a pointer to the slider map
func (*Deej) Initialize ¶
Initialize sets up components and starts to run in the background
func (*Deej) NewNammedLogger ¶ added in v0.9.6
func (d *Deej) NewNammedLogger(loggername string) *zap.SugaredLogger
NewNammedLogger Create a new sub logger
func (*Deej) SetVersion ¶
SetVersion causes deej to add a version string to its tray menu if called before Initialize
func (*Deej) SubscribeToChanges ¶ added in v0.9.6
SubscribeToChanges allows external components to receive updates when the config is reloaded
func (*Deej) SubscribeToSessionReload ¶ added in v0.9.10
SubscribeToSessionReload allows an external component to receive updates when the sessions are reloaded
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) Initialize ¶
Initialize Start the Serial Port
func (*SerialIO) Pause ¶
func (sio *SerialIO) Pause()
Pause stops active polling for use resume with start
func (*SerialIO) ReadLine ¶ added in v0.9.6
func (sio *SerialIO) ReadLine(logger *zap.SugaredLogger) chan string
ReadLine read's a line into a channel
func (*SerialIO) Shutdown ¶
func (sio *SerialIO) Shutdown()
Shutdown signals us to shut down our serial connection, if one is active
func (*SerialIO) SubscribeToCommands ¶ added in v0.9.8
SubscribeToCommands allows external components to receive updates when a command is recived from the arduino
func (*SerialIO) SubscribeToSliderMoveEvents ¶
func (sio *SerialIO) SubscribeToSliderMoveEvents() chan SliderMoveEvent
SubscribeToSliderMoveEvents returns an unbuffered channel that receives a sliderMoveEvent struct every time a slider moves
func (*SerialIO) WriteBytes ¶ added in v0.9.6
func (sio *SerialIO) WriteBytes(logger *zap.SugaredLogger, line []byte)
WriteBytes retruns nothing Writes a byteArray to the serial port
func (*SerialIO) WriteBytesLine ¶
func (sio *SerialIO) WriteBytesLine(logger *zap.SugaredLogger, line []byte)
WriteBytesLine retruns nothing Writes a byteArray to the serial port
func (*SerialIO) WriteStringLine ¶
func (sio *SerialIO) WriteStringLine(logger *zap.SugaredLogger, line string)
WriteStringLine retruns nothing Writes a string to the serial port
type Session ¶
type Session interface { GetVolume() float32 SetVolume(v float32) error Key() string Release() GetIconPath() string }
Session represents a single addressable audio session
type SessionFinder ¶
SessionFinder represents an entity that can find all current audio sessions
type SessionMap ¶ added in v0.9.10
type SessionMap struct {
// contains filtered or unexported fields
}
SessionMap contains the helper functions and sessions for audio managment
func (*SessionMap) Get ¶ added in v0.9.10
func (m *SessionMap) Get(key string) ([]Session, bool)
Get returns a slice of sessions
func (*SessionMap) String ¶ added in v0.9.10
func (m *SessionMap) String() string
func (*SessionMap) SubscribeToSessionReload ¶ added in v0.9.10
func (m *SessionMap) SubscribeToSessionReload() chan bool
SubscribeToSessionReload allows external components to receive updates when a Session is reloaded
type SliderMap ¶ added in v0.9.10
type SliderMap struct {
// contains filtered or unexported fields
}
SliderMap Holder of the slider map
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)