use case scenario of Meta::Playlist, including Dynamic

Bart Cerneels bart.cerneels at kde.org
Wed Mar 12 21:04:10 CET 2008


Hi, I'm trying to dump my brain about Meta::Playlist and why I thing Dynamic
Playlists should extend from them.

*A sketch of the Meta::Playlist system*
(if you already know that, jump to the next *bold title*)

facts: Playlists should be saved to SQL and abstraction if good.

Meta::Playlist is the abstract base class. An inheriting class has a
TrackList  + meta data about the playlist itselfs (name, creator, tags,
etc.).

An example:
Meta::Playlist <- PodcastChannel
Meta::Track <- PodcastEpisode

Then there are the regular Playlists
Meta::XSPFPlaylist, Meta::PLSPlaylist, Meta::M3UPlaylist and also
SQLPlaylist.

All these are managed by PlaylistManager. PlaylistManager has Categories: an
integer that describes what kind of playlist it is, the include Categories
are in an enum (PlaylistManager::PlaylistCategory):

   - *UserPlaylist*: user created playlist "My Playlists"
   - *PodcastChannel* ("Podcasts")
   - *Dynamic*
   - *SmartPlaylist*
   - *Custom* (this is used as an offset for scripts and plugins that
   want to create a new PlaylistCategory using
   PlaylistManager::registerCustomCategory())

You'll also see *CurrentPlaylist* in that enum, that is a special type for
the Playlists used in PlaylistModel at any given time (since you can load a
Playlist, in fact more then one). I'm not sure I want to keep that one, it
is kind of specific to something I wanted to do in PlaylistBrowser.

So you see, PlaylistManager gathers Playlists from all over Amarok - core,
plugins and scripts alike - and presents them in a generic way to
PlaylistBrowser, PlaylistModel or any other system then uses Playlists.

*Dynamic Playlists*
Now that you know the Meta::Playlist system, let me tell you how I would
implement dynamic mode.

A DynamicPlaylist would act like a proxy for other Meta::Playlists,
selecting Tracks from them to populate it's own trackList(). DynamicPlaylist
would be the abstract base, possible implementations:

   - LastfmSimilarPlaylist
   - LasftmNeigborsPlaylist (!= neighbors radio)
   - RandomDynamicPlaylist (!= shuffle mode)
   - ScriptableDynamicPlaylist
   - MoodDynamicPlaylist, etc.

each of which responsible for populating them selfs, using various selection
algorithms.

A use case from the last.fm plugin creators view:

   - Populate the similar artist database
   - Add a PlaylistProvider to the PlaylistManager for
   PlaylistManager::Dynamic (PlaylistCategory)

A use case from the users point of view:

   - The user opens the "Dynamic Playlists" tab in the PlaylistBrowser.
   - He clickes the add button to create a new DynamicPlaylist. There are
   several different types, presented in a dialog (created by PlaylistManager).
   He decides to create a "Similar Artists from the Last.fm database"
   Dynamic Playlist.
   - The Dynamic Playlist appears in the PlaylistBrowser and gets loaded
   in the TrackQueue (behind the scenes, the last.fm service plugin
   created a new LastfmSimilarPlaylist and added it to it's PlaylistProvider,
   it didn't show a GUI since it doesn't require any settings to be made by the
   user).
   - Some text in the TrackQueue tells the user that the new Dynamic
   Playlist is empty and that at least one seed track needs to be added.
   - The user realizes that, since the TrackQueue (The Playlist) was
   empty, there were no seed songs to populate the Dynamic Playlist with.
   - The user drags a few songs from a Metal band from the collection to
   the TrackQueue to seed the dynamic playlist. Right after that 5 more tracks
   appear in the TrackList, and they are indeed from other Metal bands.



   - After a few hours of surfing the net while listening to Metal band
   he almost forgot about, he decides to find the oldest songs in his
   collection.
   - He creates a SmartPlaylist for albums from before 1990.
   - It's mostly of poppy 80's music, but he only wants the dark stuff,
   so he drags it over to the Dynamic tab and drops it there.
   - A new dialog asks him what kind of Dynamic Playlist it should be, he
   choices "Dynamic Playlist based on Mood".
   - He drops "Girlfriend in a Coma" from The Smiths onto the "Mood based
   Dynamic Playlist", seeding it to exclude the likes of ABBA.
   - The TrackQueue gets seeded with Tracks from Joy Devision, The Cure,
   Depeche Mode and others.

After our melancholic user restarts his computer the DynamicPlaylist that
was active the night before gets loaded again and is ready to be continued.
He liked last nights queue very much and decides to save it to an XSPF file
to sync with his media player later. Who needs a DJ when you got Amarok's
Dynamic Playlists.

Bart
P.S. sorry about the HTML mail, but I needed some markup to get my point
across.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/amarok-devel/attachments/20080312/f22e84f2/attachment-0001.html 


More information about the Amarok-devel mailing list