Qmmp
Loading...
Searching...
No Matches
playlistgroup.h
1/***************************************************************************
2 * Copyright (C) 2013-2025 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 PLAYLISTGROUP_H
22#define PLAYLISTGROUP_H
23
24#include <QImage>
25#include "playlisttrack.h"
26#include "playlistitem.h"
27#include "qmmpui_export.h"
28
29class GroupedContainer;
30class QmmpUiSettings;
31class MetaDataHelper;
32
36class QMMPUI_EXPORT PlayListGroup : public PlayListItem
37{
38public:
43 explicit PlayListGroup(const QString &formattedTitle);
47 virtual ~PlayListGroup();
52 QString formattedTitle(int line = 0) const override;
56 QStringList formattedTitles() const override;
61 bool contains(PlayListTrack *track) const;
66 bool isEmpty() const;
70 QList<PlayListTrack *> tracks() const;
74 int count() const;
78 QString formattedDuration() const override;
82 bool isGroup() const override;
86 QString firstTrackPath() const;
90 bool isCoverLoaded() const;
94 QImage cover() const override;
98 void setCover(const QImage &cover);
99
100private:
101 QString formatTitle2() const;
102
103 QList<PlayListTrack *> m_trackList; //A list of tracks
104 QString m_title;
105 mutable QString m_title2;
106
107 bool m_isCoverLoaded = false;
108 QImage m_cover;
109
110 QmmpUiSettings *m_settings;
111 MetaDataHelper *m_helper;
112
113 friend class GroupedContainer;
114};
115
116#endif // PLAYLISTGROUP_H
int count() const
bool isCoverLoaded() const
QStringList formattedTitles() const override
virtual ~PlayListGroup()
void setCover(const QImage &cover)
QImage cover() const override
QString formattedTitle(int line=0) const override
bool isGroup() const override
bool contains(PlayListTrack *track) const
QList< PlayListTrack * > tracks() const
bool isEmpty() const
PlayListGroup(const QString &formattedTitle)
QString firstTrackPath() const
QString formattedDuration() const override
The PlayListTrack class provides a track for use with the PlayListModel class.
Definition playlisttrack.h:37
The QmmpUiSettings class provides access to global libqmmpui library settings.
Definition qmmpuisettings.h:36