Revision 604494

Go back to digest for 19th November 2006

Other in Multimedia

Seb Ruiz committed changes in /trunk/extragear/multimedia/amarok/src:

Refactor of dynamic mode. This revised implementation solves a number of bugs. The logic of adding tracks from a dynamic mode is now delegated to the DynamicMode object, and is not done within the playlist. When a dynamic mode is loaded, a cache of 200 elements is create from the playlist sources.

By caching a subset of the possible tracks to be inserted, there is no longer a requirement to execute complex SQL statements on each track change or playlist repopulation. Additionally, by grabbing random tracks from this cache, items are no longer fetched from just one source, but all of them.

Once these cached tracks have been inserted into the playlist, they are removed from the cache list in order to avoid duplicating song insertions. Once the cache has been depleted, it is simply regenerated. 200 elements is approximately 12 hours worth of music, so the set should be sufficiently large to handle the user's requirements.

I've done quite a bit of regression testing, but the more the merrier :). The only feature which needs to be fixed is the Suggested mode of dynamic playlists, but this should be easily rectifiable.

File Changes

Modified 5 files
  • /trunk/extragear/multimedia/amarok/src
  •   /dynamicmode.cpp
  •   /dynamicmode.h
  •   /playlist.cpp
  •   /playlist.h
  •   /playlistbrowser.cpp
5 files changed in total