control

package
v0.0.0-...-165f5b9 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func OpenClient

func OpenClient(ctx context.Context, wg *sync.WaitGroup, serverHost, playerName string) (*Client, error)

func (*Client) Run

func (c *Client) Run(mainCtx context.Context, wg *sync.WaitGroup)

func (*Client) WaitForStatus

func (c *Client) WaitForStatus(ctx context.Context) (<-chan Status, error)

type MPRISHandler

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

MPRISHandler materializes Status into dbus to implement the MPRIS control interface.

Adapted from https://raw.githubusercontent.com/dweymouth/supersonic/v0.13.0/backend/mpris.go Licensed under GPL3.0 by Drew Weymouth

func NewMPRISHandler

func NewMPRISHandler(ctx context.Context, updates <-chan Status, client *Client) *MPRISHandler

func (*MPRISHandler) CanControl

func (m *MPRISHandler) CanControl() (bool, error)

func (*MPRISHandler) CanGoNext

func (m *MPRISHandler) CanGoNext() (bool, error)

func (*MPRISHandler) CanGoPrevious

func (m *MPRISHandler) CanGoPrevious() (bool, error)

func (*MPRISHandler) CanPause

func (m *MPRISHandler) CanPause() (bool, error)

func (*MPRISHandler) CanPlay

func (m *MPRISHandler) CanPlay() (bool, error)

func (*MPRISHandler) CanQuit

func (m *MPRISHandler) CanQuit() (bool, error)

func (*MPRISHandler) CanRaise

func (m *MPRISHandler) CanRaise() (bool, error)

func (*MPRISHandler) CanSeek

func (m *MPRISHandler) CanSeek() (bool, error)

func (*MPRISHandler) Errors

func (m *MPRISHandler) Errors() <-chan error

func (*MPRISHandler) HasTrackList

func (m *MPRISHandler) HasTrackList() (bool, error)

func (*MPRISHandler) Identity

func (m *MPRISHandler) Identity() (string, error)

func (*MPRISHandler) LoopStatus

func (m *MPRISHandler) LoopStatus() (types.LoopStatus, error)

func (*MPRISHandler) MaximumRate

func (m *MPRISHandler) MaximumRate() (float64, error)

func (*MPRISHandler) Metadata

func (m *MPRISHandler) Metadata() (types.Metadata, error)

func (*MPRISHandler) MinimumRate

func (m *MPRISHandler) MinimumRate() (float64, error)

func (*MPRISHandler) Next

func (m *MPRISHandler) Next() error

func (*MPRISHandler) OpenUri

func (m *MPRISHandler) OpenUri(_ string) error

func (*MPRISHandler) Pause

func (m *MPRISHandler) Pause() error

func (*MPRISHandler) Play

func (m *MPRISHandler) Play() error

func (*MPRISHandler) PlayPause

func (m *MPRISHandler) PlayPause() error

func (*MPRISHandler) PlaybackStatus

func (m *MPRISHandler) PlaybackStatus() (types.PlaybackStatus, error)

func (*MPRISHandler) Position

func (m *MPRISHandler) Position() (int64, error)

func (*MPRISHandler) Previous

func (m *MPRISHandler) Previous() error

func (*MPRISHandler) Quit

func (m *MPRISHandler) Quit() error

func (*MPRISHandler) Raise

func (m *MPRISHandler) Raise() error

func (*MPRISHandler) Rate

func (m *MPRISHandler) Rate() (float64, error)

func (*MPRISHandler) Seek

func (m *MPRISHandler) Seek(offset types.Microseconds) error

func (*MPRISHandler) SetLoopStatus

func (m *MPRISHandler) SetLoopStatus(status types.LoopStatus) error

func (*MPRISHandler) SetPosition

func (m *MPRISHandler) SetPosition(trackId string, position types.Microseconds) error

func (*MPRISHandler) SetRate

func (m *MPRISHandler) SetRate(float64) error

func (*MPRISHandler) SetShuffle

func (m *MPRISHandler) SetShuffle(enable bool) error

func (*MPRISHandler) SetVolume

func (m *MPRISHandler) SetVolume(v float64) error

func (*MPRISHandler) Shuffle

func (m *MPRISHandler) Shuffle() (bool, error)

func (*MPRISHandler) Stop

func (m *MPRISHandler) Stop() error

func (*MPRISHandler) SupportedMimeTypes

func (m *MPRISHandler) SupportedMimeTypes() ([]string, error)

func (*MPRISHandler) SupportedUriSchemes

func (m *MPRISHandler) SupportedUriSchemes() ([]string, error)

func (*MPRISHandler) Volume

func (m *MPRISHandler) Volume() (float64, error)

type ShuffleStatus

type ShuffleStatus string
const (
	StuffleStatusNone  ShuffleStatus = "0"
	StuffleStatusTrack ShuffleStatus = "1"
	StuffleStatusAlbum ShuffleStatus = "2"
)

type Status

type Status struct {
	CanSeek   bool
	Connected bool
	Loop      types.LoopStatus
	Shuffle   ShuffleStatus
	Metadata  types.Metadata
	Playback  types.PlaybackStatus
	Position  time.Duration
	Volume    int
}

func EmptyStatus

func EmptyStatus() Status

Jump to

Keyboard shortcuts

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