TTKMusicPlayer  4.1.3.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musictransitionanimationlabel.h
Go to the documentation of this file.
1 #ifndef MUSICTRANSITIONANIMATIONLABEL_H
2 #define MUSICTRANSITIONANIMATIONLABEL_H
3 
4 /***************************************************************************
5  * This file is part of the TTK Music Player project
6  * Copyright (C) 2015 - 2025 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 QPropertyAnimation;
26 namespace QAlgorithm
27 {
28 class ImageRender;
29 }
30 
35 {
36  Q_OBJECT
38 public:
39  enum class Module
40  {
41  FadeEffect,
42  BlindsEffect,
43  CubeEffect,
44  WaterEffect,
45  LeftToRightEffect,
46  TopToBottomEffect,
47  MAX = 6
48  };
49 
53  explicit MusicTransitionAnimationLabel(QWidget *parent = nullptr);
58 
62  inline void setAnimation(bool enable) { m_animationEnabled = enable; }
66  inline bool animation() const { return m_animationEnabled; }
67 
71  const QPixmap& renderPixmap() const;
72 
76  void start();
80  void stop();
81 
85  bool isRunning() const;
86 
87 public Q_SLOTS:
91  void setPixmap(const QPixmap &pix);
92 
93 private Q_SLOTS:
97  void valueChanged(const QVariant &value);
101  void animationFinished();
102 
103 private:
107  virtual void paintEvent(QPaintEvent *event) override final;
108 
113  QPixmap m_renderPixmap;
114  QPixmap m_currentPixmap, m_previousPixmap;
115  QPropertyAnimation *m_animation;
117 
118 };
119 
120 #endif // MUSICTRANSITIONANIMATIONLABEL_H
#define TTK_MODULE_EXPORT
The class of the image render.
Definition: imagewrapper.h:35
The namespace of the algorithm.
The class of the label transition animation.
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:168