mpris

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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) Handle

func (p *MPRISPlugin) Handle(ctx context.Context, dev device.Sender, pkt *protocol.Packet) error

Handle processes incoming MPRIS control packets.

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 MPRISRequest struct {
	RequestPlayerList bool   `json:"requestPlayerList,omitempty"`
	Player            string `json:"player,omitempty"`
	Action            string `json:"action,omitempty"`
	Volume            *int   `json:"volume,omitempty"`
	Seek              *int64 `json:"Seek,omitempty"`
	SetPosition       *int64 `json:"SetPosition,omitempty"`
}

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"
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL