Documentation
¶
Overview ¶
Package system provides desktop integration for media controls and notifications.
Index ¶
- func SetReadArtworkFn(fn func(string) ([]byte, string, error))
- type MPRIS
- func (m *MPRIS) ClearMetadata()
- func (m *MPRIS) Close()
- func (m *MPRIS) UpdateLoopStatus(mode string)
- func (m *MPRIS) UpdateMetadata(title, artist, album, filePath string, durationMs int, trackID int64)
- func (m *MPRIS) UpdatePlaybackStatus(state string)
- func (m *MPRIS) UpdatePosition(seconds float64)
- func (m *MPRIS) UpdateShuffle(enabled bool)
- func (m *MPRIS) UpdateVolume(percent int)
- type Notifier
- type PlayerControl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MPRIS ¶
type MPRIS struct {
// contains filtered or unexported fields
}
MPRIS provides MPRIS2 D-Bus integration for Forte.
func NewMPRIS ¶
func NewMPRIS(player PlayerControl) (*MPRIS, error)
NewMPRIS creates and registers the MPRIS2 service on the session bus.
func (*MPRIS) ClearMetadata ¶
func (m *MPRIS) ClearMetadata()
ClearMetadata resets metadata to empty (when stopped).
func (*MPRIS) Close ¶
func (m *MPRIS) Close()
Close releases the D-Bus connection and cleans up temp files.
func (*MPRIS) UpdateLoopStatus ¶
UpdateLoopStatus pushes repeat mode to D-Bus.
func (*MPRIS) UpdateMetadata ¶
func (m *MPRIS) UpdateMetadata(title, artist, album, filePath string, durationMs int, trackID int64)
UpdateMetadata pushes track metadata to D-Bus.
func (*MPRIS) UpdatePlaybackStatus ¶
UpdatePlaybackStatus pushes a playback state change to D-Bus.
func (*MPRIS) UpdatePosition ¶
UpdatePosition updates the Position property (no signal emitted per spec).
func (*MPRIS) UpdateShuffle ¶
UpdateShuffle pushes shuffle state to D-Bus.
func (*MPRIS) UpdateVolume ¶
UpdateVolume pushes volume to D-Bus (0-100 -> 0.0-1.0).
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier sends desktop notifications via D-Bus.
func NewNotifier ¶
NewNotifier connects to the session bus for sending notifications.
func (*Notifier) Close ¶
func (n *Notifier) Close()
Close releases the D-Bus connection and cleans up temp files.
func (*Notifier) Notify ¶
Notify sends a desktop notification. If artwork is non-nil, it is used as the notification icon. Each call replaces the previous notification.
func (*Notifier) SetEnabled ¶
SetEnabled enables or disables notifications.
type PlayerControl ¶
type PlayerControl interface {
Pause()
Resume()
Stop()
Next()
Previous()
Seek(seconds float64)
SetVolume(percent int)
Volume() int
Position() float64
Duration() float64
State() string
MediaPath() string
SetShuffle(enabled bool)
GetShuffle() bool
SetRepeat(mode string)
GetRepeat() string
}
PlayerControl is the interface that desktop media integrations use to control the player.