TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musictopareawidget.h
Go to the documentation of this file.
1 #ifndef MUSICTOPAREAWIDGET_H
2 #define MUSICTOPAREAWIDGET_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 <QTimer>
23 #include <QWidget>
24 #include "musicglobaldefine.h"
25 
26 class MusicRemoteWidget;
28 
29 namespace Ui {
30  class MusicApplication;
31 }
32 
36 class TTK_MODULE_EXPORT MusicTopAreaWidget : public QWidget
37 {
38  Q_OBJECT
39 public:
43  explicit MusicTopAreaWidget(QWidget *parent = nullptr);
48 
52  static MusicTopAreaWidget *instance();
53 
57  void setupUi(Ui::MusicApplication *ui);
58 
62  void setBackgroundParameter();
66  inline QString backgroundPath() const noexcept { return m_backgroundImagePath; }
70  inline int backgroundTransparent() const noexcept { return m_backgroundTransparent; }
74  int backgroundListTransparent();
78  bool backgroundTransparentEnabled() const;
79 
83  const QImage& originImage() const;
87  const QPixmap& renderPixmap() const;
88 
92  void setBackgroundAnimation(bool state);
96  void setCurrentPlayState(bool state) const;
100  void setLabelText(const QString &name) const;
104  void setVolumeValue(int value) const;
105 
106 Q_SIGNALS:
110  void originImageChanged(const QImage &image);
111 
112 public Q_SLOTS:
116  void showSkinManagerWidget();
120  void setArtistBackground();
124  void backgroundTransparentChanged();
128  void backgroundTransparentChanged(int value);
132  void backgroundTransparentChanged(const QString &fileName);
136  void backgroundSkinChanged(const QString &fileName);
140  void backgroundChanged();
144  void backgroundAnimationChanged(bool state);
148  void backgroundThemeDownloadFinished();
152  void backgroundThemeChangedByResize();
156  void playlistTransparentChanged(int index);
160  void showSquareRemote();
164  void showRectangleRemote();
168  void showSimpleStyleRemote();
172  void showComplexStyleRemote();
176  void showRippleRemote();
180  void showWallpaperRemote(bool create);
184  void deleteCurrentRemote();
188  void remoteTypeChanged(QAction *type);
192  void remoteTypeChanged(int type);
196  void showToolSetsWidget();
197 
198 private:
202  void backgroundTransparent(int value);
206  bool isArtistBackground() const;
210  void createRemoteWidget();
214  void drawWindowBackground();
218  void drawWindowBackground(const QImage &image);
222  void drawWindowBackgroundByImage();
226  void drawWindowBackgroundByPath(const QString &path);
227 
228  Ui::MusicApplication *m_ui;
234  int m_backgroundTransparent, m_backgroundListTransparent;
236 
238 
239 };
240 
241 #endif // MUSICTOPAREAWIDGET_H
int backgroundTransparent() const noexcept
#define TTK_MODULE_EXPORT
The class of the app top area widget.
The class of the local background widget.
The class of the app main widget.
MusicRemoteWidget * m_remoteWidget
Ui::MusicApplication * m_ui
const char * name
Definition: http_parser.c:458
The class of the desktop remote widget base.
static MusicTopAreaWidget * m_instance
MusicBackgroundSkinDialog * m_backgroundWidget
#define const
Definition: zconf.h:233
QString backgroundPath() const noexcept
state
Definition: http_parser.c:279