Qmmp
playlisttrack.h
1 /***************************************************************************
2  * Copyright (C) 2013-2019 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 
29 class QmmpUiSettings;
31 class MetaDataHelper;
32 
36 class QMMPUI_EXPORT PlayListTrack : public TrackInfo, public PlayListItem
37 {
38 public:
55  virtual ~PlayListTrack();
64  const QString formattedTitle(int column);
68  const QStringList formattedTitles();
72  const QString formattedLength();
77  void updateMetaData(const TrackInfo *info);
85  const QString groupName();
89  bool isGroup() const;
93  void setTrackIndex(int track_index);
98  int trackIndex() const;
103  void beginUsage();
108  void endUsage();
112  void deleteLater();
116  bool isSheduledForDeletion() const;
121  bool isUsed() const;
122 
123 private:
124  void formatTitle(int column);
125  void formatGroup();
126  QStringList m_formattedTitles;
127  QString m_formattedLength;
128  QString m_group;
129  QStringList m_titleFormats;
130  QString m_groupFormat;
131  QmmpUiSettings *m_settings;
132  int m_refCount;
133  int m_track_index;
134  bool m_sheduledForDeletion;
135  MetaDataHelper *m_helper;
136 };
137 
138 #endif
Helper class that provides access to playlist column configuration.
Definition: playlistheadermodel.h:39
The PlayListItem class provides an item for use with the PlayListModel class.
Definition: playlistitem.h:32
The PlayListTrack class provides a track for use with the PlayListModel class.
Definition: playlisttrack.h:37
bool isGroup() const
PlayListTrack(const PlayListTrack &other)
const QStringList formattedTitles()
void updateMetaData()
void beginUsage()
bool isUsed() const
int trackIndex() const
PlayListTrack & operator=(const PlayListTrack &other)
virtual ~PlayListTrack()
bool isSheduledForDeletion() const
const QString formattedTitle(int column)
void updateMetaData(const TrackInfo *info)
const QString formattedLength()
void setTrackIndex(int track_index)
const QString groupName()
void deleteLater()
PlayListTrack(TrackInfo *info)
The QmmpUiSettings class provides access to global libqmmpui library settings.
Definition: qmmpuisettings.h:37
The TrackInfo class stores metadata and other information about track.
Definition: trackinfo.h:32