Talk:Developer Corner

Erik Massop edited this page Nov 4, 2017 · 1 revision

What is a playlist ?

A playlist is an ordered collection of media data and their metadata. A playlist should provide a way to:

  • add track;
  • remove track;
  • remove multiple tracks;
  • add multiple tracks;
  • move a collection item after/before a specified item;
  • move a collection item relatively to its position;
  • clear the whole list;
  • provide the current position in the list;
  • set the current position in the list;
  • provide the next collection item as specified by a scheme (none, repeat_all, repeat_one, shuffle, shuffle_repeat).
  • save itself;
  • add items from a playlist;
  • sort the item as specified by a metadata field;
  • reverse itself.

How to (How we want to) implement a playlist ?

A playlist can be implemented as a tracklist (doubly linked list of items). It could also be a doubly linked ring of items (a list without beginning/end. An item is the association of a media track and it's metadata. Here's the BNF:

:: ::|() :: ::[ogg]|[mp3]|[ice]|[wave]|... ::[filename][trackname][author][albumname]...

The best would probably be to have playlist plugins to have multiple playlist models available for the user, so if we want we could make an external lib (a playlist manager lib) that could place the playlist in shared memory to be able to share that playlist with other players so that we have a standard playlist for all applications. weird ... Anyway these are just ideas, but I think the playlist should at least be redesign to have all the above requirements. (which are mostly what xmms present to the user). When someone ask for shuffle mode, we dont want the nicely sorted playlist to be shuffled and we want every song to be played only once. To achive this goal we can copy the playlist into a new one that we will shuffle than we'll keep on listing the original list but play through the shuffled one. To manage this, we'll need another level in the playlist, a playlist interface. The playlist interface should know if it is in shuffle or in normal mode and direct the call to the right object.

Here's a little schemas:

            +-------------------+             | PlaylistInterface |             +-------------------+             |                   | +------------------+     +------------------+ | OriginalPlaylist |     | ShuffledPlaylist | +------------------+     +------------------+

So please add your ideas and comments about the playlist before someone redesign the whole thing.

A comment on the original/shuffled playlists

It's a great idea to have the playlist revert to the original ordering when shuffled mode is unselected. There might be an easier way to achieve this than keeping two incarnations of the same playlist, however. An alternative idea is to keep the order of the playlist structure, and add an additional pointer which, when set, redefines the order in which one would read the list. Conceptually, a list item could look similar to this:

+----------------------------------------------------------------------------------------------------------+ | item *next | string url | string artist | string album | string title | int length | item *shuffled_next | +----------------------------------------------------------------------------------------------------------+

Idea: Why not use a stack for the already played songs and determine for an unplayed song on demand. After all we don't need to know the next song on advance, we only need to know the already played songs.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.