TTKMusicPlayer  3.7.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 - 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 <QCheckBox>
23 #include <QBoxLayout>
24 #include "musictoolmenuwidget.h"
25 #include "ttkclickedlabel.h"
26 
31 {
32  Q_OBJECT
34 public:
38  explicit MusicSpectrumLayoutItem(QWidget *parent = nullptr);
39 
43  void addCellItem(const QString &item, const QString &tip);
47  void setChecked(bool checked);
51  bool isChecked() const;
52 
53 private:
57  virtual void paintEvent(QPaintEvent *event) override final;
58 
60 };
61 
62 
67 {
68  Q_OBJECT
70 public:
74  explicit MusicSpectrumLayoutWidget(QWidget *parent = nullptr);
79 
80 Q_SIGNALS:
84  void stateChanged(bool &state, const QString &name);
85 
86 public Q_SLOTS:
90  virtual void popupMenu() override final;
94  void labelClicked(int index);
95 
96 protected:
97  using SpectrumInfo = QPair<QString, QString>;
98  using SpectrumInfoList = QList<SpectrumInfo>;
99 
100 protected:
104  virtual QStringList spectrumTypeList() const = 0;
108  void initialize();
112  void addCellItems(const SpectrumInfoList &items);
113 
115  QVBoxLayout *m_containLayout;
116  QList<MusicSpectrumLayoutItem*> m_items;
117 
118 };
119 
120 
125 {
126  Q_OBJECT
128 public:
132  explicit MusicSpectrumNormalLayoutWidget(QWidget *parent = nullptr);
133 
134 private:
138  virtual QStringList spectrumTypeList() const override final;
139 
140 };
141 
142 
147 {
148  Q_OBJECT
150 public:
154  explicit MusicSpectrumPlusLayoutWidget(QWidget *parent = nullptr);
155 
156 private:
160  virtual QStringList spectrumTypeList() const override final;
161 
162 };
163 
164 
169 {
170  Q_OBJECT
172 public:
176  explicit MusicSpectrumFlowLayoutWidget(QWidget *parent = nullptr);
177 
178 private:
182  virtual QStringList spectrumTypeList() const override final;
183 
184 };
185 
186 
191 {
192  Q_OBJECT
194 public:
198  explicit MusicSpectrumWaveLayoutWidget(QWidget *parent = nullptr);
199 
200 private:
204  virtual QStringList spectrumTypeList() const override final;
205 
206 };
207 
208 
213 {
214  Q_OBJECT
216 public:
220  explicit MusicSpectrumFloridLayoutWidget(QWidget *parent = nullptr);
221 
222 private:
226  virtual QStringList spectrumTypeList() const override final;
227 
228 };
229 
230 #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:152
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