Qmmp
playlistcontainer_p.h
1 /***************************************************************************
2  * Copyright (C) 2013-2015 by Ilya Kotov *
3  * forkotov02@ya.ru *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 
21 #ifndef PLAYLISTCONTAINER_P_H
22 #define PLAYLISTCONTAINER_P_H
23 
24 #include <QList>
25 #include "playlistitem.h"
26 #include "playlisttrack.h"
27 #include "playlistgroup.h"
28 
29 
35 class PlayListContainer
36 {
37 public:
38  PlayListContainer(){}
39  virtual ~PlayListContainer(){}
40 
41  virtual void addTrack(PlayListTrack *track);
42  virtual void addTracks(QList<PlayListTrack *> tracks) = 0;
43  virtual void insertTrack(int index, PlayListTrack *track) = 0;
44  virtual void replaceTracks(QList<PlayListTrack *> tracks) = 0;
45  virtual QList<PlayListGroup *> groups() const = 0;
46  virtual QList<PlayListItem *> items() const = 0;
47  virtual QList<PlayListTrack *> tracks() const = 0;
48  virtual int count() const = 0;
49  virtual int trackCount() const = 0;
50  virtual QList<PlayListItem *> mid(int pos, int count) const = 0;
51  virtual bool isEmpty() const = 0;
52  virtual bool isSelected(int index) const = 0;
53  virtual void setSelected(int index, bool selected) = 0;
54  virtual void clearSelection() = 0;
55  virtual int indexOf(PlayListItem *item) const = 0;
56  virtual PlayListItem *item(int index) const = 0;
57  virtual PlayListTrack *track(int index) const = 0;
58  virtual PlayListGroup *group(int index) const = 0;
59  virtual bool contains(PlayListItem *item) const = 0;
60  virtual int indexOfTrack(int index) const = 0;
61  virtual PlayListTrack *findTrack(int number) const = 0;
62  virtual void removeTrack(PlayListTrack *track) = 0;
63  virtual void removeTracks(QList<PlayListTrack *> tracks) = 0;
64  virtual bool move(QList<int> indexes, int from, int to) = 0;
65  virtual QList<PlayListTrack *> takeAllTracks() = 0;
66  virtual void clear() = 0;
67 
68  virtual void reverseList() = 0;
69  virtual void randomizeList() = 0;
70 
71 protected:
72  void swapTrackNumbers(QList<PlayListItem *> *container, int index1, int index2);
73 };
74 
75 #endif // PLAYLISTCONTAINER_P_H
The PlayListItem class provides an item for use with the PlayListModel class.
Definition: playlistitem.h:31
The PlayListTrack class provides a group for use with the PlayListModel class.
Definition: playlistgroup.h:33
The PlayListTrack class provides a track for use with the PlayListModel class.
Definition: playlisttrack.h:36