dao

package
v0.0.0-...-2387267 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Envelope

type Envelope struct {
	TrackDuration string `xml:"Body>GetPositionInfoResponse>TrackDuration"`
	TrackMetaData string `xml:"Body>GetPositionInfoResponse>TrackMetaData"`
	TrackURI      string `xml:"Body>GetPositionInfoResponse>TrackURI"`
}

Envelope : A response Envelope

type Service

type Service struct {
	Name       string
	Port       int
	ControlURL string
	EventURL   string
}

Service : Defines a sevice in the dao package

type Sonos

type Sonos struct {
	Address net.IP `json:"address"`
}

Sonos : Defines a speaker for the dao package

func (*Sonos) GetCurrentTrack

func (s *Sonos) GetCurrentTrack() (*Track, error)

GetCurrentTrack returns a pointer to a track struct with useful information about the current track

func (*Sonos) GetLEDState

func (s *Sonos) GetLEDState()

GetLEDState does what it says

func (*Sonos) GetMute

func (s *Sonos) GetMute() bool

GetMute gets the current mute value

func (*Sonos) GetPositionInfo

func (s *Sonos) GetPositionInfo() error

GetPositionInfo does that

func (*Sonos) GetSessionID

func (s *Sonos) GetSessionID()

GetSessionID does what it says

func (*Sonos) GetVolume

func (s *Sonos) GetVolume() error

GetVolume gets the current volume

func (*Sonos) ListAvailableServices

func (s *Sonos) ListAvailableServices()

ListAvailableServices does what it says

func (*Sonos) Next

func (s *Sonos) Next() error

Next track

func (*Sonos) Pause

func (s *Sonos) Pause() error

Pause the media playback

func (*Sonos) Play

func (s *Sonos) Play() error

Play : Start the media playback

func (*Sonos) PlayURI

func (s *Sonos) PlayURI(uri, meta string) error

PlayURI plays the given uri on the device

func (*Sonos) Previous

func (s *Sonos) Previous() error

Previous track

func (*Sonos) Seek

func (s *Sonos) Seek(timestamp string) error

Seek jups to a specific timestamp in the song

func (*Sonos) SetLEDState

func (s *Sonos) SetLEDState(on bool) (bool, error)

SetLEDState does what it says

func (*Sonos) SetMute

func (s *Sonos) SetMute(mute bool) error

SetMute sets the mute

func (*Sonos) SetRelativeVolume

func (s *Sonos) SetRelativeVolume(adjustment int) error

SetRelativeVolume adjusts the volume

func (*Sonos) SetVolume

func (s *Sonos) SetVolume(desired int) error

SetVolume sets the volume

func (*Sonos) Stop

func (s *Sonos) Stop() error

Stop the media playback

type Track

type Track struct {
	Title    string `json:"title"`
	Artist   string `json:"artist"`
	Album    *album `json:"album"`
	Duration string `json:"duration"`
	Position string `json:"position"`
	URI      string `json:"uri"`
}

Track is the struct that is actually returned, when GetCurrentTrack is called

Jump to

Keyboard shortcuts

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