oopapidocs  2.0
PlayListDb Class Reference

Provides/manages tables of playlists stored in SQL database. More...

#include <playlistdb.h>

List of all members.

Public Slots

bool addFile (QString playList, QString path, bool replace=false)
 Creates the table if necessary.
bool removeFile (QString playList, QString path)
 Removes a song from a playlist.
bool removeEntry (QString playList, int pid)
 Remove an entry by pid instead of fileName)

Public Member Functions

QStringList playList (QString playListName)
QStringList playLists () const
QString takeFirst (QString playListName)
 Returns and removes the first item from the playlist.
QString last (QString playListName)
 Returns the last track added to this playlist.
void loadAndStore (QString fileName, QString playListName)
 Loads a playlist from an m3u file, and stores it in the database.
void rename (QString oldName, QString newName)
 Renames a playlist / table.
bool clear (QString playListName)
 Clear a playlist.

Static Public Member Functions

static QString tableName (QString playListName)

Detailed Description

Provides/manages tables of playlists stored in SQL database.

Tested on MySQL and SQLite.

Definition at line 13 of file playlistdb.h.


Member Function Documentation

bool PlayListDb::addFile ( QString  playList,
QString  path,
bool  replace = false 
) [slot]

Creates the table if necessary.

Adds metadata to Mp3FileDb if necessary.

Parameters:
playListname of playlist.
replaceif true, will remove previous entries with same path, enforcing an exclusive add. Useful for history.

Definition at line 151 of file playlistdb.cpp.

References MetaDataTable::hasMetaData(), removeFile(), and tableName().

Referenced by loadAndStore(), and rename().

Here is the call graph for this function:

QStringList PlayListDb::playList ( QString  playListName)
Returns:
list of fileNames in a named playlist

Definition at line 62 of file playlistdb.cpp.

References tableName().

Referenced by rename().

Here is the call graph for this function:

QStringList PlayListDb::playLists ( ) const
Returns:
list of playlists

Definition at line 51 of file playlistdb.cpp.

QString PlayListDb::tableName ( QString  playListName) [static]
Returns:
the SQL table name corresponding to this playlist

Definition at line 96 of file playlistdb.cpp.

Referenced by addFile(), clear(), last(), playList(), removeEntry(), removeFile(), rename(), and takeFirst().

QString PlayListDb::takeFirst ( QString  playListName)

Returns and removes the first item from the playlist.

Used for handling the play queue

Definition at line 76 of file playlistdb.cpp.

References removeFile(), and tableName().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Enumerations