Playlist: Update doxygen documentation
I also remove the playlist section of the DESIGN document. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
7ec7026863
commit
9cbff6e9a1
82
DESIGN
82
DESIGN
|
@ -66,88 +66,6 @@ Callbacks:
|
|||
|
||||
|
||||
|
||||
Playlist:
|
||||
Playlists are a new feature in Ocarina 6 and are modeled after Gmail
|
||||
labels. Ocarina 6.2 will support two different playlists that the
|
||||
user can add tracks to: banned and favorites.
|
||||
|
||||
The playlist layer will maintain a queue that is used by the UI to
|
||||
display tracks in a given playlist. This queue is inherited from
|
||||
the base Queue class to provide extra features.
|
||||
|
||||
Future releases will add support for more playlists.
|
||||
|
||||
- Index:
|
||||
Index playlist_db("playlist.db", true);
|
||||
|
||||
- Queue:
|
||||
class PlaylistQueue : public Queue {
|
||||
public:
|
||||
PlaylistQueue();
|
||||
fill(IndexEntry *);
|
||||
};
|
||||
|
||||
- Default playlists:
|
||||
Favorites:
|
||||
The user will add music they really like to this playlist.
|
||||
|
||||
Banned:
|
||||
The user should add music they do not like to this playlist.
|
||||
Tracks should be removed from the Library playqueue when they
|
||||
are banned and added back to the playqueue when they are
|
||||
un-banned.
|
||||
|
||||
- PlaylistQueue API:
|
||||
PlaylistQueue :: PlaylistQueue();
|
||||
Initialize a Queue with the flags Q_ENABLED, Q_REPEAT, and
|
||||
Q_NO_SORT set. Default sorting order should be artist, year,
|
||||
track.
|
||||
|
||||
PlaylistQueue :: fill(IndexEntry *ent);
|
||||
Remove all tracks in the queue and repopulate using ent.
|
||||
|
||||
- API
|
||||
void playlist :: init():
|
||||
Load the playlist index from file. Remove every banned song
|
||||
from the LibraryQueue in the library layer.
|
||||
|
||||
void playlist :: add(Track *track, const std::string &name);
|
||||
Add track->id to the playlist named "name" and return true.
|
||||
Return false if the playlist does not exist.
|
||||
|
||||
If "name" is the currently selected playlist, add the track
|
||||
to the PlaylistQueue.
|
||||
|
||||
If "name" is "Banned", remove the track from the LibraryQueue
|
||||
in the library layer.
|
||||
|
||||
void playlist :: del(Track *track, const std::string &name);
|
||||
Remove track->id from the playlist named "name" and return true.
|
||||
Return false if the playlist does not exist or if the track
|
||||
is not in the playlist.
|
||||
|
||||
If "name" is the currently selected playlist, remove the track
|
||||
from the PlaylistQueue.
|
||||
|
||||
If "name" is "Banned", add the track to the LibraryQueue in the
|
||||
library layer.
|
||||
|
||||
bool playlist :: has(Track *track, const std::string &name);
|
||||
Return true if the chosen playlist has the given track.
|
||||
Return false otherwise.
|
||||
|
||||
void playlist :: select(const std::string &name);
|
||||
Change the currently displayed playlist to "name".
|
||||
|
||||
const IndexEntry *playlist :: get_tracks(const std::string &name);
|
||||
Return the IndexEntry represeting the requested playlist.
|
||||
Return NULL if the requested playlist does not exist.
|
||||
|
||||
Queue *playlist :: get_queue();
|
||||
Return the PlaylistQueue to the caller.
|
||||
|
||||
|
||||
|
||||
Deck:
|
||||
The deck is used to hold temporary queues created by the user. This
|
||||
layer is also in charge of maintaining a "recently played" queue of
|
||||
|
|
|
@ -11,13 +11,23 @@
|
|||
#include <string>
|
||||
|
||||
/**
|
||||
* Namespace for accessing playlists.
|
||||
* The playlist namespace is in charge of managing the various playlists
|
||||
* Ocarina knows aboit. It is also in charge of a special queue that the
|
||||
* UI uses to display Tracks in each playlist.
|
||||
*
|
||||
* Currently supported playlists are:
|
||||
*
|
||||
* Name | Description
|
||||
* ----------|------------
|
||||
* Banned | Songs that the user doesn't like.
|
||||
* Favorites | Songs that the user likes.
|
||||
*/
|
||||
namespace playlist
|
||||
{
|
||||
|
||||
/**
|
||||
* Read playlist information from disk.
|
||||
* Read playlist information from disk and removed banned tracks
|
||||
* from the Library queue.
|
||||
*/
|
||||
void init();
|
||||
|
||||
|
@ -33,6 +43,9 @@ namespace playlist
|
|||
/**
|
||||
* Add a track to a playlist.
|
||||
*
|
||||
* Tracks added to the Banned playlist will be removed from
|
||||
* the library queue.
|
||||
*
|
||||
* @param track The track to add.
|
||||
* @param name The name of the playlist to add to.
|
||||
*/
|
||||
|
@ -41,13 +54,16 @@ namespace playlist
|
|||
/**
|
||||
* Remove a track from a playlist.
|
||||
*
|
||||
* Tracks removed from the Banned playlist will be added back
|
||||
* to the library queue.
|
||||
*
|
||||
* @param track The track to remove.
|
||||
* @param name The name of the playlist to remove from.
|
||||
*/
|
||||
void del(Track *, const std::string &);
|
||||
|
||||
/**
|
||||
* Use to change the currently queued playlist.
|
||||
* Use to change the currently displayed playlist.
|
||||
*
|
||||
* @param name The name of the queue to queue up.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue