TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicdownloadqueryfactory.cpp
Go to the documentation of this file.
2 //
3 #include "musicwyqueryrequest.h"
4 #include "musickgqueryrequest.h"
5 #include "musickwqueryrequest.h"
6 //
10 //
14 //
18 //
22 //
26 //
30 //
31 #include "musicwycommentsrequest.h"
32 #include "musickgcommentsrequest.h"
33 #include "musickwcommentsrequest.h"
34 //
38 //
39 #include "musickwcoverrequest.h"
41 //
43 //
47 //
50 
52 {
53  MusicAbstractQueryRequest *request = nullptr;
54  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
56  {
57  case MusicAbstractQueryRequest::QueryServer::WY: request = new MusicWYQueryRequest(parent); break;
58  case MusicAbstractQueryRequest::QueryServer::KW: request = new MusicKWQueryRequest(parent); break;
59  case MusicAbstractQueryRequest::QueryServer::KG: request = new MusicKGQueryRequest(parent); break;
60  default: request = new MusicWYQueryRequest(parent); break;
61  }
62  TTK_INFO_STREAM("MusicQueryrequest server:" << request->queryServer());
63  return request;
64 }
65 
67 {
68  MusicAbstractQueryRequest *request = nullptr;
69  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
71  {
75  default: request = new MusicWYQueryMovieRequest(parent); break;
76  }
77  TTK_INFO_STREAM("MusicQueryMovieRequest server:" << request->queryServer());
78  return request;
79 }
80 
82 {
83  MusicAbstractQueryRequest *request = nullptr;
84  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
86  {
90  default: request = new MusicWYQueryAlbumRequest(parent); break;
91  }
92  TTK_INFO_STREAM("MusicQueryAlbumRequest server:" << request->queryServer());
93  return request;
94 }
95 
97 {
98  MusicAbstractQueryRequest *request = nullptr;
99  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
101  {
105  default: request = new MusicWYQueryArtistRequest(parent); break;
106  }
107  TTK_INFO_STREAM("MusicQueryArtistRequest server:" << request->queryServer());
108  return request;
109 }
110 
112 {
113  MusicAbstractQueryRequest *request = nullptr;
114  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
116  {
120  default: request = new MusicWYQueryArtistListRequest(parent); break;
121  }
122  TTK_INFO_STREAM("MusicQueryArtistListRequest server:" << request->queryServer());
123  return request;
124 }
125 
127 {
128  MusicAbstractQueryRequest *request = nullptr;
129  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
131  {
135  default: request = new MusicWYQueryArtistAlbumRequest(parent); break;
136  }
137  TTK_INFO_STREAM("MusicQueryArtistAlbumRequest server:" << request->queryServer());
138  return request;
139 }
140 
142 {
143  MusicAbstractQueryRequest *request = nullptr;
144  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
146  {
150  default: request = new MusicWYQueryArtistMovieRequest(parent); break;
151  }
152  TTK_INFO_STREAM("MusicQueryArtistMovieRequest server:" << request->queryServer());
153  return request;
154 }
155 
157 {
158  MusicAbstractQueryRequest *request = nullptr;
159  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
161  {
165  default: request = new MusicWYQueryToplistRequest(parent); break;
166  }
167  TTK_INFO_STREAM("MusicQueryToplistRequest server:" << request->queryServer());
168  return request;
169 }
170 
172 {
173  MusicAbstractQueryRequest *request = nullptr;
174  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
176  {
180  default: request = new MusicWYQueryPlaylistRequest(parent); break;
181  }
182  TTK_INFO_STREAM("MusicQueryPlaylistRequest server:" << request->queryServer());
183  return request;
184 }
185 
187 {
188  MusicCommentsRequest *request = nullptr;
189  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
191  {
195  default: request = new MusicWYSongCommentsRequest(parent); break;
196  }
197  return request;
198 }
199 
201 {
202  MusicCommentsRequest *request = nullptr;
203  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
205  {
209  default: request = new MusicWYPlaylistCommentsRequest(parent); break;
210  }
211  return request;
212 }
213 
215 {
216  MusicDiscoverListRequest *request = nullptr;
217  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
219  {
223  default: request = new MusicWYDiscoverListRequest(parent); break;
224  }
225  return request;
226 }
227 
229 {
230  MusicCoverRequest *request = nullptr;
231  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
233  {
235  default: request = new MusicCoverSourceRequest(parent); break;
236  }
237  return request;
238 }
239 
240 MusicAbstractDownLoadRequest *MusicDownLoadQueryFactory::makeLrcRequest(const QString &url, const QString &path, QObject *parent)
241 {
242  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
244  {
245  case MusicAbstractQueryRequest::QueryServer::WY: return (new MusicWYDownLoadTextRequest(url, path, parent));
246  case MusicAbstractQueryRequest::QueryServer::KW: return (new MusicKWDownLoadTextRequest(url, path, parent));
247  case MusicAbstractQueryRequest::QueryServer::KG: return (new MusicDownLoadTextRequest(url, path, parent));
248  default: break;
249  }
250  return (new MusicDownLoadTextRequest(url, path, parent));
251 }
252 
253 MusicAbstractDownLoadRequest *MusicDownLoadQueryFactory::makeCoverRequest(const QString &url, const QString &path, QObject *parent)
254 {
255  MusicAbstractDownLoadRequest *request = nullptr;
256  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
258  {
259  case MusicAbstractQueryRequest::QueryServer::KW: request = new MusicKWDownLoadCoverRequest(url, path, parent); break;
260  default: request = new MusicDownloadDataRequest(url, path, TTK::Download::Cover, parent); break;
261  }
262  return request;
263 }
264 
265 MusicDownloadBackgroundRequest *MusicDownLoadQueryFactory::makeBackgroundRequest(const QString &name, const QString &path, QObject *parent)
266 {
267  return (new MusicDownloadBackgroundRequest(name, path, parent));
268 }
#define TTKStaticCast(x, y)
Definition: ttkglobal.h:159
The class of the abstract download data.
The class of the kugou query toplist download data from net.
The class of the wangyi query artist album download data from net.
The class of the wangyi query playlist comments download data from net.
MusicCommentsRequest * makeSongCommentRequest(QObject *parent)
The class of the wangyi query toplist download data from net.
The class of the download the type of data.
The class of the download the type of txt.
The class of the kugou query artist download data from net.
The class of the kuwo query download data from net.
The class of the download the type of wangyi txt.
The class of the kugou query mv download data from net.
The class of the wangyi discover toplist.
MusicAbstractQueryRequest * makeToplistRequest(QObject *parent)
MusicCoverRequest * makeCoverRequest(QObject *parent)
The class of the kugou query playlist comments download data from net.
The class of the kugou query download data from net.
The class of the kuwo query playlist comments download data from net.
The class of the kugou query artist mv download data from net.
The class of the kuwo query mv download data from net.
The class of the download discover list request.
const char * name
Definition: http_parser.c:458
The class of the cover source data download request.
The class of the query song comments download data from net.
MusicAbstractQueryRequest * makeArtistMovieRequest(QObject *parent)
MusicAbstractQueryRequest * makeMovieRequest(QObject *parent)
MusicDownloadBackgroundRequest * makeBackgroundRequest(const QString &name, const QString &path, QObject *parent)
#define TTK_INFO_STREAM(msg)
Definition: ttklogger.h:67
MusicAbstractQueryRequest * makeArtistAlbumRequest(QObject *parent)
The class of the wangyi query song comments download data from net.
The class of the kuwo cover source data download request.
The class of the kugou query artist list download data from net.
The class of the kuwo query artist list download data from net.
The class of the download art background image manager request.
The class of the kugou query playlist download data from net.
MusicAbstractQueryRequest * makeQueryRequest(QObject *parent)
The class of the wangyi query artist download data from net.
The class of the kugou discover toplist.
The class of the wangyi query artist mv download data from net.
The class of the kugou query artist album download data from net.
The class of the wangyi query playlist download data from net.
The class of the wangyi query artist list download data from net.
MusicCommentsRequest * makePlaylistCommentRequest(QObject *parent)
MusicAbstractQueryRequest * makeAlbumRequest(QObject *parent)
The class of the kuwo query artist download data from net.
The class of the kugou query song comments download data from net.
The class of the kuwo query album download data from net.
The class of the kuwo query playlist download data from net.
The class of the wangyi query mv download data from net.
The class of the kugou query album download data from net.
MusicAbstractQueryRequest * makeArtistListRequest(QObject *parent)
The class of the kuwo query artist mv download data from net.
The class of the kuwo query artist album download data from net.
MusicAbstractQueryRequest * makePlaylistRequest(QObject *parent)
The class of the download the type of kuwo txt.
The class of the cover data download request.
The class of the kuwo cover data download request.
The class of the abstract query download data from net.
The class of the kuwo query song comments download data from net.
The class of the wangyi query album download data from net.
The class of the kuwo query toplist download data from net.
MusicAbstractDownLoadRequest * makeLrcRequest(const QString &url, const QString &path, QObject *parent)
The class of the kuwo discover toplist.
MusicDiscoverListRequest * makeDiscoverListRequest(QObject *parent)
The class of the wangyi query download data from net.
MusicAbstractQueryRequest * makeArtistRequest(QObject *parent)
#define G_SETTING_PTR