GNOME Bugzilla – Bug 570841
Support the MPRIS D-Bus interface
Last modified: 2010-08-31 22:24:52 UTC
Banshee's support for retrieving metadata about tracks over D-Bus is effectively non-existent. Rather than write our own interface, we can implement the MPRIS standard. http://wiki.xmms2.xmms.se/wiki/MPRIS http://wiki.xmms2.xmms.se/wiki/Media_Player_Interfaces
Created attachment 129624 [details] [review] MPRIS extension Adds a new extension, Banshee.Mpris, which implements the MPRIS interface. MPRIS seems oriented more towards single-source players, such as VLC or XMMS, rather than multi-source players like Banshee. This extension implements controlling playback and retrieving information about the current track, but does not implement the TrackList interface. Unfortunately, MPRIS seems to have been designed by people unfamiliar with D-BUS in general. Some of the design decisions, such as requiring that the registered bus name begin with "org.mpris.", are insane. This extension tries to conform as best possible, but I advise against using MPRIS as the sole or even preferred D-BUS interface for Banshee.
Hey John, looks pretty good to me. Change tabs for 4 spaces, and don't forget your copyright headers. Does Bus.Session not work? Is there something in Banshee.ServiceStack (DBus*) that would help?
Created attachment 129707 [details] [review] MPRIS extension (v2) > Hey John, looks pretty good to me. Change tabs for 4 spaces, and don't forget > your copyright headers. Oops, developed this as a standalone and forgot to change to Banshee style. Fixed. > Does Bus.Session not work? Is there something in Banshee.ServiceStack (DBus*) > that would help? See the comment in `Service.find_bus()`. MPRIS *requires* that service names start with `org.mpris.`, which is frankly somewhat insane. Bus.Session will reuse the existing session, and will use the name "org.bansheeproject.Banshee". In addition, MPRIS assumes that it's the only interface on the connection and seizes object paths like / and /Player. It's not well designed, from a D-BUS standpoint, and I don't want it getting mixed up with the real Banshee interfaces. If at some future point a new version of MPRIS is released that fixes these shortcomings, the extension can be amended to use the shared bus connection.
Ok, rename find_bus to FindBus and it looks fine to me. Aaron, are you ok w/ this going in/being on by default?
Created attachment 129807 [details] [review] MPRIS extension (v3) > rename find_bus to FindBus done
John, is this patch ready to be enabled and shipped in a stable release? Any reservations?
FYI, I've started working on this, starting from the patch here. There's ongoing work to update the MPRIS spec, fixing the issues outlined by John : http://gitorious.org/~mirsal/mpris/mirsal My plan is to only support that new version of spec, removing all the dbus-related crazyness.
Created attachment 166227 [details] [review] Add support for the MPRIS v2 draft spec This patch adds support for the MPRIS v2 spec draft available at http://www.mpris.org/mirsal/2.0-draft/spec.html The git branch is available in my gitorious clone : http://gitorious.org/~bl8/banshee/bl8-clone/commits/mpris This will be used by the new sound menu in Ubuntu Maverick : https://wiki.ubuntu.com/SoundMenu
I've just committed support for MPRIS v2. Version 2 of the spec was released a few weeks ago at http://www.mpris.org/ I've committed a patch instead of merging my gitorious branch, as most of the changes are about running after changes in the spec drafts, and the rest is me being not so smart.
Great work Bertrand! Thanks for getting this started so long ago, John!