oopapidocs
2.0
|
Provides/manages tables of playlists stored in SQL database. More...
#include <playlistdb.h>
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) |
Provides/manages tables of playlists stored in SQL database.
Tested on MySQL and SQLite.
Definition at line 13 of file playlistdb.h.
bool PlayListDb::addFile | ( | QString | playList, |
QString | path, | ||
bool | replace = false |
||
) | [slot] |
Creates the table if necessary.
Adds metadata to Mp3FileDb if necessary.
playList | name of playlist. |
replace | if 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().
QStringList PlayListDb::playList | ( | QString | playListName | ) |
Definition at line 62 of file playlistdb.cpp.
References tableName().
Referenced by rename().
QStringList PlayListDb::playLists | ( | ) | const |
Definition at line 51 of file playlistdb.cpp.
QString PlayListDb::tableName | ( | QString | playListName | ) | [static] |
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().