TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicsongmeta.h
Go to the documentation of this file.
1 #ifndef MUSICSONGMETA_H
2 #define MUSICSONGMETA_H
3 
4 /***************************************************************************
5  * This file is part of the TTK Music Player project
6  * Copyright (C) 2015 - 2026 Greedysky Studio
7 
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or
11  * (at your option) any later version.
12 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17 
18  * You should have received a copy of the GNU General Public License along
19  * with this program; If not, see <http://www.gnu.org/licenses/>.
20  ***************************************************************************/
21 
22 #include "musicglobaldefine.h"
23 #include <qmmp/tagmeta.h>
24 
25 struct Data;
26 
31 {
32 public:
36  MusicSongMeta() noexcept;
40  ~MusicSongMeta() noexcept;
41 
45  bool read(const QString &url);
49  bool save();
50 
54  QString filePath() const noexcept;
58  QString fileBasePath() noexcept;
62  QString fileRelatedPath() noexcept;
63 
67  QString artist() noexcept;
71  QString title() noexcept;
75  QString album() noexcept;
79  QString comment() noexcept;
83  QString year() noexcept;
87  QString trackNum() noexcept;
91  QString genre() noexcept;
95  QString rating() noexcept;
99  QString channel() noexcept;
103  QString format() noexcept;
107  QString description() noexcept;
108 
112  void setArtist(const QString &artist) noexcept;
116  void setTitle(const QString &title) noexcept;
120  void setAlbum(const QString &album) noexcept;
124  void setComment(const QString &comment) noexcept;
128  void setYear(const QString &year) noexcept;
132  void setTrackNum(const QString &track) noexcept;
136  void setGenre(const QString &genre) noexcept;
140  void setRating(const QString &rating) noexcept;
141 
142 public:
146  void setCover(const QPixmap &cover);
150  void setCover(const QByteArray &data);
154  QPixmap cover() noexcept;
158  QString lyrics() noexcept;
162  QString sampleRate() noexcept;
166  QString bitrate() noexcept;
170  QString duration() noexcept;
171 
172 public:
173  MusicSongMeta(const MusicSongMeta &other) noexcept;
174  MusicSongMeta(MusicSongMeta &&other) noexcept;
175 
176  MusicSongMeta& operator= (const MusicSongMeta &other) noexcept;
177  MusicSongMeta& operator= (MusicSongMeta &&other) noexcept;
178 
179 public:
183  void setSongMetaIndex(int index) noexcept;
187  int songMetaCount() const noexcept;
188 
189 private:
193  void clearSongMeta() noexcept;
197  Data *songMeta() noexcept;
201  QString formatString(TagMeta::Type type) noexcept;
205  bool readInformation();
209  bool saveInformation();
210 
211  int m_offset;
212  QString m_path;
213  QList<Data*> m_songMetas;
214 
215 };
216 
217 #endif // MUSICSONGMETA_H
#define TTK_MODULE_EXPORT
The class of the music meta.
QList< Data * > m_songMetas
The class of the music song meta.
Definition: musicsongmeta.h:30
const char * description
Definition: http_parser.c:459