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 "VisualStyleTypes.h"
26#include "Gui/Plugins/PlayerPluginBase.h"
27
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 private:
43 void set_button_sizes();
44 void set_buttons_visible(bool b);
45
46 protected:
47 VisualColorStyleChooser* m_ecsc = nullptr;
48
49 void init_buttons();
50
51 virtual void showEvent(QShowEvent* e) override;
52 virtual void closeEvent(QCloseEvent* e) override;
53 virtual void resizeEvent(QResizeEvent* e) override;
54 virtual void mousePressEvent(QMouseEvent* e) override;
55 virtual void enterEvent(QEvent* e) override;
56 virtual void leaveEvent(QEvent* e) override;
57
58 virtual QWidget* widget() = 0;
59 virtual ColorStyle currentStyle() const = 0;
60 virtual int currentStyleIndex() const = 0;
61 virtual bool hasSmallButtons() const = 0;
62
63 void stop_fadeout_timer();
64
65 private slots:
66 void style_changed();
67
68 protected slots:
69 virtual void config_clicked();
70 virtual void next_clicked();
71 virtual void prev_clicked();
72
73 virtual void doFadeoutStep() = 0;
74
75 virtual void playstate_changed(PlayState play_state);
76 virtual void played();
77 virtual void paused();
78 virtual void stopped();
79
80 public slots:
81 virtual void update_style(int new_index) = 0;
82 virtual void update();
83 virtual void initUi() override;
84
85 public:
86 explicit VisualPlugin(PlayManager* playManager, QWidget* parent = nullptr);
87 virtual ~VisualPlugin();
88
89 virtual bool hasTitle() const override;
90};
91
92#endif // ENGINEPLUGIN_H
93
94
Definition: PlayManager.h:34
Definition: PlayerPluginBase.h:40
Definition: VisualColorStyleChooser.h:33
Definition: VisualPlugin.h:39
virtual bool hasTitle() const override
indicates if title bar is shown or not
Definition: VisualStyleTypes.h:37