Qmmp
Loading...
Searching...
No Matches
playlisttrack.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#ifndef PLAYLISTTRACK_H
21#define PLAYLISTTRACK_H
22
23#include <QStringList>
24#include <qmmp/qmmp.h>
25#include <qmmp/trackinfo.h>
26#include "playlistitem.h"
27#include "qmmpui_export.h"
28
29class QmmpUiSettings;
31class MetaDataHelper;
32
36class QMMPUI_EXPORT PlayListTrack : public TrackInfo, public PlayListItem
37{
38public:
46 explicit PlayListTrack(const PlayListTrack &other);
55 virtual ~PlayListTrack();
64 QString formattedTitle(int column) const override;
68 QStringList formattedTitles() const override;
72 QString formattedDuration() const override;
77 void updateMetaData(const TrackInfo *info);
85 const QString &groupName();
89 bool isGroup() const override;
93 int trackIndex() const override;
97 int queuedIndex() const;
101 bool isQueued() const;
111 void endUsage();
124 bool isUsed() const;
125
126private:
127 void formatTitle(int column) const;
128 void formatGroup() const;
129 mutable QStringList m_formattedTitles;
130 mutable QString m_formattedLength;
131 mutable QString m_group;
132 mutable QStringList m_titleFormats;
133 QString m_groupFormat;
134 QmmpUiSettings *m_settings;
135 int m_refCount = 0;
136 bool m_sheduledForDeletion = false;
137 MetaDataHelper *m_helper;
138 friend class PlayListContainer;
139 friend class NormalContainer;
140 friend class GroupedContainer;
141 int m_queued_index = -1;
142 int m_track_index = -1;
143
144};
145
146#endif
Helper class that provides access to playlist column configuration.
Definition playlistheadermodel.h:39
PlayListTrack & operator=(const PlayListTrack &other)
PlayListTrack(const TrackInfo *info)
PlayListTrack(const PlayListTrack &other)
bool isQueued() const
QStringList formattedTitles() const override
int queuedIndex() const
void updateMetaData()
void beginUsage()
bool isUsed() const
bool isGroup() const override
virtual ~PlayListTrack()
int trackIndex() const override
bool isSheduledForDeletion() const
void updateMetaData(const TrackInfo *info)
const QString & groupName()
void deleteLater()
QString formattedTitle(int column) const override
QString formattedDuration() const override
The QmmpUiSettings class provides access to global libqmmpui library settings.
Definition qmmpuisettings.h:36