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/AudioDataReceiver.h"
27#include "Interfaces/AudioDataProvider.h"
28
29#include <vector>
30
31UI_FWD(GUI_Spectrum)
32
35 public VisualPlugin,
37{
38 Q_OBJECT
39 UI_CLASS(GUI_Spectrum)
40 PIMPL(GUI_Spectrum)
41
42 public:
43 explicit GUI_Spectrum(SpectrumDataProvider* dataProvider, PlayManager* playManager, QWidget* parent = nullptr);
44 ~GUI_Spectrum() override;
45
46 QString name() const override;
47 QString displayName() const override;
48 bool isActive() const override;
49
50 protected:
51 void paintEvent(QPaintEvent* e) override;
52 void showEvent(QShowEvent* e) override;
53 void closeEvent(QCloseEvent* e) override;
54 void initUi() override;
55 void retranslate() override;
56
57 QWidget* widget() override;
58 bool hasSmallButtons() const override;
59 ColorStyle currentStyle() const override;
60 int currentStyleIndex() const override;
61 void finalizeInitialization() override;
62
63 protected slots:
64 void doFadeoutStep() override;
65
66 public slots:
67 void setSpectrum(const std::vector<float>& spectrum) override;
68 void update_style(int new_index) override;
69};
70
71#endif // GUI_SPECTRUM_H
The SpectrumReceiver class.
Definition: AudioDataReceiver.h:48
Definition: GUI_Spectrum.h:37
QString displayName() const override
must be overwritten
QString name() const override
must be overwritten
Global handler for current playback state (Singleton)
Definition: PlayManager.h:36
Definition: AudioDataProvider.h:45
Definition: VisualPlugin.h:38
Definition: VisualStyleTypes.h:37