Qmmp
|
00001 /*************************************************************************** 00002 * Copyright (C) 2013-2015 by Ilya Kotov * 00003 * forkotov02@hotmail.ru * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 00019 ***************************************************************************/ 00020 00021 #ifndef GROUPEDCONTAINER_P_H 00022 #define GROUPEDCONTAINER_P_H 00023 00024 #include "playlistcontainer_p.h" 00025 00030 class GroupedContainer : public PlayListContainer 00031 { 00032 public: 00033 GroupedContainer(); 00034 00035 virtual ~GroupedContainer(); 00036 00037 void addTrack(PlayListTrack *track); 00038 void addTracks(QList<PlayListTrack *> tracks); 00039 void insertTrack(int index, PlayListTrack *track); 00040 void replaceTracks(QList<PlayListTrack *> tracks); 00041 QList<PlayListGroup *> groups() const; 00042 QList<PlayListTrack *> tracks() const; 00043 QList<PlayListItem *> items() const; 00044 int count() const; 00045 int trackCount() const; 00046 QList<PlayListItem *> mid(int pos, int count) const; 00047 bool isEmpty() const; 00048 bool isSelected(int index) const; 00049 void setSelected(int index, bool selected); 00050 void clearSelection(); 00051 int indexOf(PlayListItem *item) const; 00052 PlayListItem *item(int index) const; 00053 PlayListTrack *track(int index) const; 00054 PlayListGroup *group(int index) const; 00055 bool contains(PlayListItem *item) const; 00056 int indexOfTrack(int index) const; 00057 PlayListTrack *findTrack(int number) const; 00058 void removeTrack(PlayListTrack *track); 00059 void removeTracks(QList<PlayListTrack *> tracks); 00060 bool move(QList<int> indexes, int from, int to); 00061 QList<PlayListTrack *> takeAllTracks(); 00062 void clear(); 00063 00064 void reverseList(); 00065 void randomizeList(); 00066 00067 private: 00068 void updateCache() const; 00069 QList<PlayListGroup *> m_groups; 00070 00071 mutable QList<PlayListItem *> m_items; 00072 mutable bool m_update; 00073 00074 }; 00075 00076 #endif // GROUPEDCONTAINER_P_H