Documentation
¶
Index ¶
- func RegisterMPMediaHandler(_ ControlledPlayer, _ logger.LoggerInterface) error
- type ControlledPlayer
- type MprisPlayer
- func (m *MprisPlayer) Close()
- func (m *MprisPlayer) Next() *dbus.Error
- func (m *MprisPlayer) OnSongChange(currentSong TrackInterface)
- func (m *MprisPlayer) Pause() *dbus.Error
- func (m *MprisPlayer) Play() *dbus.Error
- func (m *MprisPlayer) PlayPause() *dbus.Error
- func (m *MprisPlayer) Previous() *dbus.Error
- func (m *MprisPlayer) Seek(offset int64, _ int) (int64, error)
- func (m *MprisPlayer) SetPosition(trackId dbus.ObjectPath, position int64) *dbus.Error
- func (m *MprisPlayer) Stop()
- type TrackInterface
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(int) 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, lgr logger.LoggerInterface) (mpp *MprisPlayer, err error)
FIXME play/pause isn't being correctly reported
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) PlayPause ¶
func (m *MprisPlayer) PlayPause() *dbus.Error
func (*MprisPlayer) Previous ¶
func (m *MprisPlayer) Previous() *dbus.Error
func (*MprisPlayer) SetPosition ¶
func (m *MprisPlayer) SetPosition(trackId dbus.ObjectPath, position int64) *dbus.Error
Click to show internal directories.
Click to hide internal directories.