TTKMusicPlayer  4.3.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicgiflabelwidget.h
Go to the documentation of this file.
1 #ifndef MUSICGIFLABELWIDGET_H
2 #define MUSICGIFLABELWIDGET_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 <QLabel>
23 #include "musicglobaldefine.h"
24 
25 class QTimer;
26 
31 {
32  Q_OBJECT
33 public:
34  enum class Module
35  {
36  BallonWhite,
37  CicleBlue,
38  RiceFontWhite,
39  RiceFontBlack,
40  RiceFontBlackBig,
41  HourglassWhite,
42  RadioBlue,
43  CheckBlue,
44  RecordRed,
45  CloseWhite
46  };
47 
51  explicit MusicGifLabelWidget(QWidget *parent = nullptr);
52  explicit MusicGifLabelWidget(Module type, QWidget *parent = nullptr);
57 
61  void setType(Module type);
65  Module type() const noexcept;
66 
70  void setInterval(int msec);
74  int interval() const;
75 
79  void setInfinited(bool s) noexcept;
83  bool infinited() const noexcept;
84 
88  void execute(bool run);
92  inline bool isRunning() const noexcept { return m_isRunning; }
93 
97  void start();
101  void stop();
102 
103 public Q_SLOTS:
107  void updateRender();
108 
109 private:
113  virtual void paintEvent(QPaintEvent *event) override final;
117  bool infinitedModeCheck();
118 
119  int m_index;
121  QTimer *m_timer;
122  QPixmap m_renderer;
123  bool m_isRunning, m_infinited;
124 
125 };
126 
127 
132 {
133  Q_OBJECT
134 public:
138  explicit MusicGifLabelMaskWidget(QWidget *parent = nullptr);
143 
147  void execute(bool run);
151  bool isRunning() const noexcept;
152 
153 protected:
157  virtual void paintEvent(QPaintEvent *event) override;
158 
160 
161 };
162 
163 
168 {
169  Q_OBJECT
170 public:
174  explicit MusicGifLabelValueWidget(QWidget *parent = nullptr);
175 
179  inline void setValue(int value) noexcept { m_value = value; }
183  inline int value() const noexcept { return m_value; }
184 
185 private:
189  virtual void paintEvent(QPaintEvent *event) override final;
190 
191  int m_value;
192 
193 };
194 
195 #endif // MUSICGIFLABELWIDGET_H
#define TTK_MODULE_EXPORT
virtual void paintEvent(QPaintEvent *event) override
MusicGifLabelWidget * m_loadingLabel
TTK_MODULE_EXPORT bool execute(const QString &path)
void setValue(int value) noexcept
The class of the float gif label mask widget.
The class of the float gif label widget.
int value() const noexcept
#define const
Definition: zconf.h:233
The class of the float gif label value widget.