MPRIS is insane. MPRIS is well-thought out. MPRIS is a standard for querying and controlling any media player without having to know the details of each player’s remote interface. MPRIS is now supported by the Now Playing data engine.
All of the above statements are true, to varying degrees.
It’s insane because it uses the same interface name (org.freedesktop.MediaPlayer) for three different interfaces (one for each of the objects /, /Player and /TrackList). This causes havoc with Qt’s D-Bus interface compiler. Luckily, just about everything I need is exported by the /Player part of the interface. Unfortunately, the only way to get the current track number out of Audacious is using the /TrackList object.
It’s well-thought out in most other respects. It has signals for information changes (something missing in Juk’s D-Bus interface). It is generally adaptable to the capabilities of most media players, without going overboard. It has a sane system of informing clients about the capabilities of the player’s interface (such as whether you can skip to the next track, for example), even if Audacious isn’t entirely honest about what is possible.
It’s a universal standard that allows clients to be player-agnostic. Or, at least, that’s the idea. Currently, I can only find one client supporting it: Audacious (although VLC 0.9.0 should include MPRIS support). And Audacious diverges from the standard in a couple of respects, most noticeably in the metadata returned for a track. It doesn’t include the tracknumber (which is optional, but it would be nice if it returned it when it made sense). It uses “length” for the length of the track in seconds, rather than “time”. And, outside the metadata, it claims every action is possible, even when it isn’t, such as stopping when nothing is playing.
The Now Playing applet support MPRIS players. Or, at least, it supports Audacious, which is the only one I’ve tested it with. And it doesn’t give a track number even then. But hey, it’s better than nothing, right? And other players should work “out of the box”, providing they don’t need any hacks like Audacious’ length/time metadata issue.
So: Juk and MPRIS players are supported. Next, I think I’ll steal XMMS support from the Kopete Now Listening plugin.
Incidentally, the player-querying code in the Now Playing engine should be general enough to use with other projects that need to get this information. One possible future change is to make them plugins that can be loaded by anyone who wants them.
PS: Is it me, or are there loads of media players that all seem exactly the same (WinAMP, Audacious, XMMS, Beep)?