Documentation
¶
Index ¶
- type ConcreteServer
- type DBusInstance
- type DummyServer
- type LoopStatus
- type MediaPlayer2CommandSetPositionPayload
- type MediaPlayer2PlayerCommand
- type MediaPlayer2PlayerCommandResponse
- type MediaPlayer2PlayerCommandType
- type MediaPlayer2PlayerInterface
- func (p MediaPlayer2PlayerInterface) Next() *dbus.Error
- func (p MediaPlayer2PlayerInterface) OpenUri(s dbus.ObjectPath) *dbus.Error
- func (p MediaPlayer2PlayerInterface) Pause() *dbus.Error
- func (p MediaPlayer2PlayerInterface) Play() *dbus.Error
- func (p MediaPlayer2PlayerInterface) PlayPause() *dbus.Error
- func (p MediaPlayer2PlayerInterface) Previous() *dbus.Error
- func (p MediaPlayer2PlayerInterface) Props() map[string]*prop.Prop
- func (p MediaPlayer2PlayerInterface) SeekBy(x int64) *dbus.Error
- func (p MediaPlayer2PlayerInterface) SetPosition(o dbus.ObjectPath, x int64) *dbus.Error
- func (p MediaPlayer2PlayerInterface) Stop() *dbus.Error
- type MediaPlayer2PlayerInterfaceInterface
- type MediaPlayer2RootInterface
- type MediaState
- type PlaybackStatus
- type SeekState
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConcreteServer ¶
type ConcreteServer struct {
// contains filtered or unexported fields
}
ConcreteServer publishes the player on the D-Bus session bus. The bus is owned by the user's session, which a system service can start before: the server waits for it rather than failing, and comes back when it does after losing it.
func NewServer ¶
func NewServer(logger librespot.Logger) (_ *ConcreteServer, err error)
NewServer starts publishing the player on the session bus. It does not fail for want of a bus: it connects in the background, as soon as there is one.
func (*ConcreteServer) Close ¶
func (s *ConcreteServer) Close() error
func (*ConcreteServer) EmitSeekUpdate ¶
func (s *ConcreteServer) EmitSeekUpdate(state SeekState)
func (*ConcreteServer) EmitStateUpdate ¶
func (s *ConcreteServer) EmitStateUpdate(state MediaState)
func (*ConcreteServer) Receive ¶
func (s *ConcreteServer) Receive() <-chan MediaPlayer2PlayerCommand
type DBusInstance ¶
type DBusInstance struct {
// contains filtered or unexported fields
}
type DummyServer ¶
type DummyServer struct {
}
func (DummyServer) Close ¶
func (d DummyServer) Close() error
func (DummyServer) EmitSeekUpdate ¶
func (d DummyServer) EmitSeekUpdate(_ SeekState)
func (DummyServer) EmitStateUpdate ¶
func (d DummyServer) EmitStateUpdate(_ MediaState)
func (DummyServer) Receive ¶
func (d DummyServer) Receive() <-chan MediaPlayer2PlayerCommand
type LoopStatus ¶
type LoopStatus string
const ( None LoopStatus = "None" Track LoopStatus = "Track" Playlist LoopStatus = "Playlist" )
func GetLoopStatus ¶
func GetLoopStatus(repeatingContext bool, repeatingTrack bool) LoopStatus
type MediaPlayer2CommandSetPositionPayload ¶
type MediaPlayer2CommandSetPositionPayload struct {
ObjectPath dbus.ObjectPath
PositionUs int64
}
type MediaPlayer2PlayerCommand ¶
type MediaPlayer2PlayerCommand struct {
Type MediaPlayer2PlayerCommandType
Argument any
// contains filtered or unexported fields
}
func (*MediaPlayer2PlayerCommand) Reply ¶
func (m *MediaPlayer2PlayerCommand) Reply(resp MediaPlayer2PlayerCommandResponse)
type MediaPlayer2PlayerCommandType ¶
type MediaPlayer2PlayerCommandType int32
const ( MediaPlayer2PlayerCommandTypeNext MediaPlayer2PlayerCommandType = iota MediaPlayer2PlayerCommandTypePrevious MediaPlayer2PlayerCommandTypePause MediaPlayer2PlayerCommandTypePlayPause MediaPlayer2PlayerCommandTypeStop MediaPlayer2PlayerCommandTypePlay MediaPlayer2PlayerCommandTypeSeek MediaPlayer2PlayerCommandTypeSetPosition MediaPlayer2PlayerCommandTypeOpenUri MediaPlayer2PlayerCommandLoopStatusChanged MediaPlayer2PlayerCommandRateChanged MediaPlayer2PlayerCommandShuffleChanged MediaPlayer2PlayerCommandVolumeChanged )
type MediaPlayer2PlayerInterface ¶
type MediaPlayer2PlayerInterface struct {
// contains filtered or unexported fields
}
func (MediaPlayer2PlayerInterface) Next ¶
func (p MediaPlayer2PlayerInterface) Next() *dbus.Error
func (MediaPlayer2PlayerInterface) OpenUri ¶
func (p MediaPlayer2PlayerInterface) OpenUri(s dbus.ObjectPath) *dbus.Error
func (MediaPlayer2PlayerInterface) Pause ¶
func (p MediaPlayer2PlayerInterface) Pause() *dbus.Error
func (MediaPlayer2PlayerInterface) Play ¶
func (p MediaPlayer2PlayerInterface) Play() *dbus.Error
func (MediaPlayer2PlayerInterface) PlayPause ¶
func (p MediaPlayer2PlayerInterface) PlayPause() *dbus.Error
func (MediaPlayer2PlayerInterface) Previous ¶
func (p MediaPlayer2PlayerInterface) Previous() *dbus.Error
func (MediaPlayer2PlayerInterface) Props ¶
func (p MediaPlayer2PlayerInterface) Props() map[string]*prop.Prop
func (MediaPlayer2PlayerInterface) SeekBy ¶ added in v0.10.2
func (p MediaPlayer2PlayerInterface) SeekBy(x int64) *dbus.Error
SeekBy is the MPRIS Seek method, exported under that name (see playerMethodNames). Called Seek in Go it would look like io.Seeker with the wrong signature, which go vet rejects.
func (MediaPlayer2PlayerInterface) SetPosition ¶
func (p MediaPlayer2PlayerInterface) SetPosition(o dbus.ObjectPath, x int64) *dbus.Error
func (MediaPlayer2PlayerInterface) Stop ¶
func (p MediaPlayer2PlayerInterface) Stop() *dbus.Error
type MediaPlayer2RootInterface ¶
type MediaPlayer2RootInterface struct {
// contains filtered or unexported fields
}
MediaPlayer2RootInterface : empty, does not do much
func (MediaPlayer2RootInterface) Quit ¶
func (r MediaPlayer2RootInterface) Quit() *dbus.Error
func (MediaPlayer2RootInterface) Raise ¶
func (r MediaPlayer2RootInterface) Raise() *dbus.Error
type MediaState ¶
type MediaState struct {
PlaybackStatus PlaybackStatus
LoopStatus LoopStatus
Shuffle bool
Volume float64
PositionMs int64
Uri *string // nilable
Media *librespot.Media // nilable
}
type PlaybackStatus ¶
type PlaybackStatus string
const ( Playing PlaybackStatus = "Playing" Paused PlaybackStatus = "Paused" Stopped PlaybackStatus = "Stopped" )
type Server ¶
type Server interface {
EmitStateUpdate(state MediaState)
EmitSeekUpdate(state SeekState)
Receive() <-chan MediaPlayer2PlayerCommand
Close() error
}
Click to show internal directories.
Click to hide internal directories.