[mpris] MPRIS v2.1

Alex Merry kde at randomguy3.me.uk
Thu Aug 19 12:25:09 CEST 2010


  On 19/08/10 01:01, Lennart Poettering wrote:
> On Wed, 18.08.10 17:48, Alex Merry (kde at randomguy3.me.uk) wrote:
>
>>   The Ubuntu folk want a list of (some of) the playlists available
>> from a media player for their sound menu.  We ditched the version of
>> this in the draft of the spec, because of some scalability problems.
>>
>> I've implemented an optional interface that MPRIS servers can
>> implement, and called the combined thing mpris v2.1 (which is
>> obviously completely compatible with v2.0).
>>
>> The spec is at http://www.randomguy3.me.uk/mpris, and the relevant
>> interface is http://www.randomguy3.me.uk/mpris/Playlists.html.
> "Playlists" vs. "TrackList" is weird. Isn't "playlist" and "tracklist"
> kinda the same thing? Shouldn't this be "TrackList" and
> "TrackListManager" or so? Or "TrackListEnumerator"?

Well, no.  It's not a "manager" (that's why I didn't call it 
PlaylistManager), and the TrackList interface is explicitly designed to 
provide some context to the current track.  For reasons you've already 
raised (including scalability), it doesn't work for arbitrary 
playlists.  And it also doesn't necessarily work for dynamic playlists, 
for example.


> but tbh i find the whole object model flawed if you take multiple
> playlists into account. Because then you want multiple objects which
> implement TrackList and a root object which allows you to find the
> various TrackList objects.

Well, as I said above, we _don't_ want playlists to implement the 
TrackList interface, unless they're just going to expose a part of the 
playlist (and then which part?).  And what's the point, unless you're 
going to provide editing capabilities?

>> Note that, since D-Bus doesn't have a way of getting a list of
>> implemented interfaces (other than parsing the introspection), the
>> only way to check for this interface is to try to get a property on
>> it.  We could introduce a property on the root interface that gives
>> a list of implemented interfaces (like telepathy does), or we could
>> just leave it like it is and push the D-Bus guys to provide a way to
>> list interfaces.
> Why not add HasTrackListEnumerator akin to HasTrackList?

Well, that property would still most likely not exist in the case that 
the media player doesn't implement the interface.  For QtDBus, that's 
not an issue, I guess, as an invalid boolean property will be cast to 
false.  I don't know how GLib/GIO works on that front, though.

Alex




More information about the mpris mailing list