playback

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Library

type Library interface {
	GetTrack(ctx context.Context, id uuid.UUID) (model.Track, error)
	AddPlayedAlbum(ctx context.Context, album client.AlbumFull) error
}

type Opts

type Opts struct {
	Files           *files.Files
	Streaming       streaming.StreamingClient
	Lib             Library
	Backend         *playback.Playback
	BaseURL         string
	AlbumService    album.Service
	PlaylistService playlist.Service
}

type Player

type Player struct {
	Name  string
	State playback.State
	Queue Queue
	// contains filtered or unexported fields
}

type Queue

type Queue struct {
	Tracks  []client.Track
	Current int
}

type Service

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

func Init

func Init(opts Opts, logger *slog.Logger) Service

func (*Service) AddReceiver

func (s *Service) AddReceiver(r receiver)

func (*Service) Enqueue

func (s *Service) Enqueue(playerName string, opt client.EnqueueOpt) error

func (*Service) GetStream

func (s *Service) GetStream(ctx context.Context, opt client.GetStreamOpt) (io.ReadSeekCloser, error)

func (*Service) Pause

func (s *Service) Pause(playerName string) error

func (*Service) Play

func (s *Service) Play(playerName string) error

func (*Service) Run

func (s *Service) Run(ctx context.Context) error

func (*Service) Seek

func (s *Service) Seek(playerName string, opt client.SeekOpt) error

func (*Service) SkipBackward

func (s *Service) SkipBackward(playerName string) error

func (*Service) SkipForward

func (s *Service) SkipForward(playerName string) error

func (*Service) Volume

func (s *Service) Volume(playerName string, opt client.SetVolOpt) error

Jump to

Keyboard shortcuts

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