TTKMusicPlayer  4.2.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
musicspectrumlayoutwidget.h
Go to the documentation of this file.
1 #ifndef MUSICSPECTRUMLAYOUTWIDGET_H
2 #define MUSICSPECTRUMLAYOUTWIDGET_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 <QCheckBox>
23 #include <QBoxLayout>
24 #include "ttkclickedlabel.h"
25 #include "musictoolmenuwidget.h"
26 
31 {
32  Q_OBJECT
34 public:
38  explicit MusicSpectrumLayoutItem(QWidget *parent = nullptr);
39 
43  void addCellItem(const QString &item, const QString &tip);
44 
48  void setChecked(bool checked);
52  bool isChecked() const;
53 
54 private:
58  virtual void paintEvent(QPaintEvent *event) override final;
59 
61 };
62 
63 
68 {
69  Q_OBJECT
71 public:
75  explicit MusicSpectrumLayoutWidget(QWidget *parent = nullptr);
80 
81 Q_SIGNALS:
85  void stateChanged(bool &state, const QString &name);
86 
87 public Q_SLOTS:
91  virtual void popupMenu() override final;
95  void labelClicked(int index);
96 
97 protected:
98  using SpectrumInfo = QPair<QString, QString>;
99  using SpectrumInfoList = QList<SpectrumInfo>;
100 
101 protected:
105  virtual QStringList spectrumTypeList() const = 0;
109  void initialize();
113  void addCellItems(const SpectrumInfoList &items);
114 
116  QVBoxLayout *m_containLayout;
117  QList<MusicSpectrumLayoutItem*> m_items;
118 
119 };
120 
121 
126 {
127  Q_OBJECT
129 public:
133  explicit MusicSpectrumNormalLayoutWidget(QWidget *parent = nullptr);
134 
135 private:
139  virtual QStringList spectrumTypeList() const override final;
140 
141 };
142 
143 
148 {
149  Q_OBJECT
151 public:
155  explicit MusicSpectrumPlusLayoutWidget(QWidget *parent = nullptr);
156 
157 private:
161  virtual QStringList spectrumTypeList() const override final;
162 
163 };
164 
165 
170 {
171  Q_OBJECT
173 public:
177  explicit MusicSpectrumFlowLayoutWidget(QWidget *parent = nullptr);
178 
179 private:
183  virtual QStringList spectrumTypeList() const override final;
184 
185 };
186 
187 
192 {
193  Q_OBJECT
195 public:
199  explicit MusicSpectrumWaveLayoutWidget(QWidget *parent = nullptr);
200 
201 private:
205  virtual QStringList spectrumTypeList() const override final;
206 
207 };
208 
209 
214 {
215  Q_OBJECT
217 public:
221  explicit MusicSpectrumFloridLayoutWidget(QWidget *parent = nullptr);
222 
223 private:
227  virtual QStringList spectrumTypeList() const override final;
228 
229 };
230 
231 #endif // MUSICSPECTRUMLAYOUTWIDGET_H
#define TTK_MODULE_EXPORT
The class of the music spectrum wave layout widget.
The class of the tool menu base widget.
The class of the music spectrum layout item.
The class of the music spectrum normal layout widget.
The class of the label widget that can click.
The class of the music spectrum florid layout widget.
The class of the music spectrum layout widget.
const char * name
Definition: http_parser.c:458
QPair< QString, QString > SpectrumInfo
QList< MusicSpectrumLayoutItem * > m_items
#define TTK_DECLARE_MODULE(Class)
Definition: ttkqtglobal.h:164
The class of the music spectrum flow layout widget.
The class of the music spectrum plus layout widget.
virtual QStringList spectrumTypeList() const =0
QList< SpectrumInfo > SpectrumInfoList
state
Definition: http_parser.c:279