Documentation
¶
Index ¶
Constants ¶
View Source
const ( INTERFACE = "org.mpris.MediaPlayer2" PATH = "/org/mpris/MediaPlayer2" // For the NameOwnerChanged signal. MATCH_NOC = "type='signal',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged'" // For the PropertiesChanged signal. It doesn't match exactly (couldn't get that to work) so we check it manually. MATCH_PC = "type='signal',path='/org/mpris/MediaPlayer2',interface='org.freedesktop.DBus.Properties'" Refresh = "refresh" )
Various paths and values to use elsewhere.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mpris2 ¶
type Mpris2 struct { List PlayerArray Current uint Messages chan Message // contains filtered or unexported fields }
func (*Mpris2) Listen ¶
func (pl *Mpris2) Listen()
Listen should be run as a Goroutine. When players become available or are removed, an mpris2.Message is sent on mpris2.Mpris2.Messages with Name "add"/"remove" and Value as the player name. When a players state changes, a message is sent on mpris2.Mpris2.Messages with Name "refresh".
type Player ¶
type Player struct { Player dbus.BusObject FullName, Name, Title, Artist, AlbumArtist, Album string TrackNumber, Length int // -1 when track number unavailable Position int64 Playing, Stopped bool // contains filtered or unexported fields }
Player represents an active media player.
func (*Player) GetPosition ¶
func (*Player) StringPosition ¶
StringPosition figures out the track position in MM:SS/MM:SS, interpolating the value if necessary.
type PlayerArray ¶
type PlayerArray []*Player
func (PlayerArray) Len ¶
func (ls PlayerArray) Len() int
func (PlayerArray) Less ¶
func (ls PlayerArray) Less(i, j int) bool
func (PlayerArray) Swap ¶
func (ls PlayerArray) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.