20 #ifndef PLAYLISTMODEL_H 21 #define PLAYLISTMODEL_H 25 #include <QStringList> 30 #include "playlistitem.h" 31 #include "playlisttrack.h" 32 #include "playlistgroup.h" 38 class PlayListContainer;
118 QString name()
const;
122 void setName(
const QString &name);
130 int trackCount()
const;
134 bool isEmpty()
const;
138 int columnCount()
const;
166 int currentIndex()
const;
172 bool setCurrent (
int index);
182 bool isTrack(
int index)
const;
187 bool isGroup(
int index)
const;
191 bool isSelected(
int index)
const;
197 void setSelected(
int index,
bool selected =
true);
203 void setSelected(QList<PlayListTrack *> tracks,
bool selected =
true);
209 void setSelected(QList<PlayListItem *> items,
bool selected =
true);
216 void setSelected(
int first,
int last,
bool selected =
true);
222 void setSelected(QList<int> indexes,
bool selected =
true);
238 QList<PlayListItem *> mid(
int pos,
int count = -1)
const;
242 void moveItems(
int from,
int to);
250 bool isEmptyQueue()
const;
258 int queueSize()
const;
271 QList<int> selectedIndexes()
const;
275 QList<PlayListTrack *> selectedTracks()
const;
279 QList<PlayListItem*> items()
const;
283 int firstSelectedUpper(
int row);
287 int firstSelectedLower(
int row);
291 int totalLength()
const;
295 void loadPlaylist(
const QString& f_name);
301 void loadPlaylist(
const QString &fmt,
const QByteArray &data);
305 void savePlaylist(
const QString& f_name);
309 bool isLoaderRunning()
const;
313 bool contains(
const QString &url);
336 int indexOfTrack(
int index)
const;
346 QList<PlayListItem *> findTracks(
const QString &str)
const;
365 void listChanged(
int flags);
375 void nameChanged(
const QString& name);
379 void loaderFinished();
383 void scrollToRequest(
int index);
389 void sortingByColumnFinished(
int column,
bool reverted);
400 void add(QList <PlayListTrack *> tracks);
405 void add(
const QString &path);
410 void add(
const QStringList &paths);
422 void insert(
int index, QList <PlayListTrack *> tracks);
426 void insert(
PlayListItem *before, QList <PlayListTrack *> tracks);
432 void insert(
int index,
const QString &path);
438 void insert(
int index,
const QStringList &paths);
444 void insert(
int index,
const QList<QUrl> &urls);
452 void clearSelection();
456 void removeSelected();
460 void removeUnselected();
464 void removeTrack (
int i);
472 void invertSelection();
481 void showDetails(QWidget *parent = 0);
486 void showDetailsForCurrent(QWidget *parent = 0);
490 void doCurrentVisibleRequest();
494 void scrollTo(
int index);
498 void randomizeList();
506 void sortSelection(
int mode);
514 void sortByColumn(
int column);
526 void removeInvalidTracks();
530 void removeDuplicates();
542 void stopAfterSelected();
546 void rebuildGroups();
550 void updateMetaData();
556 int topmostInSelection(
int);
560 int bottommostInSelection(
int);
565 void removeSelection(
bool inverted =
false);
567 int removeTrackInternal(
int i);
573 void preparePlayState();
577 void prepareForShufflePlaying(
bool yes);
582 void prepareGroups(
bool enabled);
584 void onTaskFinished();
591 QQueue <PlayListTrack*> m_queued_songs;
592 PlayState* m_play_state;
594 FileLoader *m_loader;
596 PlayListContainer *m_container;
598 PlayListTask *m_task;
The PlayListModel class provides a data model for the playlist.
Definition: playlistmodel.h:101
Definition: playlistmodel.h:320
The PlayListItem class provides an item for use with the PlayListModel class.
Definition: playlistitem.h:31
Definition: playlistmodel.h:328
int m_top
Definition: playlistmodel.h:78
int count() const
Definition: playlistmodel.h:73
Definition: playlistmodel.h:324
Definition: playlistmodel.h:322
Definition: playlistmodel.h:321
int m_bottom
Definition: playlistmodel.h:77
Helper class that keeps track of a view's selected items.
Definition: playlistmodel.h:46
UpdateFlags
Definition: playlistmodel.h:350
SimpleSelection()
Definition: playlistmodel.h:51
Definition: playlistmodel.h:326
The PlayListTrack class provides a group for use with the PlayListModel class.
Definition: playlistgroup.h:32
bool isValid() const
Definition: playlistmodel.h:59
QList< int > m_selected_indexes
Definition: playlistmodel.h:79
Definition: playlistmodel.h:323
void dump() const
Definition: playlistmodel.h:66
Definition: playlistmodel.h:327
The QmmpUiSettings class provides access to global libqmmpui library settings.
Definition: qmmpuisettings.h:35
The PlayListTrack class provides a track for use with the PlayListModel class.
Definition: playlisttrack.h:36
Definition: playlistmodel.h:329
SortMode
Definition: playlistmodel.h:317
Definition: playlistmodel.h:325