#include <playlistmodel.h>
List of all members.
Public Types |
enum | SortMode {
TITLE,
ALBUM,
DISCNUMBER,
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
|
DISCNUMBER |
by discnumber
|
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
Adds item to the playlist.
Adds a list of items to the playlist.
- Parameters:
-
void add |
( |
const QString & |
path | ) |
[slot] |
Adds a list of files and directories to the playlist
- Parameters:
-
path | Full path of file or directory. |
void add |
( |
const QStringList & |
paths | ) |
[slot] |
Adds a list of files and directories to the playlist
- Parameters:
-
paths | Full paths of files and directories. |
Adds/removes selected items to/from playback queue.
Removes all items from queue.
Returns true if the playlist contains an item with URL url; otherwise returns false.
Emitted when current item has changed.
Returns the current item.
Emits update signals manually.
Returns number of first item that selected lower the row item.
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. |
Inverts selection (selects unselected items and unselects selected items)
Returns true if play queue is empty,otherwise returns - false.
Returns true if the file loader thread is active; otherwise returns false.
Returns true if f file is in play queue, otherwise returns false.
Returns state of "Repeat All" option.
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. |
Emitted when playlist loader thread has finished.
Loads playlist with f_name name.
Moves the item at index position from to index position to.
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.
Prepares model for shuffle playing. yes parameter is true - model iterates in repeat mode.
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
Randomly changes items order.
Removes items with i index.
Removes duplicate items by URL.
Removes invalid items from playlist
Removes item item from playlist
Removes unselected items.
Returns the row of the item
Saves current songs to the playlist with f_name name.
Returns list with selected rows indexes.
Sets current row number. Returns false if item with this number doesn't exist, otherwise returns true
- Parameters:
-
Sets current item to item. Returns true if success, otherwise returns false
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.
Sets the selected state of the item to select
- Parameters:
-
row | Number of item. |
selected | Selection state (true - select, false - unselect) |
Shows details for the first selected item.
- Parameters:
-
void sort |
( |
int |
mode | ) |
[slot] |
Sorts items in mode sort mode.
Sorts selected items in mode sort mode.
Toggles 'stop after selected' feature.
Returns total lenght in seconds of all songs.
The documentation for this class was generated from the following file: