radio

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeVolume

func ChangeVolume(ctx context.Context, r hub.Radio, delta int) error

func DeleteRadio

func DeleteRadio(h *hub.Hub, r hub.Radio) error

func GetState

func GetState(ctx context.Context, r hub.Radio) (*state.State, error)

func ListRadios

func ListRadios(h *hub.Hub) []model.Radio

func ListStates

func ListStates(ctx context.Context, h *hub.Hub) []state.State

func PlayPreset

func PlayPreset(ctx context.Context, r hub.Radio, preset int) error

func RefreshSubscription

func RefreshSubscription(ctx context.Context, r hub.Radio) error

func RefreshVolume

func RefreshVolume(ctx context.Context, r hub.Radio) error

func SetAudioSource

func SetAudioSource(ctx context.Context, r hub.Radio, audioSource string) error

func SetPower

func SetPower(ctx context.Context, r hub.Radio, power bool) error

func SetVolume

func SetVolume(ctx context.Context, r hub.Radio, volume int) error

Types

type DefaultStateHook

type DefaultStateHook struct{}

func (DefaultStateHook) OnChanged

func (DefaultStateHook) OnStart

type Discoverer

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

func NewDiscoverer

func NewDiscoverer(hub *hub.Hub, controlPoint upnpsub.ControlPoint, stateHook StateHook) *Discoverer

func (*Discoverer) Background

func (d *Discoverer) Background(ctx context.Context, doneC chan<- struct{})

func (*Discoverer) Discover

func (d *Discoverer) Discover(force bool) error

func (*Discoverer) Discovering

func (d *Discoverer) Discovering() bool

type StateHook

type StateHook interface {
	// OnStart is called when when state is first created.
	OnStart(context.Context, *state.State, state.Changed) state.Changed
	// OnChanged is called when state changes.
	OnChanged(context.Context, *state.State, state.Changed) state.Changed
}

Jump to

Keyboard shortcuts

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