PlayListModel Class Reference
The
PlayListModel class provides a data model for the playlist.
More...
#include <playlistmodel.h>
List of all members.
|
Public Types |
enum | SortMode {
TITLE,
ALBUM,
ARTIST,
FILENAME,
PATH_AND_FILENAME,
DATE,
TRACK
} |
Public Slots |
void | add (PlayListItem *item) |
void | add (QList< PlayListItem * > items) |
void | add (const QString &path) |
void | add (const QStringList &paths) |
void | clear () |
void | clearSelection () |
void | removeSelected () |
void | removeUnselected () |
void | removeAt (int i) |
void | removeItem (PlayListItem *item) |
void | invertSelection () |
void | selectAll () |
void | showDetails (QWidget *parent=0) |
void | doCurrentVisibleRequest () |
void | randomizeList () |
void | reverseList () |
void | prepareForShufflePlaying (bool yes) |
void | prepareForRepeatablePlaying (bool) |
void | sortSelection (int mode) |
void | sort (int mode) |
void | addToQueue () |
void | setQueued (PlayListItem *f) |
void | removeInvalidItems () |
void | removeDuplicates () |
void | clearQueue () |
void | stopAfterSelected () |
Signals |
void | listChanged () |
void | currentChanged () |
void | itemAdded (PlayListItem *item) |
void | nameChanged (const QString &name) |
void | loaderFinished () |
Public Member Functions |
| PlayListModel (const QString &name, QObject *parent=0) |
| ~PlayListModel () |
QString | name () const |
void | setName (const QString &name) |
int | count () |
PlayListItem * | currentItem () |
PlayListItem * | nextItem () |
int | row (PlayListItem *item) const |
PlayListItem * | item (int row) const |
int | currentRow () |
bool | setCurrent (int row) |
bool | setCurrent (PlayListItem *item) |
bool | isSelected (int row) |
void | setSelected (int row, bool selected=true) |
bool | next () |
bool | previous () |
QStringList | getTitles (int first, int last) |
QStringList | getTimes (int first, int last) |
void | moveItems (int from, int to) |
bool | isQueued (PlayListItem *item) const |
void | setCurrentToQueued () |
bool | isEmptyQueue () const |
int | queuedIndex (PlayListItem *item) const |
int | queueSize () const |
bool | isStopAfter (PlayListItem *item) const |
const SimpleSelection & | getSelection (int row) |
QList< int > | selectedRows () const |
QList< PlayListItem * > | selectedItems () const |
QList< PlayListItem * > | items () const |
int | firstSelectedUpper (int row) |
int | firstSelectedLower (int row) |
int | totalLength () const |
void | loadPlaylist (const QString &f_name) |
void | savePlaylist (const QString &f_name) |
bool | isRepeatableList () const |
bool | isShuffle () const |
bool | isLoaderRunning () const |
bool | contains (const QString &url) |
Detailed Description
The
PlayListModel class provides a data model for the playlist.
- Author:
- Vladimir Kuznetsov <vovanec@gmail.com>
Ilya Kotov <forkotov02@hotmail.ru>
Member Enumeration Documentation
Enum of available sort modes
- Enumerator:
-
TITLE |
by title |
ALBUM |
by album |
ARTIST |
by artist |
FILENAME |
by file name |
PATH_AND_FILENAME |
by path and file name |
DATE |
by date |
TRACK |
by track |
Constructor & Destructor Documentation
Constructs a playlist model.
- Parameters:
-
| name | Playlist name. |
| parent | QObject parent |
Member Function Documentation
void add |
( |
const QStringList & |
paths |
) |
[slot] |
Adds a list of files and directories to the playlist
- Parameters:
-
| paths | Full paths of files and directories. |
void add |
( |
const QString & |
path |
) |
[slot] |
Adds a list of files and directories to the playlist
- Parameters:
-
| path | Full path of file or directory. |
Adds a list of items to the playlist.
- Parameters:
-
Adds item to the playlist.
void addToQueue |
( |
|
) |
[slot] |
Adds/removes selected items to/from playback queue.
void clearQueue |
( |
|
) |
[slot] |
Removes all items from queue.
void clearSelection |
( |
|
) |
[slot] |
bool contains |
( |
const QString & |
url |
) |
|
Returns true if the playlist contains an item with URL url; otherwise returns false.
void currentChanged |
( |
|
) |
[signal] |
Emitted when current item has changed.
Returns the current item.
void doCurrentVisibleRequest |
( |
|
) |
[slot] |
Emits update signals manually.
int firstSelectedLower |
( |
int |
row |
) |
|
Returns number of first item that selected lower the row item.
int firstSelectedUpper |
( |
int |
row |
) |
|
Returns number of first item that selected upper the row item.
Returns current selection(playlist can contain a lot of selections, this method returns selection which row belongs to)
QStringList getTimes |
( |
int |
first, |
|
|
int |
last | |
|
) |
| | |
Returns a list of the formatted durations.
- Parameters:
-
| first | First item. |
| last | Last item. |
QStringList getTitles |
( |
int |
first, |
|
|
int |
last | |
|
) |
| | |
Returns a list of the formated titles.
- Parameters:
-
| first | First item. |
| last | Last item. |
void invertSelection |
( |
|
) |
[slot] |
Inverts selection (selects unselected items and unselects selected items)
bool isEmptyQueue |
( |
|
) |
const |
Returns true if play queue is empty,otherwise returns - false.
bool isLoaderRunning |
( |
|
) |
const |
Returns true if the file loader thread is active; otherwise returns false.
Returns true if f file is in play queue, otherwise returns false.
bool isRepeatableList |
( |
|
) |
const |
Returns state of "Repeat All" option.
bool isSelected |
( |
int |
row |
) |
|
Returns true if row is selected, otherwise returns false
Returns state of "Shuffle" option.
Returns true if playback stops after item, otherwise returns false.
Returns the item of the row or 0 if item doesn't exist.
Emitted when new item has added.
- Parameters:
-
| item | New playlist item pointer. |
void listChanged |
( |
|
) |
[signal] |
void loaderFinished |
( |
|
) |
[signal] |
Emitted when playlist loader thread has finished.
void loadPlaylist |
( |
const QString & |
f_name |
) |
|
Loads playlist with f_name name.
void moveItems |
( |
int |
from, |
|
|
int |
to | |
|
) |
| | |
Moves the item at index position from to index position to.
void nameChanged |
( |
const QString & |
name |
) |
[signal] |
Emitted when playlist name has chanded.
- Parameters:
-
Advances to the next item. Returns false if next iten doesn't exist, otherwise returns true
Returns the next playing item or 0 if next item is unknown.
void prepareForRepeatablePlaying |
( |
bool |
|
) |
[slot] |
Prepares model for shuffle playing. yes parameter is true - model iterates in repeat mode.
void prepareForShufflePlaying |
( |
bool |
yes |
) |
[slot] |
Prepares model for shuffle playing. yes parameter is true - model iterates in shuffle mode.
Goes back to the previous item. Returns false if previous iten doesn't exist, otherwise returns true
Returns index of f file in queue.e
Returns the number of items in the queue
void randomizeList |
( |
|
) |
[slot] |
Randomly changes items order.
void removeAt |
( |
int |
i |
) |
[slot] |
Removes items with i index.
void removeDuplicates |
( |
|
) |
[slot] |
Removes duplicate items by URL.
void removeInvalidItems |
( |
|
) |
[slot] |
Removes invalid items from playlist
Removes item item from playlist
void removeSelected |
( |
|
) |
[slot] |
void removeUnselected |
( |
|
) |
[slot] |
Removes unselected items.
void reverseList |
( |
|
) |
[slot] |
Returns the row of the item
void savePlaylist |
( |
const QString & |
f_name |
) |
|
Saves current songs to the playlist with f_name name.
void selectAll |
( |
|
) |
[slot] |
QList<int> selectedRows |
( |
|
) |
const |
Returns list with selected rows indexes.
Sets current item to item. Returns true if success, otherwise returns false
bool setCurrent |
( |
int |
row |
) |
|
Sets current row number. Returns false if item with this number doesn't exist, otherwise returns true
- Parameters:
-
void setCurrentToQueued |
( |
|
) |
|
Sets current song to the file that is nex in queue, if queue is empty - does nothing
void setName |
( |
const QString & |
name |
) |
|
Sets the name of the playlist to name.
Adds/removes media file f to/from playback queue.
void setSelected |
( |
int |
row, |
|
|
bool |
selected = true | |
|
) |
| | |
Sets the selected state of the item to select
- Parameters:
-
| row | Number of item. |
| select | Selection state (true - select, false - unselect) |
void showDetails |
( |
QWidget * |
parent = 0 |
) |
[slot] |
Shows details for the first selected item.
- Parameters:
-
void sort |
( |
int |
mode |
) |
[slot] |
Sorts items in mode sort mode.
void sortSelection |
( |
int |
mode |
) |
[slot] |
Sorts selected items in mode sort mode.
void stopAfterSelected |
( |
|
) |
[slot] |
Toggles 'stop after selected' feature.
int totalLength |
( |
|
) |
const [inline] |
Returns total lenght in seconds of all songs.
The documentation for this class was generated from the following file: