Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoPlayerVolume when failed to get player volume ErrNoPlayerVolume = errors.New("failed to get player volume") // ErrNoArtists when failed to get artists ErrNoArtists = errors.New("failed to get artists") // ErrNoTitle when failed to get title ErrNoTitle = errors.New("failed to get title") // ErrNoID when failed to get id ErrNoID = errors.New("failed to get track id") // ErrNoLength when mpris track length is 0 ErrNoLength = errors.New("track length is empty") )
Functions ¶
Types ¶
type Metadata ¶ added in v0.14.0
type Metadata struct {
Player string `json:"player"`
ID string `json:"id"`
Artist string `json:"artist"`
Title string `json:"title"`
RawArtist string `json:"raw_artist"`
RawTitle string `json:"raw_title"`
Album string `json:"album"`
Cover string `json:"cover"`
URL *URL `json:"url"`
Metadata map[string]dbus.Variant `json:"-"`
Volume float64 `json:"volume"`
Position time.Duration `json:"position"`
Length time.Duration `json:"length"`
Shuffle bool `json:"shuffle"`
Status mpris.PlaybackStatus `json:"status"`
}
Metadata holds all information of currently playing track metadata
func (*Metadata) Percentage ¶ added in v0.14.0
Percentage is player position in percentage rounded to int
type URL ¶ added in v0.14.0
URL wraps net.URL to provide JSON marshaling/unmarshaling
func (URL) MarshalJSON ¶ added in v0.14.0
MarshalJSON implements json.Marshaler
func (URL) String ¶ added in v0.14.0
String returns the string representation of the URL Implements the fmt.Stringer interface
func (*URL) UnmarshalJSON ¶ added in v0.14.0
UnmarshalJSON implements json.Unmarshaler
Click to show internal directories.
Click to hide internal directories.