TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicdownloadwidget.h
Go to the documentation of this file.
1 #ifndef MUSICDOWNLOADWIDGET_H
2 #define MUSICDOWNLOADWIDGET_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 
25 
26 namespace Ui {
28 }
29 
30 class QLabel;
31 
36 {
37  Q_OBJECT
39 public:
43  explicit MusicDownloadTableItem(QWidget *parent = nullptr);
48 
52  void setIcon(const QString &name);
56  void setInformation(const QString &info);
60  void setText(const QString &text);
61 
62 private:
63  QLabel *m_text, *m_information, *m_icon;
64 
65 };
66 
67 
72 {
73  Q_OBJECT
75 public:
79  explicit MusicDownloadTableWidget(QWidget *parent = nullptr);
84 
88  void addCellItem(const TTK::MusicSongProperty &prop, const QString &type, const QString &icon);
92  int bitrate() const;
93 
94 public Q_SLOTS:
98  virtual void removeItems() override final;
99 
100 private:
101  QObjectList m_items;
102 
103 };
104 
105 
110 {
111  Q_OBJECT
113 public:
117  explicit MusicDownloadWidget(QWidget *parent = nullptr);
122 
126  void initialize(MusicAbstractQueryRequest *request, int row);
130  void initialize(const QString &name, MusicAbstractQueryRequest::QueryType type);
134  void initialize(const TTK::MusicSongInformation &info, MusicAbstractQueryRequest::QueryType type);
135 
136 public:
140  static bool startToRequestMusic(const TTK::MusicSongInformation &info, int bitrate, QObject *parent);
144  static bool startToRequestMovie(const TTK::MusicSongInformation &info, int bitrate, QObject *parent);
145 
146 Q_SIGNALS:
150  void dataDownloadChanged();
151 
152 public Q_SLOTS:
156  void downLoadNormalFinished();
160  void downLoadRequestFinished();
164  void startToRequest();
168  void downloadFinished();
169 
170 private:
174  void controlEnabled(bool enabled);
178  void setFixedHeightWidget(QWidget *w, int height);
182  void setMoveWidget(QWidget *w, int pos);
186  void addCellItems(const TTK::MusicSongPropertyList &props);
187 
188  Ui::MusicDownloadWidget *m_ui;
192 
193 };
194 
195 #endif // MUSICDOWNLOADWIDGET_H
#define TTK_MODULE_EXPORT
The class of the download widget.
Ui::MusicDownloadWidget * m_ui
The class of the table widget base.
The class of the music song property.
Definition: musicobject.h:223
TTK::MusicSongInformation m_songInfo
const char * name
Definition: http_parser.c:458
MusicAbstractQueryRequest * m_networkRequest
MusicAbstractQueryRequest::QueryType m_queryType
The class of the download table widget.
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
The class of the abstract query download data from net.
The class of the download table item.
The class of the music song information.
Definition: musicobject.h:281
The class of the moving widget base.