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);
82 void updateMetaData(const TrackInfo &info);
90 QString groupName() const override;
94 bool isGroup() const override;
98 int trackIndex() const override;
102 int queuedIndex() const;
106 bool isQueued() const;
116 void endUsage();
129 bool isUsed() const;
130
131private:
132 void formatTitle(int column) const;
133 void formatGroup() const;
134 mutable QStringList m_formattedTitles;
135 mutable QString m_formattedLength;
136 mutable QString m_group;
137 mutable QStringList m_titleFormats;
138 mutable QString m_groupFormat;
139 QmmpUiSettings *m_settings;
140 int m_refCount = 0;
141 bool m_sheduledForDeletion = false;
142 MetaDataHelper *m_helper;
143 friend class PlayListContainer;
144 friend class NormalContainer;
145 friend class GroupedContainer;
146 int m_queued_index = -1;
147 int m_track_index = -1;
148
149};
150
151#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()
QString groupName() const override
bool isUsed() const
bool isGroup() const override
virtual ~PlayListTrack()
int trackIndex() const override
bool isSheduledForDeletion() const
void updateMetaData(const TrackInfo &info)
void updateMetaData(const TrackInfo *info)
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