Documentation
¶
Index ¶
- Constants
- func List(conn *dbus.Conn) ([]string, error)
- type LoopStatus
- type PlaybackStatus
- type Player
- func (i *Player) GetIdentity() (string, error)
- func (i *Player) GetLength() (float64, error)
- func (i *Player) GetLoopStatus() (LoopStatus, error)
- func (i *Player) GetMetadata() (map[string]dbus.Variant, error)
- func (i *Player) GetName() string
- func (i *Player) GetPlaybackStatus() (PlaybackStatus, error)
- func (i *Player) GetPlayerProperty(properityName string) (dbus.Variant, error)
- func (i *Player) GetPosition() (float64, error)
- func (i *Player) GetProperty(targetInterface, properityName string) (dbus.Variant, error)
- func (i *Player) GetRate() (float64, error)
- func (i *Player) GetShuffle() (bool, error)
- func (i *Player) GetVolume() (float64, error)
- func (i *Player) Next() error
- func (i *Player) OnSignal(ch chan<- *dbus.Signal) (err error)
- func (i *Player) OpenUri(uri string) error
- func (i *Player) Pause() error
- func (i *Player) Play() error
- func (i *Player) PlayPause() error
- func (i *Player) Previous() error
- func (i *Player) Quit() error
- func (i *Player) Raise() error
- func (i *Player) Seek(offset float64) error
- func (i *Player) SetLoopStatus(loopStatus LoopStatus) error
- func (i *Player) SetPlayerProperty(propertyName string, value interface{}) error
- func (i *Player) SetPosition(position float64) error
- func (i *Player) SetProperty(targetInterface, propertyName string, value interface{}) error
- func (i *Player) SetShuffle(value bool) error
- func (i *Player) SetTrackPosition(trackId *dbus.ObjectPath, position float64) error
- func (i *Player) SetVolume(volume float64) error
- func (i *Player) Stop() error
Constants ¶
const ( BaseInterface = "org.mpris.MediaPlayer2" PlayerInterface = "org.mpris.MediaPlayer2.Player" TrackListInterface = "org.mpris.MediaPlayer2.TrackList" PlaylistsInterface = "org.mpris.MediaPlayer2.Playlists" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LoopStatus ¶
type LoopStatus string
LoopStatus the status of the player loop. It can be "None", "Track" or "Playlist".
const ( LoopNone LoopStatus = "None" LoopTrack LoopStatus = "Track" LoopPlaylist LoopStatus = "Playlist" )
type PlaybackStatus ¶
type PlaybackStatus string
PlaybackStatus the status of the playback. It can be "Playing", "Paused" or "Stopped".
const ( PlaybackPlaying PlaybackStatus = "Playing" PlaybackPaused PlaybackStatus = "Paused" PlaybackStopped PlaybackStatus = "Stopped" )
type Player ¶
type Player struct {
// contains filtered or unexported fields
}
Player represents a mpris player.
func (*Player) GetIdentity ¶
GetIdentity returns the player identity.
func (*Player) GetLoopStatus ¶
func (i *Player) GetLoopStatus() (LoopStatus, error)
GetLoopStatus returns the loop status.
func (*Player) GetMetadata ¶
GetMetadata returns the metadata.
func (*Player) GetPlaybackStatus ¶
func (i *Player) GetPlaybackStatus() (PlaybackStatus, error)
GetPlaybackStatus gets the playback status.
func (*Player) GetPlayerProperty ¶
GetPlayerProperty returns the properityName from the player interface.
func (*Player) GetPosition ¶
GetPosition returns the position in seconds of the current track.
func (*Player) GetProperty ¶
GetProperty returns the properityName in the targetInterface.
func (*Player) GetShuffle ¶
GetShuffle returns false if the player is going linearly through a playlist and false if it's in some other order.
func (*Player) PlayPause ¶
PlayPause resumes the current track if it's paused and pauses it if it's playing.
func (*Player) Seek ¶
Seek seeks the current track position by the offset. The offset should be in seconds. If the offset is negative it's seeked back.
func (*Player) SetLoopStatus ¶
func (i *Player) SetLoopStatus(loopStatus LoopStatus) error
SetLoopStatus sets the loop status to loopStatus.
func (*Player) SetPlayerProperty ¶
SetPlayerProperty sets the propertyName from the player interface.
func (*Player) SetPosition ¶
SetPosition sets the position of the current track. The position should be in seconds.
func (*Player) SetProperty ¶
SetProperty sets the value of a propertyName in the targetInterface.
func (*Player) SetShuffle ¶
SetShuffle sets the shuffle playlist mode.
func (*Player) SetTrackPosition ¶
SetTrackPosition sets the position of a track. The position should be in seconds.