go-mpris is an implementation of the mpris dbus interface written in go (golang). Implemented and tested against version 2.2. See: https://specifications.freedesktop.org/mpris-spec/2.2.
Example cli has been implemented.
git clone [email protected]:leberKleber/go-mpris.git
go build examples/cli.go
./cli-client
https://specifications.freedesktop.org/mpris-spec/2.2/Player_Interface.html
method | library path | implemented |
---|---|---|
Next | mpris.Player.Next() |
✔️ |
Previous | mpris.Player.Previous() |
✔️ |
Pause | mpris.Player.Pause() |
✔️ |
PlayPause | mpris.Player.PlayPause() |
✔️ |
Stop | mpris.Player.Stop() |
✔️ |
Seek | mpris.Player.SeekTo(<offset> int64) ¹ |
✔️ |
SetPosition | mpris.Player.SetPosition(<trackID> dbus.ObjectPath, <position> int64) |
✔️ |
OpenUri | mpris.Player.OpenUri(<uri> string) |
✔️ |
¹ Could not be named Seek, it's a reserved function name.
property | library path | implemented |
---|---|---|
PlaybackStatus | mpris.Player.PlaybackStatus() (mpris.PlaybackStatus, error) |
✔️ |
LoopStatus | mpris.Player.LoopStatus() (mpris.LoopStatus, error) |
✔️ |
LoopStatus | mpris.Player.SetLoopStatus(<loopStatus> mpris.LoopStatus) error |
✔️ |
Rate | mpris.Player.Rate() (float64, error) |
✔️ |
Rate | mpris.Player.SetRate(<rate> float64) error |
✔️ |
Shuffle | mpris.Player.Shuffle() (bool, error) |
✔️ |
Shuffle | mpris.Player.SetShuffle(<shuffle> bool) error |
✔️ |
Metadata | mpris.Player.Metadata() (mpris.Metadata, error) |
✔️ |
Volume | mpris.Player.Volume() (float64, error) |
✔️ |
Volume | mpris.Player.SetVolume(<volume> float64) (error) |
✔️ |
Position | mpris.Player.Position() (int64, error) |
✔️ |
Position | mpris.Player.SetPosition(<trackID> dbus.ObjectPath, <position> int64) |
✔️ |
MinimumRate | mpris.Player.MinimumRate() (float64, error) |
✔️ |
MaximumRate | mpris.Player.MaximumRate() (float64, error) |
✔️ |
CanGoNext | mpris.Player.CanGoNext() (bool, error) |
✔️ |
CanGoPrevious | mpris.Player.CanGoPrevious() (bool, error) |
✔️ |
CanPlay | mpris.Player.CanPlay() (bool, error) |
✔️ |
CanPause | mpris.Player.CanPause() (bool, error) |
✔️ |
CanSeek | mpris.Player.CanSeek() (bool, error) |
✔️ |
CanControl | mpris.Player.CanControl() (bool, error) |
✔️ |
signal | library path | implemented |
---|---|---|
Seeked | mpris.Player.Seeked(<ctx> context.Context) (<-chan int, error) |
✔️ |
https://specifications.freedesktop.org/mpris-spec/2.2/Track_List_Interface.html
method | library path | implemented |
---|---|---|
GetTracksMetadata | Not implemented yet | ✖️ |
AddTrack | Not implemented yet | ✖️ |
RemoveTrack | Not implemented yet | ✖️ |
GoTo | Not implemented yet | ✖️ |
property | library path | implemented |
---|---|---|
Tracks | Not implemented yet | ✖️ |
CanEditTracks | Not implemented yet | ✖️ |
signal | library path | implemented |
---|---|---|
TrackListReplaced | Not implemented yet | ✖️ |
TrackAdded | Not implemented yet | ✖️ |
TrackRemoved | Not implemented yet | ✖️ |
TrackMetadataChanged | Not implemented yet | ✖️ |
This library follows the semantic versioning concept.
Commits should follow the conventional commit rules.
See: https://conventionalcommits.org.
Mocks will be generated with github.com/matryer/moq
. It can be installed with
go install github.com/matryer/moq@latest
. Generation can be triggered with go generate ./...
.
Read the docs at https://pkg.go.dev/github.com/leberKleber/go-mpris