Sayonara Player
VisualPlugin.h
1 /* VisualPlugin.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 ENGINEPLUGIN_H
22 #define ENGINEPLUGIN_H
23 
24 #include "GUI_StyleSettings.h"
25 #include "VisualStyleTypes.h"
26 #include "Gui/Plugins/PlayerPluginBase.h"
27 #include "Components/PlayManager/PlayState.h"
28 
29 #include "Utils/Pimpl.h"
30 
31 #include <QTimer>
32 #include <QPushButton>
33 
35 
36 class EngineHandler;
37 
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 
69 protected slots:
70  virtual void config_clicked();
71  virtual void next_clicked();
72  virtual void prev_clicked();
73 
74  virtual void doFadeoutStep()=0;
75 
76  virtual void playstate_changed(PlayState play_state);
77  virtual void played();
78  virtual void paused();
79  virtual void stopped();
80 
81 
82 public slots:
83  virtual void update_style(int new_index)=0;
84  virtual void update();
85  virtual void initUi() override;
86 
87 
88 public:
89  explicit VisualPlugin(QWidget* parent=nullptr);
90  virtual ~VisualPlugin();
91 
92  virtual bool hasTitle() const override;
93 };
94 
95 #endif // ENGINEPLUGIN_H
96 
97 
PlayState
PlayState
The PlayState enum.
Definition: PlayState.h:29
PlayerPlugin::Base
Definition: PlayerPluginBase.h:40
VisualPlugin
Definition: VisualPlugin.h:39
VisualColorStyleChooser
Definition: VisualColorStyleChooser.h:33
ColorStyle
Definition: VisualStyleTypes.h:37
VisualPlugin::hasTitle
virtual bool hasTitle() const override
indicates if title bar is shown or not