TTKMusicPlayer  3.7.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 - 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 
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
40 public:
44  explicit MusicTopAreaWidget(QWidget *parent = nullptr);
49 
53  static MusicTopAreaWidget *instance();
54 
58  void setupUi(Ui::MusicApplication *ui);
59 
63  void setBackgroundParameter();
67  inline QString backgroundPath() const { return m_backgroundImagePath; }
71  inline int backgroundAlpha() const { return m_backgroundAlpha; }
75  int backgroundListAlpha();
79  bool backgroundTransparentEnable() const;
80 
84  const QImage& originImage() const;
88  const QPixmap& rendererPixmap() const;
89 
93  void setBackgroundAnimation(bool state);
97  void setCurrentPlayState(bool state) const;
101  void setLabelText(const QString &name) const;
105  void setVolumeValue(int value) const;
106 
107 Q_SIGNALS:
111  void originImageChanged(const QImage &image);
112 
113 public Q_SLOTS:
117  void showSkinManagerWidget();
121  void setAsArtistBackground();
125  void backgroundTransparentChanged();
129  void backgroundTransparentChanged(int value);
133  void backgroundTransparentChanged(const QString &fileName);
137  void backgroundSkinChanged(const QString &fileName);
141  void backgroundChanged();
145  void backgroundAnimationChanged(bool state);
149  void backgroundThemeDownloadFinished();
153  void backgroundThemeChangedByResize();
157  void playlistTransparent(int index);
161  void showSquareRemote();
165  void showRectangleRemote();
169  void showSimpleStyleRemote();
173  void showComplexStyleRemote();
177  void showRippleRemote();
181  void showWallpaperRemote(bool create);
185  void deleteCurrentRemote();
189  void remoteTypeChanged(QAction *type);
193  void remoteTypeChanged(int type);
197  void showToolSetsWidget();
198 
199 private:
203  void backgroundTransparent(int value);
207  bool isEnableBackground() const;
211  void createRemoteWidget();
215  void drawWindowBackgroundRect();
219  void drawWindowBackgroundRect(const QImage &image);
223  void drawWindowBackgroundRectString();
227  void drawWindowBackgroundRectString(const QString &path);
228 
229  Ui::MusicApplication *m_ui;
235  int m_backgroundAlpha, m_backgroundListAlpha;
237 
239 
240 };
241 
242 #endif // MUSICTOPAREAWIDGET_H
#define TTK_MODULE_EXPORT
The class of the app top area widget.
int backgroundAlpha() const
static void rendererPixmap(Ui::MusicFileInformationWidget *ui, const QPixmap &pixmap)
The class of the local background widget.
QString backgroundPath() const
The class of the app main widget.
MusicRemoteWidget * m_remoteWidget
Ui::MusicApplication * m_ui
const char * name
Definition: http_parser.c:458
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:152
The class of the desktop remote widget base.
static MusicTopAreaWidget * m_instance
MusicBackgroundSkinDialog * m_backgroundWidget
state
Definition: http_parser.c:279