20 #ifndef PLAYLISTMODEL_H 21 #define PLAYLISTMODEL_H 25 #include <QStringList> 31 #include "playlistitem.h" 32 #include "playlisttrack.h" 33 #include "playlistgroup.h" 34 #include "qmmpui_export.h" 40 class PlayListContainer;
120 QString name()
const;
124 void setName(
const QString &name);
132 int trackCount()
const;
136 bool isEmpty()
const;
140 int columnCount()
const;
168 int currentIndex()
const;
174 bool setCurrent (
int index);
184 bool isTrack(
int index)
const;
189 bool isGroup(
int index)
const;
193 bool isSelected(
int index)
const;
199 void setSelected(
int index,
bool selected =
true);
205 void setSelected(QList<PlayListTrack *> tracks,
bool selected =
true);
211 void setSelected(QList<PlayListItem *> items,
bool selected =
true);
218 void setSelected(
int first,
int last,
bool selected =
true);
224 void setSelected(QList<int> indexes,
bool selected =
true);
240 QList<PlayListItem *> mid(
int pos,
int count = -1)
const;
244 void moveItems(
int from,
int to);
252 bool isEmptyQueue()
const;
260 int queueSize()
const;
273 QList<int> selectedIndexes()
const;
277 QList<PlayListTrack *> selectedTracks()
const;
281 QList<PlayListItem*> items()
const;
285 int firstSelectedUpper(
int row);
289 int firstSelectedLower(
int row);
293 int totalDuration()
const;
297 void loadPlaylist(
const QString& f_name);
303 void loadPlaylist(
const QString &fmt,
const QByteArray &data);
307 void savePlaylist(
const QString& f_name);
311 bool isLoaderRunning()
const;
315 bool contains(
const QString &url);
338 int indexOfTrack(
int index)
const;
348 QList<PlayListItem *> findTracks(
const QString &str)
const;
367 void listChanged(
int flags);
377 void nameChanged(
const QString& name);
381 void loaderFinished();
385 void scrollToRequest(
int index);
391 void sortingByColumnFinished(
int column,
bool reverted);
402 void add(QList <PlayListTrack *> tracks);
407 void add(
const QString &path);
412 void add(
const QStringList &paths);
424 void insert(
int index, QList <PlayListTrack *> tracks);
428 void insert(
PlayListItem *before, QList <PlayListTrack *> tracks);
434 void insert(
int index,
const QString &path);
440 void insert(
int index,
const QStringList &paths);
446 void insert(
int index,
const QList<QUrl> &urls);
454 void clearSelection();
458 void removeSelected();
462 void removeUnselected();
466 void removeTrack (
int i);
474 void invertSelection();
483 void showDetails(QWidget *parent = 0);
488 void showDetailsForCurrent(QWidget *parent = 0);
492 void doCurrentVisibleRequest();
496 void scrollTo(
int index);
500 void randomizeList();
508 void sortSelection(
int mode);
516 void sortByColumn(
int column);
528 void removeInvalidTracks();
532 void removeDuplicates();
544 void stopAfterSelected();
548 void rebuildGroups();
552 void updateMetaData();
558 int topmostInSelection(
int);
562 int bottommostInSelection(
int);
567 void removeSelection(
bool inverted =
false);
569 int removeTrackInternal(
int i);
575 void preparePlayState();
579 void prepareForShufflePlaying(
bool yes);
584 void prepareGroups(
bool enabled);
586 void onTaskFinished();
593 QQueue <PlayListTrack*> m_queued_songs;
594 PlayState* m_play_state;
595 qint64 m_total_duration;
596 FileLoader *m_loader;
598 PlayListContainer *m_container;
600 PlayListTask *m_task;
The PlayListModel class provides a data model for the playlist.
Definition: playlistmodel.h:103
Definition: playlistmodel.h:322
The PlayListItem class provides an item for use with the PlayListModel class.
Definition: playlistitem.h:31
Definition: playlistmodel.h:330
int m_top
Definition: playlistmodel.h:80
int count() const
Definition: playlistmodel.h:75
Definition: playlistmodel.h:326
Definition: playlistmodel.h:324
Definition: playlistmodel.h:323
int m_bottom
Definition: playlistmodel.h:79
Helper class that keeps track of a view's selected items.
Definition: playlistmodel.h:48
UpdateFlags
Definition: playlistmodel.h:352
SimpleSelection()
Definition: playlistmodel.h:53
Definition: playlistmodel.h:328
The PlayListTrack class provides a group for use with the PlayListModel class.
Definition: playlistgroup.h:33
bool isValid() const
Definition: playlistmodel.h:61
QList< int > m_selected_indexes
Definition: playlistmodel.h:81
Definition: playlistmodel.h:325
void dump() const
Definition: playlistmodel.h:68
Definition: playlistmodel.h:329
The QmmpUiSettings class provides access to global libqmmpui library settings.
Definition: qmmpuisettings.h:36
The PlayListTrack class provides a track for use with the PlayListModel class.
Definition: playlisttrack.h:36
Definition: playlistmodel.h:331
SortMode
Definition: playlistmodel.h:319
Definition: playlistmodel.h:327