remote

package
v0.0.0-...-ecbb9df Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterMPMediaHandler

func RegisterMPMediaHandler(_ ControlledPlayer, _ logger.LoggerInterface) error

Types

type ControlledPlayer

type ControlledPlayer interface {
	// Returns true if a seek is currently in progress.
	IsSeeking() (bool, error)
	IsPaused() (bool, error)
	IsPlaying() (bool, error)

	// Registers a callback which is invoked when the player transitions to the Paused state.
	OnPaused(cb func())

	// Registers a callback which is invoked when the player transitions to the Stopped state.
	OnStopped(cb func())

	// Registers a callback which is invoked when the player transitions to the Playing state.
	OnPlaying(cb func())

	// Registers a callback which is invoked whenever a seek event occurs.
	OnSeek(cb func())

	OnSongChange(cb func(track TrackInterface))

	GetTimePos() float64

	Play() error
	Pause() error
	Stop() error
	SeekAbsolute(float64) error
	NextTrack() error
	PreviousTrack() error

	SetVolume(percentValue int) error
}

type MprisPlayer

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

func RegisterMprisPlayer

func RegisterMprisPlayer(player ControlledPlayer, logger_ logger.LoggerInterface) (mpp *MprisPlayer, err error)

func (*MprisPlayer) Close

func (m *MprisPlayer) Close()

func (*MprisPlayer) Next

func (m *MprisPlayer) Next() *dbus.Error

func (*MprisPlayer) OnSongChange

func (m *MprisPlayer) OnSongChange(currentSong TrackInterface)

OnSongChange method to be called by eventLoop

func (*MprisPlayer) Pause

func (m *MprisPlayer) Pause() *dbus.Error

set paused

func (*MprisPlayer) Play

func (m *MprisPlayer) Play() *dbus.Error

set playing

func (*MprisPlayer) PlayPause

func (m *MprisPlayer) PlayPause() *dbus.Error

func (*MprisPlayer) Previous

func (m *MprisPlayer) Previous() *dbus.Error

func (*MprisPlayer) Seek

func (m *MprisPlayer) Seek(offset int64, _ int) (int64, error)

func (*MprisPlayer) SetPosition

func (m *MprisPlayer) SetPosition(trackId dbus.ObjectPath, position int64) *dbus.Error

func (*MprisPlayer) Stop

func (m *MprisPlayer) Stop()

Mandatory functions

type TrackInterface

type TrackInterface interface {
	GetId() string
	GetArtist() string
	GetTitle() string
	GetDuration() int
	GetAlbumArtist() string
	GetAlbum() string
	GetTrackNumber() int

	// something like ID != ""
	IsValid() bool
}

Jump to

Keyboard shortcuts

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