TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicidentifysongrequest.h
Go to the documentation of this file.
1 #ifndef MUSICIDENTIFYSONGREQUEST_H
2 #define MUSICIDENTIFYSONGREQUEST_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 "musicabstractnetwork.h"
23 
28 {
29  QString m_songName;
30  QString m_artistName;
31 };
33 
38 {
39  Q_OBJECT
40 public:
44  explicit MusicAbstractIdentifyRequest(QObject *parent = nullptr);
45 
49  virtual void startToRequest(const QString &path, const QVariantMap &keys) = 0;
50 
54  inline void setItems(MusicSongIdentifyDataList *item) noexcept { m_items = item; }
55 
56 protected:
57  MusicSongIdentifyDataList *m_items;
58 
59 };
60 
61 
66 {
67  Q_OBJECT
68 public:
72  explicit MusicACRIdentifyRequest(QObject *parent = nullptr);
73 
77  virtual void startToRequest(const QString &path, const QVariantMap &keys) override final;
78 
79 public Q_SLOTS:
83  virtual void downloadFinished() override final;
84 
85 };
86 
87 
92 {
93  Q_OBJECT
94 public:
98  explicit MusicXFIdentifyRequest(QObject *parent = nullptr);
99 
103  virtual void startToRequest(const QString &path, const QVariantMap &keys) override final;
104 
105 public Q_SLOTS:
109  virtual void downloadFinished() override final;
110 
111 };
112 
113 
118 {
119  Q_OBJECT
120 public:
124  MusicIdentifySongRequest(QObject *parent = nullptr);
125 
129  bool initialize();
130 
134  void startToRequest(const QString &path);
135 
139  inline const MusicSongIdentifyDataList& items() const noexcept { return m_items; }
140 
141 Q_SIGNALS:
145  void finished();
146 
147 public Q_SLOTS:
151  void downloadDataFinished(const QString &bytes);
155  void downloadKeyFinished(const QByteArray &bytes);
156 
157 private:
161  void findAllPlugins();
162 
163 private:
164  QString m_path;
166  MusicSongIdentifyDataList m_items;
167 
168 };
169 
170 #endif // MUSICIDENTIFYSONGREQUEST_H
#define TTK_MODULE_EXPORT
MusicSongIdentifyDataList * m_items
virtual void startToRequest(const QString &path, const QVariantMap &keys)=0
The class of the song identify data item.
MusicSongIdentifyDataList m_items
TTK_MODULE_EXPORT void initialize(TTK::Attribute attr)
The class of the abstract network.
The class of the song identify query request.
virtual void downloadFinished()
void setItems(MusicSongIdentifyDataList *item) noexcept
The class of the abstract song identify query request.
const MusicSongIdentifyDataList & items() const noexcept
The class of the xf song identify query request.
#define const
Definition: zconf.h:233
The class of the acr song identify query request.
TTK_DECLARE_LIST(MusicSongIdentifyData)