model

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueueStatePlaying queueState = "PLAYING"
	QueueStateIdle    queueState = "IDLE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceVolume added in v0.0.2

type DeviceVolume struct {
	DeviceSerialNumber string `json:"deviceSerialNumber"`
	Muted              bool   `json:"muted"`
	Volume             int    `json:"volume"`
}

type DevicesResponse

type DevicesResponse struct {
	Devices []PlayerDevice `json:"devices"`
}

type PlayerDevice

type PlayerDevice struct {
	Name                  string `json:"name,omitempty"`
	DeviceOwnerCustomerId string `json:"deviceOwnerCustomerId"`
	DeviceType            string `json:"deviceType"`
	SerialNumber          string `json:"serialNumber"`
}

type Queue

type Queue struct {
	State         queueState `json:"state"`
	QueuePosition int        `json:"queuePosition"`
	TrackPosition int        `json:"trackPosition"`
	Songs         []Song     `json:"queue"`
	Shuffle       bool       `json:"shuffle"`
	Repeat        bool       `json:"repeat"`
}

func NewQueue

func NewQueue() *Queue

func (*Queue) Current

func (q *Queue) Current() *Song

func (*Queue) HasItems

func (q *Queue) HasItems() bool

func (*Queue) HasNext

func (q *Queue) HasNext() bool

func (*Queue) HasPrev

func (q *Queue) HasPrev() bool

func (*Queue) Next

func (q *Queue) Next() *Song

func (*Queue) PeekNext

func (q *Queue) PeekNext() *Song

func (*Queue) Prev

func (q *Queue) Prev() *Song

type Song

type Song struct {
	Id       string `json:"id"`
	Name     string `json:"name"`
	Album    string `json:"album"`
	Artist   string `json:"artist"`
	Duration int    `json:"duration"`
	Cover    string `json:"cover"`
	Stream   string `json:"stream"`
}

type VolumeRequest added in v0.0.2

type VolumeRequest struct {
	Device PlayerDevice `json:"device"`
	Volume int          `json:"volume"`
}

type VolumeResponse added in v0.0.2

type VolumeResponse struct {
	Volumes []DeviceVolume `json:"volumes"`
}

Jump to

Keyboard shortcuts

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