Sayonara Player
GUI_Spectrum.h
1 /* GUI_Spectrum.h */
2 
3 /* Copyright (C) 2011-2017 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 "Components/Engine/Playback/SoundOutReceiver.h"
25 
26 #include "EnginePlugin.h"
27 
28 #include <QList>
29 
30 namespace Ui { class GUI_Spectrum; }
31 
32 class GUI_Spectrum :
33  public EnginePlugin,
34  public SpectrumReceiver
35 {
36  Q_OBJECT
37 
38 public:
39  explicit GUI_Spectrum(QWidget *parent=nullptr);
40  virtual ~GUI_Spectrum();
41 
42  QString get_name() const override;
43  QString get_display_name() const override;
44 
45 protected:
46  void paintEvent(QPaintEvent* e) override;
47  void showEvent(QShowEvent*) override;
48  void closeEvent(QCloseEvent*) override;
49  void init_ui() override;
50  void retranslate_ui() override;
51 
52 
53 protected slots:
54  void timed_out() override;
55 
56 
57 public slots:
58  void set_spectrum(const QList<float>&) override;
59  void sl_update_style() override;
60 
61 private:
62  Ui::GUI_Spectrum* ui=nullptr;
63 
64  QList<float> _spec;
65  int** _steps=nullptr;
66 
67  void resize_steps(int bins, int rects);
68 };
69 
70 #endif // GUI_SPECTRUM_H
Definition: ui_GUI_SomaFM.h:216
Definition: GUI_Spectrum.h:32
Definition: ui_GUI_Spectrum.h:59
Definition: EnginePlugin.h:34
The SpectrumReceiver class.
Definition: SoundOutReceiver.h:43