TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicdownloadbatchwidget.h
Go to the documentation of this file.
1 #ifndef MUSICDOWNLOADBATCHWIDGET_H
2 #define MUSICDOWNLOADBATCHWIDGET_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 
22 #include "musicdownloadwidget.h"
24 
25 namespace Ui {
27 }
28 
33 {
34  Q_OBJECT
35 public:
39  explicit MusicDownloadBatchTableItem(QWidget *parent = nullptr);
44 
48  void addCellItem(MusicAbstractQueryRequest *request, const TTK::MusicSongInformation &info);
49 
53  void startToRequest();
57  void setCurrentQuality(int index);
58 
59 public Q_SLOTS:
63  void currentQualityChanged(int index);
67  void downloadFinished();
68 
69 private:
70  int currentBitrate(int index);
74  void startToRequestMusic();
78  void startToRequestMovie();
79 
80  QComboBox *m_qulity;
82  QLabel *m_songName, *m_singer;
83  QLabel *m_information, *m_status;
86 
87 };
88 
89 
94 {
95  Q_OBJECT
96 public:
100  explicit MusicDownloadBatchTableWidget(QWidget *parent = nullptr);
105 
109  inline bool isRunning() const noexcept { return m_timer->isActive() || m_index != -1; }
110 
114  void addCellItem(MusicAbstractQueryRequest *request, const TTK::MusicSongInformation &info);
115 
116 public Q_SLOTS:
120  virtual void removeItems() override final;
124  void currentQualityChanged(int index);
128  void startToRequest();
132  void timeout();
133 
134 private:
138  void generateTimer();
139 
140 private:
141  int m_index;
142  QTimer *m_timer;
144 
145 };
146 
147 
152 {
153  Q_OBJECT
154 public:
158  explicit MusicDownloadBatchWidget(QWidget *parent = nullptr);
163 
167  void initialize(MusicAbstractQueryRequest *request, const TTKIntList &items);
168 
169 public Q_SLOTS:
173  void close();
174 
175 private:
176  Ui::MusicDownloadBatchWidget *m_ui;
177 
178 };
179 
180 #endif // MUSICDOWNLOADBATCHWIDGET_H
The class of the download batch widget.
#define TTK_MODULE_EXPORT
Ui::MusicDownloadBatchWidget * m_ui
The class of the table widget base.
QList< int > TTKIntList
Definition: ttkqtglobal.h:200
TTK::MusicSongInformation m_info
The class of the download batch table item.
MusicAbstractQueryRequest * m_networkRequest
TTK_MODULE_EXPORT void initialize(TTK::Attribute attr)
The class of the moving dialog base.
The class of the download batch table widget.
MusicAbstractQueryRequest::QueryType m_queryType
The class of the abstract query data from net.
#define const
Definition: zconf.h:233
The class of the music song information.
Definition: musicobject.h:300