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 "Utils/Pimpl.h"
25 #include "Components/Engine/Playback/SoundOutReceiver.h"
26 
27 #include "EnginePlugin.h"
28 
29 UI_FWD(GUI_Spectrum)
30 
31 class GUI_Spectrum :
32  public EnginePlugin,
33  public SpectrumReceiver
34 {
35  Q_OBJECT
36  UI_CLASS(GUI_Spectrum)
37  PIMPL(GUI_Spectrum)
38 
39 public:
40  explicit GUI_Spectrum(QWidget *parent=nullptr);
41  virtual ~GUI_Spectrum();
42 
43  QString get_name() const override;
44  QString get_display_name() const override;
45 
46 protected:
47  void paintEvent(QPaintEvent* e) override;
48  void showEvent(QShowEvent*) override;
49  void closeEvent(QCloseEvent*) override;
50  void init_ui() override;
51  void retranslate_ui() override;
52  QWidget *widget() override;
53  bool has_small_buttons() const override;
54 
55 protected slots:
56  void do_fadeout_step() override;
57 
58 public slots:
59  void set_spectrum(const SpectrumList& spec) override;
60  void sl_update_style() override;
61 
62 private:
63  void resize_steps(int bins, int rects);
64 
65 };
66 
67 #endif // GUI_SPECTRUM_H
Definition: GUI_Spectrum.h:31
Definition: EnginePlugin.h:41
The SpectrumReceiver class.
Definition: SoundOutReceiver.h:45