TTKMusicPlayer  4.2.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 - 2025 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
41 public:
45  explicit MusicAbstractIdentifyRequest(QObject *parent = nullptr);
46 
50  bool queryCloudKey();
51 
55  virtual void startToRequest(const QString &path) = 0;
56 
60  inline const MusicSongIdentifyDataList& items() const noexcept { return m_items; }
61 
62 Q_SIGNALS:
66  void finished();
67 
68 protected Q_SLOTS:
72  virtual void downLoadKeyFinished(const QByteArray &bytes) = 0;
73 
74 protected:
75  MusicSongIdentifyDataList m_items;
76  QString m_accessKey, m_accessSecret;
77 
78 };
79 
80 
85 {
86  Q_OBJECT
88 public:
92  explicit MusicACRIdentifyRequest(QObject *parent = nullptr);
93 
97  virtual void startToRequest(const QString &path) override final;
98 
99 public Q_SLOTS:
103  virtual void downLoadFinished() override final;
104 
105 private Q_SLOTS:
109  virtual void downLoadKeyFinished(const QByteArray &bytes) override final;
110 
111 };
112 
113 
118 {
119  Q_OBJECT
121 public:
125  explicit MusicXFIdentifyRequest(QObject *parent = nullptr);
126 
130  virtual void startToRequest(const QString &path) override final;
131 
132 public Q_SLOTS:
136  virtual void downLoadFinished() override final;
137 
138 private Q_SLOTS:
142  virtual void downLoadKeyFinished(const QByteArray &bytes) override final;
143 
144 };
145 
146 #endif // MUSICIDENTIFYSONGREQUEST_H
#define TTK_MODULE_EXPORT
virtual void downLoadFinished()
The class of the song identify data item.
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:164
The class of the abstract network.
const MusicSongIdentifyDataList & items() const noexcept
virtual void startToRequest(const QString &path)=0
The class of the abstract song identify query request.
The class of the xf song identify query request.
#define const
Definition: zconf.h:233
virtual void downLoadKeyFinished(const QByteArray &bytes)=0
MusicSongIdentifyDataList m_items
The class of the acr song identify query request.
TTK_DECLARE_LIST(MusicSongIdentifyData)