Documentation
¶
Index ¶
- type MPRISPlugin
- func (p *MPRISPlugin) Handle(ctx context.Context, dev device.Sender, pkt *protocol.Packet) error
- func (p *MPRISPlugin) IncomingTypes() []string
- func (p *MPRISPlugin) Name() string
- func (p *MPRISPlugin) OnConnect(dev device.Sender)
- func (p *MPRISPlugin) OnDisconnect(dev device.Sender)
- func (p *MPRISPlugin) OutgoingTypes() []string
- func (p *MPRISPlugin) Start(ctx context.Context)
- func (p *MPRISPlugin) Stop()
- func (p *MPRISPlugin) Timeout() time.Duration
- type MPRISRequest
- type NowPlaying
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MPRISPlugin ¶
type MPRISPlugin struct {
// contains filtered or unexported fields
}
MPRISPlugin integrates with the desktop media players via D-Bus.
func NewMPRISPlugin ¶
func NewMPRISPlugin(logger *zap.Logger) (*MPRISPlugin, error)
NewMPRISPlugin creates a new MPRISPlugin and connects to the session bus.
func (*MPRISPlugin) IncomingTypes ¶
func (p *MPRISPlugin) IncomingTypes() []string
func (*MPRISPlugin) Name ¶
func (p *MPRISPlugin) Name() string
func (*MPRISPlugin) OnConnect ¶
func (p *MPRISPlugin) OnConnect(dev device.Sender)
func (*MPRISPlugin) OnDisconnect ¶
func (p *MPRISPlugin) OnDisconnect(dev device.Sender)
func (*MPRISPlugin) OutgoingTypes ¶
func (p *MPRISPlugin) OutgoingTypes() []string
func (*MPRISPlugin) Start ¶
func (p *MPRISPlugin) Start(ctx context.Context)
Start initiates the background D-Bus signal monitoring.
func (*MPRISPlugin) Stop ¶
func (p *MPRISPlugin) Stop()
Stop terminates the background D-Bus signal monitoring.
func (*MPRISPlugin) Timeout ¶
func (p *MPRISPlugin) Timeout() time.Duration
type MPRISRequest ¶
type NowPlaying ¶
type NowPlaying struct {
Player string `json:"player"`
Title string `json:"title,omitempty"`
Artist string `json:"artist,omitempty"`
Album string `json:"album,omitempty"`
AlbumArtUrl string `json:"albumArtUrl,omitempty"`
Length int64 `json:"length,omitempty"` // ms
Pos int64 `json:"pos,omitempty"` // ms
IsPlaying bool `json:"isPlaying"`
Volume int `json:"volume,omitempty"` // 0-100
CanControl bool `json:"canControl"`
CanGoNext bool `json:"canGoNext"`
CanGoPrevious bool `json:"canGoPrevious"`
CanPause bool `json:"canPause"`
CanPlay bool `json:"canPlay"`
CanSeek bool `json:"canSeek"`
PlaybackStatus string `json:"playbackStatus"` // "Playing", "Paused", "Stopped"
}
Click to show internal directories.
Click to hide internal directories.