TTKMusicPlayer  4.3.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 - 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 <QCheckBox>
23 #include <QBoxLayout>
24 #include "ttkclickedlabel.h"
25 #include "musictoolmenuwidget.h"
26 
31 {
32  Q_OBJECT
33 public:
37  explicit MusicSpectrumLayoutItem(QWidget *parent = nullptr);
38 
42  void addCellItem(const QString &item, const QString &tip);
43 
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
69 public:
73  explicit MusicSpectrumLayoutWidget(QWidget *parent = nullptr);
78 
79 Q_SIGNALS:
83  void stateChanged(bool &state, const QString &name);
84 
85 public Q_SLOTS:
89  virtual void popupMenu() override final;
93  void labelClicked(int index);
94 
95 protected:
96  using SpectrumInfo = QPair<QString, QString>;
97  using SpectrumInfoList = QList<SpectrumInfo>;
98 
99 protected:
103  virtual QStringList spectrumTypeList() const = 0;
107  void initialize();
111  void addCellItems(const SpectrumInfoList &items);
112 
114  QVBoxLayout *m_containLayout;
115  QList<MusicSpectrumLayoutItem*> m_items;
116 
117 };
118 
119 
124 {
125  Q_OBJECT
126 public:
130  explicit MusicSpectrumNormalLayoutWidget(QWidget *parent = nullptr);
131 
132 private:
136  virtual QStringList spectrumTypeList() const override final;
137 
138 };
139 
140 
145 {
146  Q_OBJECT
147 public:
151  explicit MusicSpectrumPlusLayoutWidget(QWidget *parent = nullptr);
152 
153 private:
157  virtual QStringList spectrumTypeList() const override final;
158 
159 };
160 
161 
166 {
167  Q_OBJECT
168 public:
172  explicit MusicSpectrumFlowLayoutWidget(QWidget *parent = nullptr);
173 
174 private:
178  virtual QStringList spectrumTypeList() const override final;
179 
180 };
181 
182 
187 {
188  Q_OBJECT
189 public:
193  explicit MusicSpectrumWaveLayoutWidget(QWidget *parent = nullptr);
194 
195 private:
199  virtual QStringList spectrumTypeList() const override final;
200 
201 };
202 
203 
208 {
209  Q_OBJECT
210 public:
214  explicit MusicSpectrumFloridLayoutWidget(QWidget *parent = nullptr);
215 
216 private:
220  virtual QStringList spectrumTypeList() const override final;
221 
222 };
223 
224 #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
The class of the music spectrum flow layout widget.
TTK_MODULE_EXPORT void initialize(TTK::Attribute attr)
The class of the music spectrum plus layout widget.
virtual QStringList spectrumTypeList() const =0
QList< SpectrumInfo > SpectrumInfoList
state
Definition: http_parser.c:279