Sayonara Player
GUI_Spectrum.h
1 /* GUI_Spectrum.h */
2 
3 /* Copyright (C) 2011-2020 Michael Lugmair (Lucio Carreras)
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef GUI_SPECTRUM_H
22 #define GUI_SPECTRUM_H
23 
24 #include "VisualPlugin.h"
25 #include "Utils/Pimpl.h"
26 #include "Interfaces/Engine/AudioDataReceiverInterface.h"
27 
28 UI_FWD(GUI_Spectrum)
29 
30 class GUI_Spectrum :
31  public VisualPlugin,
32  public Engine::SpectrumReceiver
33 {
34  Q_OBJECT
35  UI_CLASS(GUI_Spectrum)
36  PIMPL(GUI_Spectrum)
37 
38  public:
39  explicit GUI_Spectrum(QWidget* parent=nullptr);
40  ~GUI_Spectrum() override;
41 
42  QString name() const override;
43  QString displayName() const override;
44  bool isActive() const override;
45 
46  protected:
47  void paintEvent(QPaintEvent* e) override;
48  void showEvent(QShowEvent* e) override;
49  void closeEvent(QCloseEvent* e) override;
50  void initUi() override;
51  void retranslate() override;
52 
53  QWidget* widget() override;
54  bool hasSmallButtons() const override;
55  ColorStyle currentStyle() const override;
56  int currentStyleIndex() const override;
57  void finalizeInitialization() override;
58 
59  protected slots:
60  void doFadeoutStep() override;
61 
62  public slots:
63  void setSpectrum(const Engine::SpectrumList& spec) override;
64  void update_style(int new_index) override;
65 
66  private:
67  void activeChanged();
68 };
69 
70 #endif // GUI_SPECTRUM_H
GUI_Spectrum::displayName
QString displayName() const override
must be overwritten
Style::currentStyle
QString currentStyle()
stylesheet with all replace variables
VisualPlugin
Definition: VisualPlugin.h:39
ColorStyle
Definition: VisualStyleTypes.h:37
GUI_Spectrum
Definition: GUI_Spectrum.h:33
GUI_Spectrum::name
QString name() const override
must be overwritten