rotel

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DEFAULT_TTY         = "/dev/ttyUSB0"
	DEFAULT_TTY_BAUD    = 115200
	DEFAULT_TTY_TIMEOUT = 100 * time.Millisecond
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	TTY     string        `yaml:"tty"`
	Baud    uint          `yaml:"baud"`
	Timeout time.Duration `yaml:"timeout"`
}

type Event

type Event struct {
	State
	RotelFlag
}

type Manager

type Manager struct {
	*State
	// contains filtered or unexported fields
}

func NewWithConfig

func NewWithConfig(cfg Config) (*Manager, error)

func (*Manager) NextTrack

func (this *Manager) NextTrack() error

func (*Manager) Pause

func (this *Manager) Pause() error

func (*Manager) Play

func (this *Manager) Play() error

func (*Manager) PrevTrack

func (this *Manager) PrevTrack() error

func (*Manager) Run

func (this *Manager) Run(ctx context.Context, c chan<- Event) error

func (*Manager) SetBalance

func (this *Manager) SetBalance(loc string) error

func (*Manager) SetBass

func (this *Manager) SetBass(value int) error

func (*Manager) SetBypass

func (this *Manager) SetBypass(state bool) error

func (*Manager) SetDimmer

func (this *Manager) SetDimmer(value uint) error

func (*Manager) SetMute

func (this *Manager) SetMute(state bool) error

func (*Manager) SetPower

func (this *Manager) SetPower(state bool) error

func (*Manager) SetSource

func (this *Manager) SetSource(value string) error

func (*Manager) SetTreble

func (this *Manager) SetTreble(value int) error

func (*Manager) SetVolume

func (this *Manager) SetVolume(value uint) error

func (*Manager) Stop

func (this *Manager) Stop() error

func (*Manager) String

func (this *Manager) String() string

type RotelFlag

type RotelFlag uint16

RotelFlag provides flags on state changes

const (
	ROTEL_FLAG_POWER RotelFlag = (1 << iota)
	ROTEL_FLAG_VOLUME
	ROTEL_FLAG_MUTE
	ROTEL_FLAG_BASS
	ROTEL_FLAG_TREBLE
	ROTEL_FLAG_BALANCE
	ROTEL_FLAG_SOURCE
	ROTEL_FLAG_FREQ
	ROTEL_FLAG_BYPASS
	ROTEL_FLAG_SPEAKER
	ROTEL_FLAG_DIMMER
	ROTEL_FLAG_NONE RotelFlag = 0
	ROTEL_FLAG_MIN            = ROTEL_FLAG_POWER
	ROTEL_FLAG_MAX            = ROTEL_FLAG_DIMMER
)

func SetBalance

func SetBalance(this *State, args []string) (RotelFlag, error)

func SetBass

func SetBass(this *State, args []string) (RotelFlag, error)

func SetBypass

func SetBypass(this *State, args []string) (RotelFlag, error)

func SetDimmer

func SetDimmer(this *State, args []string) (RotelFlag, error)

func SetFreq

func SetFreq(this *State, args []string) (RotelFlag, error)

func SetModel

func SetModel(this *State, args []string) (RotelFlag, error)

func SetMute

func SetMute(this *State, args []string) (RotelFlag, error)

func SetPower

func SetPower(this *State, args []string) (RotelFlag, error)

func SetSource

func SetSource(this *State, args []string) (RotelFlag, error)

func SetSpeaker

func SetSpeaker(this *State, args []string) (RotelFlag, error)

func SetTreble

func SetTreble(this *State, args []string) (RotelFlag, error)

func SetUpdateMode

func SetUpdateMode(this *State, args []string) (RotelFlag, error)

func SetVolume

func SetVolume(this *State, args []string) (RotelFlag, error)

func (RotelFlag) FlagString

func (f RotelFlag) FlagString() string

func (RotelFlag) String

func (f RotelFlag) String() string

type State

type State struct {
	// contains filtered or unexported fields
}

func (*State) Balance

func (this *State) Balance() (string, uint)

func (*State) Bass

func (this *State) Bass() int

func (*State) Bypass

func (this *State) Bypass() bool

func (*State) Dimmer

func (this *State) Dimmer() uint

func (*State) Freq

func (this *State) Freq() string

func (State) MarshalJSON added in v1.0.3

func (s State) MarshalJSON() ([]byte, error)

func (*State) Model

func (this *State) Model() string

func (*State) Muted

func (this *State) Muted() bool

func (*State) Power

func (this *State) Power() bool

func (*State) Set

func (this *State) Set(param string) (RotelFlag, error)

Set sets state from data coming from amp

func (*State) Source

func (this *State) Source() string

func (*State) Speakers

func (this *State) Speakers() []string

func (*State) String

func (this *State) String() string

func (*State) Treble

func (this *State) Treble() int

func (*State) Update

func (this *State) Update() string

Update returns a query to get state

func (*State) Volume

func (this *State) Volume() uint

Jump to

Keyboard shortcuts

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