TTKMusicPlayer  3.7.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 - 2024 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 MusicMeta;
26 
31 {
33 public:
37  MusicSongMeta() noexcept;
41  ~MusicSongMeta() noexcept;
42 
46  bool read(const QString &url);
50  bool save();
51 
55  QString filePath() const noexcept;
59  QString fileBasePath() noexcept;
63  QString fileRelatedPath() noexcept;
64 
68  QString artist() noexcept;
72  QString title() noexcept;
76  QString album() noexcept;
80  QString comment() noexcept;
84  QString year() noexcept;
88  QString trackNum() noexcept;
92  QString genre() noexcept;
96  QString rating() noexcept;
100  QString channel() noexcept;
104  QString description() noexcept;
105 
109  void setArtist(const QString &artist) noexcept;
113  void setTitle(const QString &title) noexcept;
117  void setAlbum(const QString &album) noexcept;
121  void setComment(const QString &comment) noexcept;
125  void setYear(const QString &year) noexcept;
129  void setTrackNum(const QString &track) noexcept;
133  void setGenre(const QString &genre) noexcept;
137  void setRating(const QString &rating) noexcept;
138 
139 public:
143  void setCover(const QPixmap &cover) noexcept;
147  void setCover(const QByteArray &data) noexcept;
151  QPixmap cover() noexcept;
155  QString lyrics() noexcept;
159  QString sampleRate() noexcept;
163  QString bitrate() noexcept;
167  QString duration() noexcept;
168 
169 public:
170  MusicSongMeta(const MusicSongMeta &other) noexcept;
171  MusicSongMeta(MusicSongMeta &&other) noexcept;
172 
173  MusicSongMeta& operator= (const MusicSongMeta &other) noexcept;
174  MusicSongMeta& operator= (MusicSongMeta &&other) noexcept;
175 
176 public:
180  void setSongMetaIndex(int index) noexcept;
184  int songMetaCount() const noexcept;
185 
186 private:
190  void clearSongMeta() noexcept;
194  MusicMeta *songMeta() noexcept;
198  QString formatString(TagMeta::Type type) noexcept;
202  bool readInformation();
206  bool saveInformation();
207 
208  int m_offset;
209  QString m_path;
210  QList<MusicMeta*> m_songMetas;
211 
212 };
213 
214 #endif // MUSICSONGMETA_H
#define TTK_MODULE_EXPORT
QList< MusicMeta * > m_songMetas
The class of the music meta.
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
The class of the music song meta.
Definition: musicsongmeta.h:30
const char * description
Definition: http_parser.c:459