TTKMusicPlayer  4.3.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 - 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 
25 
26 namespace Ui {
28 }
29 
30 class QLabel;
31 
36 {
37  Q_OBJECT
38 public:
42  explicit MusicDownloadTableItem(QWidget *parent = nullptr);
47 
51  void setIcon(const QString &name);
55  void setInformation(const QString &info);
59  void setText(const QString &text);
60 
61 private:
62  QLabel *m_text, *m_information, *m_icon;
63 
64 };
65 
66 
71 {
72  Q_OBJECT
73 public:
77  explicit MusicDownloadTableWidget(QWidget *parent = nullptr);
82 
86  void addCellItem(const TTK::MusicSongProperty &prop, const QString &type, const QString &icon);
90  int bitrate() const;
91 
92 public Q_SLOTS:
96  virtual void removeItems() override final;
97 
98 private:
99  QObjectList m_items;
100 
101 };
102 
103 
108 {
109  Q_OBJECT
110 public:
114  explicit MusicDownloadWidget(QWidget *parent = nullptr);
119 
123  void initialize(const QString &name);
127  void initialize(const TTK::MusicSongInformation &info);
131  void initialize(MusicAbstractQueryRequest *request, int row);
132 
133 public:
137  static bool startToRequestMusic(const TTK::MusicSongInformation &info, int bitrate, QObject *parent);
141  static bool startToRequestMovie(const TTK::MusicSongInformation &info, int bitrate, QObject *parent);
142 
143 Q_SIGNALS:
147  void dataDownloadChanged();
148 
149 public Q_SLOTS:
153  void close();
157  void downloadNormalFinished();
161  void downloadRequestFinished();
165  void startToRequest();
169  void downloadFinished();
170 
171 private:
175  void controlEnabled(bool enabled);
179  void setFixedHeightWidget(QWidget *w, int height);
183  void setMoveWidget(QWidget *w, int pos);
187  void addCellItems(const TTK::MusicSongPropertyList &props);
188 
190  Ui::MusicDownloadWidget *m_ui;
194 
195 };
196 
197 #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:242
const char * name
Definition: http_parser.c:458
MusicAbstractQueryRequest * m_networkRequest
MusicAbstractQueryRequest::QueryType m_queryType
The class of the download table widget.
TTK_MODULE_EXPORT void initialize(TTK::Attribute attr)
The class of the abstract query data from net.
The class of the download table item.
TTK::MusicSongInformation m_info
The class of the music song information.
Definition: musicobject.h:300
The class of the moving widget base.