player

package
v0.0.0-...-260126f Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	Play(url string)
	Playpause()
	Stop()
	Next()
	Previous()
	VolumeHold(bool)
	ToggleMute()
	ToggleRepeatMode()
	State() string
}

type Player

type Player struct {
	API     string
	Updates chan<- Status
	// contains filtered or unexported fields
}

func New

func New(api string, sp spinner.StartStopper, s chan<- Status) *Player

func (*Player) Next

func (p *Player) Next()

func (*Player) Play

func (p *Player) Play(url string)

func (*Player) Playpause

func (p *Player) Playpause()

func (*Player) PollStatus

func (p *Player) PollStatus()

func (*Player) Previous

func (p *Player) Previous()

func (*Player) State

func (p *Player) State() string

func (*Player) Stop

func (p *Player) Stop()

func (*Player) ToggleMute

func (p *Player) ToggleMute()

func (*Player) ToggleRepeatMode

func (p *Player) ToggleRepeatMode()

ToggleRepeatMode cycles between repeat modes in ascending order based on player's current repeat mode. Mode is either 0, 1 or 2. 0 means repeat play queue, 1 means repeat a track, and 2 means repeat off.

func (*Player) VolumeHold

func (p *Player) VolumeHold(up bool)

type Status

type Status struct {
	ETag     string `xml:"etag,attr"`
	Volume   int    `xml:"volume"`
	Album    string `xml:"album"`
	Artist   string `xml:"artist"`
	Track    string `xml:"name"`
	Title2   string `xml:"title2"`
	Title3   string `xml:"title3"`
	Format   string `xml:"streamFormat"`
	Quality  string `xml:"quality"`
	TrackLen int    `xml:"totlen"`
	Service  string `xml:"service"`
	Secs     int    `xml:"secs"`
	State    string `xml:"state"`
	Repeat   int    `xml:"repeat"`
}

Jump to

Keyboard shortcuts

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