playercom

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PlayerCmd

type PlayerCmd struct {
	CmdID  int
	Op     PlayerOp
	Song   song.Song     // Only relevant for Op == PlayerPlay and Op == PlayerSeek.
	SeekTo time.Duration // Only relevant for Op == PlayerSeek.
}

PlayerCmd is a command that can be sent to the player. If a new command is given before the previous finished, it is assumed that the previous will be canceled.

type PlayerFeedback

type PlayerFeedback struct {
	CmdID int
	Err   error // If Err == nil, the command was successful.
}

PlayerFeedback is the feedback the player gives to a given PlayerCmd. The ID will identify which PlayerCmd is being responded to. Every PlayerCmd will get PlayerFeedback, unless a new PlayerCmd was issued in the meantime.

type PlayerOp

type PlayerOp int
const (
	PlayerPlay PlayerOp = iota
	PlayerPause
	PlayerResume
	PlayerStop
	PlayerSeek
)

type QueueCmd

type QueueCmd struct {
	CmdID int
	Op    QueueOp
	Song  song.Song // Only relevant for QueueOp == QueueSetNext.
}

type QueueFeedback

type QueueFeedback struct {
	CmdID int
	Err   error // If Err == nil, the queue command was successful.
}

type QueueOp

type QueueOp int
const (
	QueueSetNext QueueOp = iota
	QueueRemoveNext
)

type Status

type Status struct {
	Type     StatusType
	Position time.Duration // Only relevant for Type == StatusPosition.
	SongID   string        // Only relevant for Type == StatusPlayingNext, StatusNowPlaying and StatusScrobble.
	Err      error         // Only relevant for Type == StatusError.
}

A Status gives information the player provides, independent of received commands. E.g. updates on the position in the track or song changes.

type StatusType

type StatusType int
const (
	StatusPosition StatusType = iota
	StatusPlayingNext
	StatusStopped
	StatusNowPlaying
	StatusScrobble
	StatusError
)

Jump to

Keyboard shortcuts

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