[GSoC] UML of PlaySong functionality for MprisPlayer plug-in

Peter Grasch peter at grasch.net
Sat Jun 28 10:40:39 UTC 2014


Hi,

On Saturday, June 28, 2014 01:48:38 PM you wrote:
> > That would be my rough suggestion.
> > But as every player will have multiple playlists, I think it does make
> > sense to also have a Playlist class that contains the actual track and
> > have the player manage it's playlists. That way you closely resemble the
> > actual situation and this should make it very easy to correctly associate
> > and process the update signals.
> 
> Every player may have multiple playlists, but through MPRIS Tracklist
> interface, we can only access a *single* playlist (or depending on the
> implementation, only a small part of the current playlist) at a time. So,
> imho we do not need a Playlist class as we only have one playlist.
http://specifications.freedesktop.org/mpris-spec/latest/Playlists_Interface.html#Method:GetPlaylists ?

You are working with the tracklist interface, not the playlist interface, 
right? Okay, in that case it make sense to have the list right in the player.
Don't call them "playlist" then, please.

> >> No, user need not know track id. I think I couldn't explain it. "X" is
> >> still title
> > 
> > Yes. But how and where are you planning to resolve "X" to the track id?
> 
> I can have a class PlayerItem (crappy name, maybe PlaylistItem or MediaItem,
> do suggest) which will store the title and trackId of song (and I think if
> need arises in future we can even have other metadata in the class).
> Another solution, I can have a mapping from trackID to title in the Player
> class. Which one will be better? Or do we have a better alternative?
Well, I would have suggested "Track" but "MediaItem" is actually more generic 
given that we could also be talking about video clips. So let's go with that.

I don't quite understand how you mean those are two separate approaches, I 
would do both: Hold the objects representing tracks in the player class and 
manage them there. When you get "Play X", tell the command manager to play 
"X", which should then tell all the players. They can then look through their 
track lists, find matching tracks and start playing.

Best regards,
Peter


More information about the Kde-speech mailing list