Sayonara Player
Loading...
Searching...
No Matches
VisualPlugin.h
1/* VisualPlugin.h */
2
3/* Copyright (C) 2011-2024 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 ENGINEPLUGIN_H
22#define ENGINEPLUGIN_H
23
24#include "GUI_StyleSettings.h"
25#include "Gui/Plugins/PlayerPluginBase.h"
26
27#include "Components/Visualization/VisualStyleTypes.h"
28#include "Utils/Pimpl.h"
29
30#include <QTimer>
31#include <QPushButton>
32
33class EngineHandler;
34class PlayManager;
36
39{
40 Q_OBJECT
41 PIMPL(VisualPlugin)
42
43 public:
44 explicit VisualPlugin(PlayManager* playManager, QWidget* parent = nullptr);
45 ~VisualPlugin() override;
46
47 [[nodiscard]] bool hasTitle() const override;
48
49 public slots: // NOLINT(*-redundant-access-specifiers)
50 void initUi() override;
51
52 protected:
53 [[nodiscard]] bool isProcessing() const;
54 [[nodiscard]] const ColorStyle& currentStyle() const;
55
56 [[nodiscard]] virtual QWidget* widget() = 0;
57 [[nodiscard]] virtual bool hasSmallButtons() const = 0;
58
59 virtual bool applyStyle(const ColorStyle& style) = 0;
60 [[nodiscard]] virtual ColorStyle extractStyle(const RawColorStyle& rawColorStyle) const = 0;
61
62 [[nodiscard]] virtual int loadStyleIndex() const = 0;
63 virtual void saveStyleIndex(int index) const = 0;
64
65 virtual void paint() = 0;
66
67 [[nodiscard]] virtual bool isFadeoutCompleted() const = 0;
68 virtual void doFadeoutStep() = 0;
69
70 virtual void notifyDataProvider(bool isActive) = 0;
71
72 void paintEvent(QPaintEvent* e) override;
73 void showEvent(QShowEvent* e) override;
74 void closeEvent(QCloseEvent* e) override;
75 void resizeEvent(QResizeEvent* e) override;
76 void mousePressEvent(QMouseEvent* e) override;
77 void enterEvent(QEvent* e) override;
78 void leaveEvent(QEvent* e) override;
79
80 private:
81 void initButtons();
82 void showStyleSettings();
83 void reloadStyle(int newIndex);
84 void setButtonSizes();
85 void setButtonsVisible(bool b);
86
87 private slots: // NOLINT(*-redundant-access-specifiers)
88 void styleApplied();
89 void styleChanged();
90 void fadeoutTimerTimedOut();
91 void configClicked();
92 void nextClicked();
93 void prevClicked();
94 void playstateChanged(PlayState playState);
95};
96
97#endif // ENGINEPLUGIN_H
98
99
Definition PlayManager.h:34
Definition PlayerPluginBase.h:40
Definition VisualColorStyleChooser.h:34
Definition VisualPlugin.h:39
bool hasTitle() const override
indicates if title bar is shown or not
Definition VisualStyleTypes.h:37
Definition VisualStyleTypes.h:58