Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type MediaPlayer2 ¶
type MediaPlayer2 struct {
*RemoteControl
}
func (*MediaPlayer2) Quit ¶
func (m *MediaPlayer2) Quit() *dbus.Error
func (*MediaPlayer2) Raise ¶
func (m *MediaPlayer2) Raise() *dbus.Error
type MetadataMap ¶
func MapFromPlayingInfo ¶
func MapFromPlayingInfo(info PlayingInfo) MetadataMap
type PlaybackStatus ¶
type PlaybackStatus string
PlaybackStatus is a playback state. https://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html#Enum:Playback_Status
const ( PlaybackStatusPlaying PlaybackStatus = "Playing" PlaybackStatusPaused PlaybackStatus = "Paused" PlaybackStatusStopped PlaybackStatus = "Stopped" )
Defined PlaybackStatuses.
func PlaybackStatusFromPlayer ¶
func PlaybackStatusFromPlayer(state types.State) (PlaybackStatus, error)
type Player ¶
type Player struct { *RemoteControl // contains filtered or unexported fields }
Player is a DBus object satisfying the `org.mpris.MediaPlayer2.Player` interface. https://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html
func (*Player) Next ¶
func (p *Player) Next() *dbus.Error
Next skips to the next track in the tracklist. https://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html#Method:Next
func (*Player) Pause ¶
func (p *Player) Pause() *dbus.Error
Pause pauses playback. https://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html#Method:Pause
func (*Player) Play ¶
func (p *Player) Play() *dbus.Error
Play starts or resumes playback. https://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html#Method:Play
func (*Player) PlayPause ¶
func (p *Player) PlayPause() *dbus.Error
PlayPause toggles playback. If playback is already paused, resumes playback. If playback is stopped, starts playback. https://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html#Method:PlayPause
func (*Player) Previous ¶
func (p *Player) Previous() *dbus.Error
Previous skips to the previous track in the tracklist. https://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html#Method:Previous
func (*Player) Stop ¶
func (p *Player) Stop() *dbus.Error
Stop stops playback. https://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html#Method:Stop
type PlayingInfo ¶
type RemoteControl ¶
type RemoteControl struct {
// contains filtered or unexported fields
}
func NewRemoteControl ¶
func NewRemoteControl(p Controller, nowInfo PlayingInfo) *RemoteControl
func (*RemoteControl) IntrospectNode ¶
func (s *RemoteControl) IntrospectNode() *introspect.Node
func (*RemoteControl) Release ¶
func (s *RemoteControl) Release()
func (*RemoteControl) SetPlayingInfo ¶
func (s *RemoteControl) SetPlayingInfo(info PlayingInfo)
func (*RemoteControl) SetPosition ¶
func (s *RemoteControl) SetPosition(duration time.Duration)
type TimeInUs ¶
type TimeInUs int64
TimeInUs is time in microseconds. https://specifications.freedesktop.org/mpris-spec/latest/Player_Interface.html#Simple-Type:Time_In_Us
func UsFromDuration ¶
UsFromDuration returns the type from a time.Duration