TTKMusicPlayer  4.3.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 //
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 *req = nullptr;
54  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
56  {
60  default: req = new MusicWYQuerySongRequest(parent); break;
61  }
62  TTK_INFO_STREAM("MusicQuerySongRequest server:" << req->queryServer());
63  return req;
64 }
65 
67 {
68  MusicAbstractQueryRequest *req = nullptr;
69  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
71  {
75  default: req = new MusicWYQueryNewSongRequest(parent); break;
76  }
77  TTK_INFO_STREAM("MusicQueryNewSongRequest server:" << req->queryServer());
78  return req;
79 }
80 
82 {
83  MusicAbstractQueryRequest *req = nullptr;
84  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
86  {
90  default: req = new MusicWYQueryMovieRequest(parent); break;
91  }
92  TTK_INFO_STREAM("MusicQueryMovieRequest server:" << req->queryServer());
93  return req;
94 }
95 
97 {
98  MusicAbstractQueryRequest *req = nullptr;
99  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
101  {
105  default: req = new MusicWYQueryAlbumRequest(parent); break;
106  }
107  TTK_INFO_STREAM("MusicQueryAlbumRequest server:" << req->queryServer());
108  return req;
109 }
110 
112 {
113  MusicAbstractQueryRequest *req = nullptr;
114  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
116  {
120  default: req = new MusicWYQueryNewAlbumRequest(parent); break;
121  }
122  TTK_INFO_STREAM("MusicQueryNewAlbumRequest server:" << req->queryServer());
123  return req;
124 }
125 
127 {
128  MusicAbstractQueryRequest *req = nullptr;
129  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
131  {
135  default: req = new MusicWYQueryArtistRequest(parent); break;
136  }
137  TTK_INFO_STREAM("MusicQueryArtistRequest server:" << req->queryServer());
138  return req;
139 }
140 
142 {
143  MusicAbstractQueryRequest *req = nullptr;
144  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
146  {
150  default: req = new MusicWYQueryArtistListRequest(parent); break;
151  }
152  TTK_INFO_STREAM("MusicQueryArtistListRequest server:" << req->queryServer());
153  return req;
154 }
155 
157 {
158  MusicAbstractQueryRequest *req = nullptr;
159  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
161  {
165  default: req = new MusicWYQueryHotArtistListRequest(parent); break;
166  }
167  TTK_INFO_STREAM("MusicQueryHotArtistListRequest server:" << req->queryServer());
168  return req;
169 }
170 
172 {
173  MusicAbstractQueryRequest *req = nullptr;
174  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
176  {
180  default: req = new MusicWYQueryArtistAlbumRequest(parent); break;
181  }
182  TTK_INFO_STREAM("MusicQueryArtistAlbumRequest server:" << req->queryServer());
183  return req;
184 }
185 
187 {
188  MusicAbstractQueryRequest *req = nullptr;
189  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
191  {
195  default: req = new MusicWYQueryArtistMovieRequest(parent); break;
196  }
197  TTK_INFO_STREAM("MusicQueryArtistMovieRequest server:" << req->queryServer());
198  return req;
199 }
200 
202 {
203  MusicAbstractQueryRequest *req = nullptr;
204  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
206  {
210  default: req = new MusicWYQueryToplistRequest(parent); break;
211  }
212  TTK_INFO_STREAM("MusicQueryToplistRequest server:" << req->queryServer());
213  return req;
214 }
215 
217 {
218  MusicAbstractQueryRequest *req = nullptr;
219  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
221  {
225  default: req = new MusicWYQueryPlaylistRequest(parent); break;
226  }
227  TTK_INFO_STREAM("MusicQueryPlaylistRequest server:" << req->queryServer());
228  return req;
229 }
230 
232 {
233  MusicAbstractQueryRequest *req = nullptr;
234  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
236  {
240  default: req = new MusicWYQueryPlaylistRecommendRequest(parent); break;
241  }
242  TTK_INFO_STREAM("MusicQueryPlaylistRecommendRequest server:" << req->queryServer());
243  return req;
244 }
245 
247 {
248  MusicAbstractQueryRequest *req = nullptr;
249  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
251  {
255  default: req = new MusicWYQueryPlaylistHighRequest(parent); break;
256  }
257  TTK_INFO_STREAM("MusicQueryPlaylistHighRequest server:" << req->queryServer());
258  return req;
259 }
260 
262 {
263  MusicCommentsRequest *req = nullptr;
264  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
266  {
270  default: req = new MusicWYSongCommentsRequest(parent); break;
271  }
272  return req;
273 }
274 
276 {
277  MusicCommentsRequest *req = nullptr;
278  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
280  {
284  default: req = new MusicWYPlaylistCommentsRequest(parent); break;
285  }
286  return req;
287 }
288 
290 {
291  MusicDiscoverListRequest *req = nullptr;
292  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
294  {
298  default: req = new MusicWYDiscoverListRequest(parent); break;
299  }
300  return req;
301 }
302 
304 {
305  MusicCoverRequest *req = nullptr;
306  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
308  {
310  default: req = new MusicCoverSourceRequest(parent); break;
311  }
312  return req;
313 }
314 
315 MusicAbstractDownloadRequest *MusicDownloadQueryFactory::makeLrcRequest(const QString &url, const QString &path, QObject *parent)
316 {
317  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
319  {
320  case MusicAbstractQueryRequest::QueryServer::WY: return (new MusicWYDownloadTextRequest(url, path, parent));
321  case MusicAbstractQueryRequest::QueryServer::KW: return (new MusicKWDownloadTextRequest(url, path, parent));
322  case MusicAbstractQueryRequest::QueryServer::KG: return (new MusicDownloadTextRequest(url, path, parent));
323  default: break;
324  }
325  return (new MusicDownloadTextRequest(url, path, parent));
326 }
327 
328 MusicAbstractDownloadRequest *MusicDownloadQueryFactory::makeCoverRequest(const QString &url, const QString &path, QObject *parent)
329 {
330  MusicAbstractDownloadRequest *req = nullptr;
331  const int index = G_SETTING_PTR->value(MusicSettingManager::DownloadServerIndex).toInt();
333  {
334  case MusicAbstractQueryRequest::QueryServer::KW: req = new MusicKWDownloadCoverRequest(url, path, parent); break;
335  default: req = new MusicDownloadDataRequest(url, path, TTK::Download::Cover, parent); break;
336  }
337  return req;
338 }
339 
340 MusicDownloadBackgroundRequest *MusicDownloadQueryFactory::makeBackgroundRequest(const QString &name, const QString &path, QObject *parent)
341 {
342  return (new MusicDownloadBackgroundRequest(name, path, parent));
343 }
MusicAbstractQueryRequest * makePlaylistRequest(QObject *parent)
MusicAbstractQueryRequest * makePlaylistHighRequest(QObject *parent)
The class of the kuwo query new song data from net.
#define TTKStaticCast(x, y)
Definition: ttkglobal.h:231
MusicAbstractQueryRequest * makeNewSongRequest(QObject *parent)
MusicAbstractQueryRequest * makeMovieRequest(QObject *parent)
MusicAbstractQueryRequest * makeArtistMovieRequest(QObject *parent)
The class of the wangyi query song data from net.
The class of the kugou query playlist high quality data from net.
MusicAbstractQueryRequest * makeNewAlbumRequest(QObject *parent)
MusicDiscoverListRequest * makeDiscoverListRequest(QObject *parent)
MusicAbstractQueryRequest * makeAlbumRequest(QObject *parent)
The class of the kugou query toplist data from net.
The class of the wangyi query artist album data from net.
The class of the wangyi query playlist comments data from net.
The class of the wangyi query toplist data from net.
MusicCoverRequest * makeCoverRequest(QObject *parent)
The class of the download the type of data.
The class of the download the type of txt.
The class of the kugou query new song data from net.
The class of the kuwo query playlist recommend data from net.
MusicCommentsRequest * makeSongCommentRequest(QObject *parent)
MusicAbstractQueryRequest * makeArtistListRequest(QObject *parent)
The class of the wangyi query new song data from net.
The class of the kugou query artist data from net.
MusicAbstractQueryRequest * makePlaylistRecommendRequest(QObject *parent)
The class of the kuwo cover data download request.
The class of the kugou query mv data from net.
The class of the wangyi discover toplist.
The class of the kugou query playlist comments data from net.
The class of the kuwo query playlist comments data from net.
The class of the kugou query artist mv data from net.
The class of the kuwo query mv 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 kugou query song data from net.
The class of the kuwo query song data from net.
The class of the query song comments data from net.
MusicAbstractQueryRequest * makeSongRequest(QObject *parent)
The class of the wangyi query playlist recommend data from net.
#define TTK_INFO_STREAM(msg)
Definition: ttklogger.h:74
The class of the download the type of kuwo txt.
MusicDownloadBackgroundRequest * makeBackgroundRequest(const QString &name, const QString &path, QObject *parent)
The class of the wangyi query song comments data from net.
The class of the kuwo cover source data download request.
The class of the kugou query artist list data from net.
MusicAbstractQueryRequest * makeToplistRequest(QObject *parent)
MusicCommentsRequest * makePlaylistCommentRequest(QObject *parent)
The class of the kuwo query artist list data from net.
The class of the download art background image manager request.
The class of the kugou query new album data from net.
The class of the kugou query playlist data from net.
The class of the wangyi query artist data from net.
The class of the kugou discover toplist.
The class of the kuwo query playlist high quality data from net.
The class of the wangyi query artist mv data from net.
The class of the wangyi query hot artist list data from net.
The class of the kugou query artist album data from net.
The class of the wangyi query playlist data from net.
The class of the wangyi query artist list data from net.
MusicAbstractQueryRequest * makeArtistAlbumRequest(QObject *parent)
The class of the kugou query hot artist list data from net.
MusicAbstractQueryRequest * makeHotArtistListRequest(QObject *parent)
The class of the kuwo query hot artist list data from net.
The class of the abstract download data.
MusicAbstractQueryRequest * makeArtistRequest(QObject *parent)
The class of the kuwo query artist data from net.
The class of the kugou query song comments data from net.
The class of the kuwo query album data from net.
The class of the kuwo query playlist data from net.
The class of the wangyi query mv data from net.
The class of the kugou query album data from net.
The class of the kuwo query artist mv data from net.
The class of the kugou query playlist recommend data from net.
The class of the kuwo query artist album data from net.
The class of the cover data download request.
The class of the abstract query data from net.
The class of the download the type of wangyi txt.
The class of the kuwo query new album data from net.
The class of the kuwo query song comments data from net.
The class of the wangyi query album data from net.
The class of the kuwo query toplist data from net.
The class of the kuwo discover toplist.
The class of the wangyi query new album data from net.
The class of the wangyi query playlist high quality data from net.
#define G_SETTING_PTR
MusicAbstractDownloadRequest * makeLrcRequest(const QString &url, const QString &path, QObject *parent)
QString queryServer() const noexcept